@telepix-lab/telepix-ui 0.9.1 → 0.9.3
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/cjs/client.js +358 -650
- package/dist/cjs/index.js +190 -434
- package/dist/color.css +1 -1
- package/dist/esm/client.js +358 -650
- package/dist/esm/index.js +190 -434
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/dist/cjs/client.js
CHANGED
|
@@ -1834,13 +1834,6 @@ function RemoveScrollSideCar(props) {
|
|
|
1834
1834
|
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
|
|
1835
1835
|
return false;
|
|
1836
1836
|
}
|
|
1837
|
-
// allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target
|
|
1838
|
-
var selection = window.getSelection();
|
|
1839
|
-
var anchorNode = selection && selection.anchorNode;
|
|
1840
|
-
var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
|
|
1841
|
-
if (isTouchingSelection) {
|
|
1842
|
-
return false;
|
|
1843
|
-
}
|
|
1844
1837
|
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1845
1838
|
if (!canBeScrolledInMainDirection) {
|
|
1846
1839
|
return true;
|
|
@@ -2087,7 +2080,7 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
2087
2080
|
};
|
|
2088
2081
|
|
|
2089
2082
|
var DIALOG_NAME = "Dialog";
|
|
2090
|
-
var [createDialogContext] = createContextScope(DIALOG_NAME);
|
|
2083
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
2091
2084
|
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
2092
2085
|
var Dialog$1 = (props) => {
|
|
2093
2086
|
const {
|
|
@@ -2444,7 +2437,7 @@ function useSize(element) {
|
|
|
2444
2437
|
}
|
|
2445
2438
|
|
|
2446
2439
|
var CHECKBOX_NAME = "Checkbox";
|
|
2447
|
-
var [createCheckboxContext] = createContextScope(CHECKBOX_NAME);
|
|
2440
|
+
var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
|
|
2448
2441
|
var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
|
|
2449
2442
|
function CheckboxProvider(props) {
|
|
2450
2443
|
const {
|
|
@@ -2721,6 +2714,10 @@ const oppositeSideMap = {
|
|
|
2721
2714
|
bottom: 'top',
|
|
2722
2715
|
top: 'bottom'
|
|
2723
2716
|
};
|
|
2717
|
+
const oppositeAlignmentMap = {
|
|
2718
|
+
start: 'end',
|
|
2719
|
+
end: 'start'
|
|
2720
|
+
};
|
|
2724
2721
|
function clamp$1(start, value, end) {
|
|
2725
2722
|
return max(start, min(value, end));
|
|
2726
2723
|
}
|
|
@@ -2739,9 +2736,9 @@ function getOppositeAxis(axis) {
|
|
|
2739
2736
|
function getAxisLength(axis) {
|
|
2740
2737
|
return axis === 'y' ? 'height' : 'width';
|
|
2741
2738
|
}
|
|
2739
|
+
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
2742
2740
|
function getSideAxis(placement) {
|
|
2743
|
-
|
|
2744
|
-
return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
|
|
2741
|
+
return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
|
|
2745
2742
|
}
|
|
2746
2743
|
function getAlignmentAxis(placement) {
|
|
2747
2744
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -2764,7 +2761,7 @@ function getExpandedPlacements(placement) {
|
|
|
2764
2761
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
2765
2762
|
}
|
|
2766
2763
|
function getOppositeAlignmentPlacement(placement) {
|
|
2767
|
-
return placement.
|
|
2764
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
2768
2765
|
}
|
|
2769
2766
|
const lrPlacement = ['left', 'right'];
|
|
2770
2767
|
const rlPlacement = ['right', 'left'];
|
|
@@ -2795,8 +2792,7 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
|
2795
2792
|
return list;
|
|
2796
2793
|
}
|
|
2797
2794
|
function getOppositePlacement(placement) {
|
|
2798
|
-
|
|
2799
|
-
return oppositeSideMap[side] + placement.slice(side.length);
|
|
2795
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
2800
2796
|
}
|
|
2801
2797
|
function expandPaddingObject(padding) {
|
|
2802
2798
|
return {
|
|
@@ -2890,74 +2886,6 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
2890
2886
|
return coords;
|
|
2891
2887
|
}
|
|
2892
2888
|
|
|
2893
|
-
/**
|
|
2894
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
2895
|
-
* element is overflowing a given clipping boundary on each side.
|
|
2896
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
2897
|
-
* - negative = how many pixels left before it will overflow
|
|
2898
|
-
* - 0 = lies flush with the boundary
|
|
2899
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
2900
|
-
*/
|
|
2901
|
-
async function detectOverflow(state, options) {
|
|
2902
|
-
var _await$platform$isEle;
|
|
2903
|
-
if (options === void 0) {
|
|
2904
|
-
options = {};
|
|
2905
|
-
}
|
|
2906
|
-
const {
|
|
2907
|
-
x,
|
|
2908
|
-
y,
|
|
2909
|
-
platform,
|
|
2910
|
-
rects,
|
|
2911
|
-
elements,
|
|
2912
|
-
strategy
|
|
2913
|
-
} = state;
|
|
2914
|
-
const {
|
|
2915
|
-
boundary = 'clippingAncestors',
|
|
2916
|
-
rootBoundary = 'viewport',
|
|
2917
|
-
elementContext = 'floating',
|
|
2918
|
-
altBoundary = false,
|
|
2919
|
-
padding = 0
|
|
2920
|
-
} = evaluate(options, state);
|
|
2921
|
-
const paddingObject = getPaddingObject(padding);
|
|
2922
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
2923
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
2924
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
2925
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
2926
|
-
boundary,
|
|
2927
|
-
rootBoundary,
|
|
2928
|
-
strategy
|
|
2929
|
-
}));
|
|
2930
|
-
const rect = elementContext === 'floating' ? {
|
|
2931
|
-
x,
|
|
2932
|
-
y,
|
|
2933
|
-
width: rects.floating.width,
|
|
2934
|
-
height: rects.floating.height
|
|
2935
|
-
} : rects.reference;
|
|
2936
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
2937
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
2938
|
-
x: 1,
|
|
2939
|
-
y: 1
|
|
2940
|
-
} : {
|
|
2941
|
-
x: 1,
|
|
2942
|
-
y: 1
|
|
2943
|
-
};
|
|
2944
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2945
|
-
elements,
|
|
2946
|
-
rect,
|
|
2947
|
-
offsetParent,
|
|
2948
|
-
strategy
|
|
2949
|
-
}) : rect);
|
|
2950
|
-
return {
|
|
2951
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
2952
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
2953
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
2954
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
2955
|
-
};
|
|
2956
|
-
}
|
|
2957
|
-
|
|
2958
|
-
// Maximum number of resets that can occur before bailing to avoid infinite reset loops.
|
|
2959
|
-
const MAX_RESET_COUNT = 50;
|
|
2960
|
-
|
|
2961
2889
|
/**
|
|
2962
2890
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
2963
2891
|
* next to a given reference element.
|
|
@@ -2972,10 +2900,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
2972
2900
|
middleware = [],
|
|
2973
2901
|
platform
|
|
2974
2902
|
} = config;
|
|
2975
|
-
const
|
|
2976
|
-
...platform,
|
|
2977
|
-
detectOverflow
|
|
2978
|
-
};
|
|
2903
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
2979
2904
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
2980
2905
|
let rects = await platform.getElementRects({
|
|
2981
2906
|
reference,
|
|
@@ -2987,17 +2912,13 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
2987
2912
|
y
|
|
2988
2913
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
2989
2914
|
let statefulPlacement = placement;
|
|
2915
|
+
let middlewareData = {};
|
|
2990
2916
|
let resetCount = 0;
|
|
2991
|
-
|
|
2992
|
-
for (let i = 0; i < middleware.length; i++) {
|
|
2993
|
-
const currentMiddleware = middleware[i];
|
|
2994
|
-
if (!currentMiddleware) {
|
|
2995
|
-
continue;
|
|
2996
|
-
}
|
|
2917
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
2997
2918
|
const {
|
|
2998
2919
|
name,
|
|
2999
2920
|
fn
|
|
3000
|
-
} =
|
|
2921
|
+
} = validMiddleware[i];
|
|
3001
2922
|
const {
|
|
3002
2923
|
x: nextX,
|
|
3003
2924
|
y: nextY,
|
|
@@ -3011,7 +2932,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3011
2932
|
strategy,
|
|
3012
2933
|
middlewareData,
|
|
3013
2934
|
rects,
|
|
3014
|
-
platform
|
|
2935
|
+
platform,
|
|
3015
2936
|
elements: {
|
|
3016
2937
|
reference,
|
|
3017
2938
|
floating
|
|
@@ -3019,11 +2940,14 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3019
2940
|
});
|
|
3020
2941
|
x = nextX != null ? nextX : x;
|
|
3021
2942
|
y = nextY != null ? nextY : y;
|
|
3022
|
-
middlewareData
|
|
3023
|
-
...middlewareData
|
|
3024
|
-
|
|
2943
|
+
middlewareData = {
|
|
2944
|
+
...middlewareData,
|
|
2945
|
+
[name]: {
|
|
2946
|
+
...middlewareData[name],
|
|
2947
|
+
...data
|
|
2948
|
+
}
|
|
3025
2949
|
};
|
|
3026
|
-
if (reset && resetCount
|
|
2950
|
+
if (reset && resetCount <= 50) {
|
|
3027
2951
|
resetCount++;
|
|
3028
2952
|
if (typeof reset === 'object') {
|
|
3029
2953
|
if (reset.placement) {
|
|
@@ -3053,6 +2977,71 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
3053
2977
|
};
|
|
3054
2978
|
};
|
|
3055
2979
|
|
|
2980
|
+
/**
|
|
2981
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
2982
|
+
* element is overflowing a given clipping boundary on each side.
|
|
2983
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
2984
|
+
* - negative = how many pixels left before it will overflow
|
|
2985
|
+
* - 0 = lies flush with the boundary
|
|
2986
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
2987
|
+
*/
|
|
2988
|
+
async function detectOverflow(state, options) {
|
|
2989
|
+
var _await$platform$isEle;
|
|
2990
|
+
if (options === void 0) {
|
|
2991
|
+
options = {};
|
|
2992
|
+
}
|
|
2993
|
+
const {
|
|
2994
|
+
x,
|
|
2995
|
+
y,
|
|
2996
|
+
platform,
|
|
2997
|
+
rects,
|
|
2998
|
+
elements,
|
|
2999
|
+
strategy
|
|
3000
|
+
} = state;
|
|
3001
|
+
const {
|
|
3002
|
+
boundary = 'clippingAncestors',
|
|
3003
|
+
rootBoundary = 'viewport',
|
|
3004
|
+
elementContext = 'floating',
|
|
3005
|
+
altBoundary = false,
|
|
3006
|
+
padding = 0
|
|
3007
|
+
} = evaluate(options, state);
|
|
3008
|
+
const paddingObject = getPaddingObject(padding);
|
|
3009
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
3010
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
3011
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
3012
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
3013
|
+
boundary,
|
|
3014
|
+
rootBoundary,
|
|
3015
|
+
strategy
|
|
3016
|
+
}));
|
|
3017
|
+
const rect = elementContext === 'floating' ? {
|
|
3018
|
+
x,
|
|
3019
|
+
y,
|
|
3020
|
+
width: rects.floating.width,
|
|
3021
|
+
height: rects.floating.height
|
|
3022
|
+
} : rects.reference;
|
|
3023
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
3024
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
3025
|
+
x: 1,
|
|
3026
|
+
y: 1
|
|
3027
|
+
} : {
|
|
3028
|
+
x: 1,
|
|
3029
|
+
y: 1
|
|
3030
|
+
};
|
|
3031
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
3032
|
+
elements,
|
|
3033
|
+
rect,
|
|
3034
|
+
offsetParent,
|
|
3035
|
+
strategy
|
|
3036
|
+
}) : rect);
|
|
3037
|
+
return {
|
|
3038
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
3039
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
3040
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
3041
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3056
3045
|
/**
|
|
3057
3046
|
* Provides data to position an inner element of the floating element so that it
|
|
3058
3047
|
* appears centered to the reference element.
|
|
@@ -3185,7 +3174,7 @@ const flip$2 = function (options) {
|
|
|
3185
3174
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
3186
3175
|
}
|
|
3187
3176
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
3188
|
-
const overflow = await
|
|
3177
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
3189
3178
|
const overflows = [];
|
|
3190
3179
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
3191
3180
|
if (checkMainAxis) {
|
|
@@ -3292,8 +3281,7 @@ const hide$2 = function (options) {
|
|
|
3292
3281
|
options,
|
|
3293
3282
|
async fn(state) {
|
|
3294
3283
|
const {
|
|
3295
|
-
rects
|
|
3296
|
-
platform
|
|
3284
|
+
rects
|
|
3297
3285
|
} = state;
|
|
3298
3286
|
const {
|
|
3299
3287
|
strategy = 'referenceHidden',
|
|
@@ -3302,7 +3290,7 @@ const hide$2 = function (options) {
|
|
|
3302
3290
|
switch (strategy) {
|
|
3303
3291
|
case 'referenceHidden':
|
|
3304
3292
|
{
|
|
3305
|
-
const overflow = await
|
|
3293
|
+
const overflow = await detectOverflow(state, {
|
|
3306
3294
|
...detectOverflowOptions,
|
|
3307
3295
|
elementContext: 'reference'
|
|
3308
3296
|
});
|
|
@@ -3316,7 +3304,7 @@ const hide$2 = function (options) {
|
|
|
3316
3304
|
}
|
|
3317
3305
|
case 'escaped':
|
|
3318
3306
|
{
|
|
3319
|
-
const overflow = await
|
|
3307
|
+
const overflow = await detectOverflow(state, {
|
|
3320
3308
|
...detectOverflowOptions,
|
|
3321
3309
|
altBoundary: true
|
|
3322
3310
|
});
|
|
@@ -3439,8 +3427,7 @@ const shift$2 = function (options) {
|
|
|
3439
3427
|
const {
|
|
3440
3428
|
x,
|
|
3441
3429
|
y,
|
|
3442
|
-
placement
|
|
3443
|
-
platform
|
|
3430
|
+
placement
|
|
3444
3431
|
} = state;
|
|
3445
3432
|
const {
|
|
3446
3433
|
mainAxis: checkMainAxis = true,
|
|
@@ -3463,7 +3450,7 @@ const shift$2 = function (options) {
|
|
|
3463
3450
|
x,
|
|
3464
3451
|
y
|
|
3465
3452
|
};
|
|
3466
|
-
const overflow = await
|
|
3453
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
3467
3454
|
const crossAxis = getSideAxis(getSide(placement));
|
|
3468
3455
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
3469
3456
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -3595,7 +3582,7 @@ const size$2 = function (options) {
|
|
|
3595
3582
|
apply = () => {},
|
|
3596
3583
|
...detectOverflowOptions
|
|
3597
3584
|
} = evaluate(options, state);
|
|
3598
|
-
const overflow = await
|
|
3585
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
3599
3586
|
const side = getSide(placement);
|
|
3600
3587
|
const alignment = getAlignment(placement);
|
|
3601
3588
|
const isYAxis = getSideAxis(placement) === 'y';
|
|
@@ -3698,6 +3685,7 @@ function isShadowRoot(value) {
|
|
|
3698
3685
|
}
|
|
3699
3686
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
3700
3687
|
}
|
|
3688
|
+
const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
|
|
3701
3689
|
function isOverflowElement(element) {
|
|
3702
3690
|
const {
|
|
3703
3691
|
overflow,
|
|
@@ -3705,35 +3693,32 @@ function isOverflowElement(element) {
|
|
|
3705
3693
|
overflowY,
|
|
3706
3694
|
display
|
|
3707
3695
|
} = getComputedStyle$1(element);
|
|
3708
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display
|
|
3696
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
3709
3697
|
}
|
|
3698
|
+
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
3710
3699
|
function isTableElement(element) {
|
|
3711
|
-
return
|
|
3700
|
+
return tableElements.has(getNodeName(element));
|
|
3712
3701
|
}
|
|
3702
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
3713
3703
|
function isTopLayer(element) {
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
return
|
|
3704
|
+
return topLayerSelectors.some(selector => {
|
|
3705
|
+
try {
|
|
3706
|
+
return element.matches(selector);
|
|
3707
|
+
} catch (_e) {
|
|
3708
|
+
return false;
|
|
3717
3709
|
}
|
|
3718
|
-
}
|
|
3719
|
-
// no-op
|
|
3720
|
-
}
|
|
3721
|
-
try {
|
|
3722
|
-
return element.matches(':modal');
|
|
3723
|
-
} catch (_e) {
|
|
3724
|
-
return false;
|
|
3725
|
-
}
|
|
3710
|
+
});
|
|
3726
3711
|
}
|
|
3727
|
-
const
|
|
3728
|
-
const
|
|
3729
|
-
const
|
|
3730
|
-
let isWebKitValue;
|
|
3712
|
+
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
3713
|
+
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
3714
|
+
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
3731
3715
|
function isContainingBlock(elementOrCss) {
|
|
3716
|
+
const webkit = isWebKit();
|
|
3732
3717
|
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
3733
3718
|
|
|
3734
3719
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
3735
3720
|
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
3736
|
-
return
|
|
3721
|
+
return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
|
|
3737
3722
|
}
|
|
3738
3723
|
function getContainingBlock(element) {
|
|
3739
3724
|
let currentNode = getParentNode(element);
|
|
@@ -3748,13 +3733,12 @@ function getContainingBlock(element) {
|
|
|
3748
3733
|
return null;
|
|
3749
3734
|
}
|
|
3750
3735
|
function isWebKit() {
|
|
3751
|
-
if (
|
|
3752
|
-
|
|
3753
|
-
}
|
|
3754
|
-
return isWebKitValue;
|
|
3736
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
3737
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
3755
3738
|
}
|
|
3739
|
+
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
3756
3740
|
function isLastTraversableNode(node) {
|
|
3757
|
-
return
|
|
3741
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
3758
3742
|
}
|
|
3759
3743
|
function getComputedStyle$1(element) {
|
|
3760
3744
|
return getWindow(element).getComputedStyle(element);
|
|
@@ -3810,9 +3794,8 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
3810
3794
|
if (isBody) {
|
|
3811
3795
|
const frameElement = getFrameElement(win);
|
|
3812
3796
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
3813
|
-
} else {
|
|
3814
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
3815
3797
|
}
|
|
3798
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
3816
3799
|
}
|
|
3817
3800
|
function getFrameElement(win) {
|
|
3818
3801
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
@@ -3989,7 +3972,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
3989
3972
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
3990
3973
|
scroll = getNodeScroll(offsetParent);
|
|
3991
3974
|
}
|
|
3992
|
-
if (
|
|
3975
|
+
if (isHTMLElement(offsetParent)) {
|
|
3993
3976
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
3994
3977
|
scale = getScale(offsetParent);
|
|
3995
3978
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
@@ -4077,6 +4060,7 @@ function getViewportRect(element, strategy) {
|
|
|
4077
4060
|
};
|
|
4078
4061
|
}
|
|
4079
4062
|
|
|
4063
|
+
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
4080
4064
|
// Returns the inner client rect, subtracting scrollbars if present.
|
|
4081
4065
|
function getInnerBoundingClientRect(element, strategy) {
|
|
4082
4066
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
@@ -4141,7 +4125,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
4141
4125
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
4142
4126
|
currentContainingBlockComputedStyle = null;
|
|
4143
4127
|
}
|
|
4144
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position
|
|
4128
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
4145
4129
|
if (shouldDropCurrentNode) {
|
|
4146
4130
|
// Drop non-containing blocks.
|
|
4147
4131
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
@@ -4166,23 +4150,20 @@ function getClippingRect(_ref) {
|
|
|
4166
4150
|
} = _ref;
|
|
4167
4151
|
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
4168
4152
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
4169
|
-
const
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
bottom = min(rect.bottom, bottom);
|
|
4179
|
-
left = max(rect.left, left);
|
|
4180
|
-
}
|
|
4153
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
4154
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
4155
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
4156
|
+
accRect.top = max(rect.top, accRect.top);
|
|
4157
|
+
accRect.right = min(rect.right, accRect.right);
|
|
4158
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
4159
|
+
accRect.left = max(rect.left, accRect.left);
|
|
4160
|
+
return accRect;
|
|
4161
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
4181
4162
|
return {
|
|
4182
|
-
width: right - left,
|
|
4183
|
-
height: bottom - top,
|
|
4184
|
-
x: left,
|
|
4185
|
-
y: top
|
|
4163
|
+
width: clippingRect.right - clippingRect.left,
|
|
4164
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
4165
|
+
x: clippingRect.left,
|
|
4166
|
+
y: clippingRect.top
|
|
4186
4167
|
};
|
|
4187
4168
|
}
|
|
4188
4169
|
|
|
@@ -4433,7 +4414,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
4433
4414
|
animationFrame = false
|
|
4434
4415
|
} = options;
|
|
4435
4416
|
const referenceEl = unwrapElement(reference);
|
|
4436
|
-
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...
|
|
4417
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
4437
4418
|
ancestors.forEach(ancestor => {
|
|
4438
4419
|
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
4439
4420
|
passive: true
|
|
@@ -4446,7 +4427,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
4446
4427
|
if (elementResize) {
|
|
4447
4428
|
resizeObserver = new ResizeObserver(_ref => {
|
|
4448
4429
|
let [firstEntry] = _ref;
|
|
4449
|
-
if (firstEntry && firstEntry.target === referenceEl && resizeObserver
|
|
4430
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
4450
4431
|
// Prevent update loops when using the `size` middleware.
|
|
4451
4432
|
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
4452
4433
|
resizeObserver.unobserve(floating);
|
|
@@ -4461,9 +4442,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
4461
4442
|
if (referenceEl && !animationFrame) {
|
|
4462
4443
|
resizeObserver.observe(referenceEl);
|
|
4463
4444
|
}
|
|
4464
|
-
|
|
4465
|
-
resizeObserver.observe(floating);
|
|
4466
|
-
}
|
|
4445
|
+
resizeObserver.observe(floating);
|
|
4467
4446
|
}
|
|
4468
4447
|
let frameId;
|
|
4469
4448
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
@@ -4845,39 +4824,28 @@ const arrow$1 = options => {
|
|
|
4845
4824
|
* object may be passed.
|
|
4846
4825
|
* @see https://floating-ui.com/docs/offset
|
|
4847
4826
|
*/
|
|
4848
|
-
const offset = (options, deps) => {
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
fn: result.fn,
|
|
4853
|
-
options: [options, deps]
|
|
4854
|
-
};
|
|
4855
|
-
};
|
|
4827
|
+
const offset = (options, deps) => ({
|
|
4828
|
+
...offset$1(options),
|
|
4829
|
+
options: [options, deps]
|
|
4830
|
+
});
|
|
4856
4831
|
|
|
4857
4832
|
/**
|
|
4858
4833
|
* Optimizes the visibility of the floating element by shifting it in order to
|
|
4859
4834
|
* keep it in view when it will overflow the clipping boundary.
|
|
4860
4835
|
* @see https://floating-ui.com/docs/shift
|
|
4861
4836
|
*/
|
|
4862
|
-
const shift = (options, deps) => {
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
fn: result.fn,
|
|
4867
|
-
options: [options, deps]
|
|
4868
|
-
};
|
|
4869
|
-
};
|
|
4837
|
+
const shift = (options, deps) => ({
|
|
4838
|
+
...shift$1(options),
|
|
4839
|
+
options: [options, deps]
|
|
4840
|
+
});
|
|
4870
4841
|
|
|
4871
4842
|
/**
|
|
4872
4843
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
4873
4844
|
*/
|
|
4874
|
-
const limitShift = (options, deps) => {
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
options: [options, deps]
|
|
4879
|
-
};
|
|
4880
|
-
};
|
|
4845
|
+
const limitShift = (options, deps) => ({
|
|
4846
|
+
...limitShift$1(options),
|
|
4847
|
+
options: [options, deps]
|
|
4848
|
+
});
|
|
4881
4849
|
|
|
4882
4850
|
/**
|
|
4883
4851
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
@@ -4885,14 +4853,10 @@ const limitShift = (options, deps) => {
|
|
|
4885
4853
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
4886
4854
|
* @see https://floating-ui.com/docs/flip
|
|
4887
4855
|
*/
|
|
4888
|
-
const flip = (options, deps) => {
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
fn: result.fn,
|
|
4893
|
-
options: [options, deps]
|
|
4894
|
-
};
|
|
4895
|
-
};
|
|
4856
|
+
const flip = (options, deps) => ({
|
|
4857
|
+
...flip$1(options),
|
|
4858
|
+
options: [options, deps]
|
|
4859
|
+
});
|
|
4896
4860
|
|
|
4897
4861
|
/**
|
|
4898
4862
|
* Provides data that allows you to change the size of the floating element —
|
|
@@ -4900,28 +4864,20 @@ const flip = (options, deps) => {
|
|
|
4900
4864
|
* width of the reference element.
|
|
4901
4865
|
* @see https://floating-ui.com/docs/size
|
|
4902
4866
|
*/
|
|
4903
|
-
const size = (options, deps) => {
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
fn: result.fn,
|
|
4908
|
-
options: [options, deps]
|
|
4909
|
-
};
|
|
4910
|
-
};
|
|
4867
|
+
const size = (options, deps) => ({
|
|
4868
|
+
...size$1(options),
|
|
4869
|
+
options: [options, deps]
|
|
4870
|
+
});
|
|
4911
4871
|
|
|
4912
4872
|
/**
|
|
4913
4873
|
* Provides data to hide the floating element in applicable situations, such as
|
|
4914
4874
|
* when it is not in the same clipping context as the reference element.
|
|
4915
4875
|
* @see https://floating-ui.com/docs/hide
|
|
4916
4876
|
*/
|
|
4917
|
-
const hide = (options, deps) => {
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
fn: result.fn,
|
|
4922
|
-
options: [options, deps]
|
|
4923
|
-
};
|
|
4924
|
-
};
|
|
4877
|
+
const hide = (options, deps) => ({
|
|
4878
|
+
...hide$1(options),
|
|
4879
|
+
options: [options, deps]
|
|
4880
|
+
});
|
|
4925
4881
|
|
|
4926
4882
|
/**
|
|
4927
4883
|
* Provides data to position an inner element of the floating element so that it
|
|
@@ -4929,14 +4885,10 @@ const hide = (options, deps) => {
|
|
|
4929
4885
|
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
4930
4886
|
* @see https://floating-ui.com/docs/arrow
|
|
4931
4887
|
*/
|
|
4932
|
-
const arrow = (options, deps) => {
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
fn: result.fn,
|
|
4937
|
-
options: [options, deps]
|
|
4938
|
-
};
|
|
4939
|
-
};
|
|
4888
|
+
const arrow = (options, deps) => ({
|
|
4889
|
+
...arrow$1(options),
|
|
4890
|
+
options: [options, deps]
|
|
4891
|
+
});
|
|
4940
4892
|
|
|
4941
4893
|
// src/arrow.tsx
|
|
4942
4894
|
var NAME = "Arrow";
|
|
@@ -6251,7 +6203,7 @@ var SubTrigger = MenuSubTrigger;
|
|
|
6251
6203
|
var SubContent = MenuSubContent;
|
|
6252
6204
|
|
|
6253
6205
|
var CONTEXT_MENU_NAME = "ContextMenu";
|
|
6254
|
-
var [createContextMenuContext] = createContextScope(CONTEXT_MENU_NAME, [
|
|
6206
|
+
var [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [
|
|
6255
6207
|
createMenuScope
|
|
6256
6208
|
]);
|
|
6257
6209
|
var useMenuScope = createMenuScope();
|
|
@@ -6534,7 +6486,7 @@ function clamp(value, [min, max]) {
|
|
|
6534
6486
|
}
|
|
6535
6487
|
|
|
6536
6488
|
var POPOVER_NAME = "Popover";
|
|
6537
|
-
var [createPopoverContext] = createContextScope(POPOVER_NAME, [
|
|
6489
|
+
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
6538
6490
|
createPopperScope
|
|
6539
6491
|
]);
|
|
6540
6492
|
var usePopperScope$2 = createPopperScope();
|
|
@@ -6937,7 +6889,7 @@ function getState$1(checked) {
|
|
|
6937
6889
|
}
|
|
6938
6890
|
var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
6939
6891
|
var RADIO_GROUP_NAME = "RadioGroup";
|
|
6940
|
-
var [createRadioGroupContext] = createContextScope(RADIO_GROUP_NAME, [
|
|
6892
|
+
var [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [
|
|
6941
6893
|
createRovingFocusGroupScope,
|
|
6942
6894
|
createRadioScope
|
|
6943
6895
|
]);
|
|
@@ -7076,7 +7028,7 @@ var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
|
7076
7028
|
var SELECTION_KEYS = [" ", "Enter"];
|
|
7077
7029
|
var SELECT_NAME = "Select";
|
|
7078
7030
|
var [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);
|
|
7079
|
-
var [createSelectContext] = createContextScope(SELECT_NAME, [
|
|
7031
|
+
var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
|
|
7080
7032
|
createCollectionScope,
|
|
7081
7033
|
createPopperScope
|
|
7082
7034
|
]);
|
|
@@ -8201,7 +8153,7 @@ var ItemIndicator = SelectItemIndicator;
|
|
|
8201
8153
|
var Separator = SelectSeparator$1;
|
|
8202
8154
|
|
|
8203
8155
|
var SWITCH_NAME = "Switch";
|
|
8204
|
-
var [createSwitchContext] = createContextScope(SWITCH_NAME);
|
|
8156
|
+
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
8205
8157
|
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
8206
8158
|
var Switch$1 = React__namespace.forwardRef(
|
|
8207
8159
|
(props, forwardedRef) => {
|
|
@@ -8341,7 +8293,7 @@ function getState(checked) {
|
|
|
8341
8293
|
var Root = Switch$1;
|
|
8342
8294
|
var Thumb = SwitchThumb;
|
|
8343
8295
|
|
|
8344
|
-
var [createTooltipContext] = createContextScope("Tooltip", [
|
|
8296
|
+
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
8345
8297
|
createPopperScope
|
|
8346
8298
|
]);
|
|
8347
8299
|
var usePopperScope = createPopperScope();
|
|
@@ -8818,36 +8770,7 @@ var Arrow2 = TooltipArrow$1;
|
|
|
8818
8770
|
|
|
8819
8771
|
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}
|
|
8820
8772
|
|
|
8821
|
-
/**
|
|
8822
|
-
* Concatenates two arrays faster than the array spread operator.
|
|
8823
|
-
*/
|
|
8824
|
-
const concatArrays = (array1, array2) => {
|
|
8825
|
-
// Pre-allocate for better V8 optimization
|
|
8826
|
-
const combinedArray = new Array(array1.length + array2.length);
|
|
8827
|
-
for (let i = 0; i < array1.length; i++) {
|
|
8828
|
-
combinedArray[i] = array1[i];
|
|
8829
|
-
}
|
|
8830
|
-
for (let i = 0; i < array2.length; i++) {
|
|
8831
|
-
combinedArray[array1.length + i] = array2[i];
|
|
8832
|
-
}
|
|
8833
|
-
return combinedArray;
|
|
8834
|
-
};
|
|
8835
|
-
|
|
8836
|
-
// Factory function ensures consistent object shapes
|
|
8837
|
-
const createClassValidatorObject = (classGroupId, validator) => ({
|
|
8838
|
-
classGroupId,
|
|
8839
|
-
validator
|
|
8840
|
-
});
|
|
8841
|
-
// Factory ensures consistent ClassPartObject shape
|
|
8842
|
-
const createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({
|
|
8843
|
-
nextPart,
|
|
8844
|
-
validators,
|
|
8845
|
-
classGroupId
|
|
8846
|
-
});
|
|
8847
8773
|
const CLASS_PART_SEPARATOR = '-';
|
|
8848
|
-
const EMPTY_CONFLICTS = [];
|
|
8849
|
-
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
8850
|
-
const ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';
|
|
8851
8774
|
const createClassGroupUtils = config => {
|
|
8852
8775
|
const classMap = createClassMap(config);
|
|
8853
8776
|
const {
|
|
@@ -8855,73 +8778,54 @@ const createClassGroupUtils = config => {
|
|
|
8855
8778
|
conflictingClassGroupModifiers
|
|
8856
8779
|
} = config;
|
|
8857
8780
|
const getClassGroupId = className => {
|
|
8858
|
-
if (className.startsWith('[') && className.endsWith(']')) {
|
|
8859
|
-
return getGroupIdForArbitraryProperty(className);
|
|
8860
|
-
}
|
|
8861
8781
|
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
8862
|
-
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and
|
|
8863
|
-
|
|
8864
|
-
|
|
8782
|
+
// 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.
|
|
8783
|
+
if (classParts[0] === '' && classParts.length !== 1) {
|
|
8784
|
+
classParts.shift();
|
|
8785
|
+
}
|
|
8786
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
8865
8787
|
};
|
|
8866
8788
|
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
if (modifierConflicts) {
|
|
8871
|
-
if (baseConflicts) {
|
|
8872
|
-
// Merge base conflicts with modifier conflicts
|
|
8873
|
-
return concatArrays(baseConflicts, modifierConflicts);
|
|
8874
|
-
}
|
|
8875
|
-
// Only modifier conflicts
|
|
8876
|
-
return modifierConflicts;
|
|
8877
|
-
}
|
|
8878
|
-
// Fall back to without postfix if no modifier conflicts
|
|
8879
|
-
return baseConflicts || EMPTY_CONFLICTS;
|
|
8789
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
8790
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
8791
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
8880
8792
|
}
|
|
8881
|
-
return
|
|
8793
|
+
return conflicts;
|
|
8882
8794
|
};
|
|
8883
8795
|
return {
|
|
8884
8796
|
getClassGroupId,
|
|
8885
8797
|
getConflictingClassGroupIds
|
|
8886
8798
|
};
|
|
8887
8799
|
};
|
|
8888
|
-
const getGroupRecursive = (classParts,
|
|
8889
|
-
|
|
8890
|
-
if (classPathsLength === 0) {
|
|
8800
|
+
const getGroupRecursive = (classParts, classPartObject) => {
|
|
8801
|
+
if (classParts.length === 0) {
|
|
8891
8802
|
return classPartObject.classGroupId;
|
|
8892
8803
|
}
|
|
8893
|
-
const currentClassPart = classParts[
|
|
8804
|
+
const currentClassPart = classParts[0];
|
|
8894
8805
|
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8806
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
|
|
8807
|
+
if (classGroupFromNextClassPart) {
|
|
8808
|
+
return classGroupFromNextClassPart;
|
|
8898
8809
|
}
|
|
8899
|
-
|
|
8900
|
-
if (validators === null) {
|
|
8810
|
+
if (classPartObject.validators.length === 0) {
|
|
8901
8811
|
return undefined;
|
|
8902
8812
|
}
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8813
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
8814
|
+
return classPartObject.validators.find(({
|
|
8815
|
+
validator
|
|
8816
|
+
}) => validator(classRest))?.classGroupId;
|
|
8817
|
+
};
|
|
8818
|
+
const arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
8819
|
+
const getGroupIdForArbitraryProperty = className => {
|
|
8820
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
8821
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
8822
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));
|
|
8823
|
+
if (property) {
|
|
8824
|
+
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
8825
|
+
return 'arbitrary..' + property;
|
|
8910
8826
|
}
|
|
8911
8827
|
}
|
|
8912
|
-
return undefined;
|
|
8913
8828
|
};
|
|
8914
|
-
/**
|
|
8915
|
-
* Get the class group ID for an arbitrary property.
|
|
8916
|
-
*
|
|
8917
|
-
* @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
|
|
8918
|
-
*/
|
|
8919
|
-
const getGroupIdForArbitraryProperty = className => className.slice(1, -1).indexOf(':') === -1 ? undefined : (() => {
|
|
8920
|
-
const content = className.slice(1, -1);
|
|
8921
|
-
const colonIndex = content.indexOf(':');
|
|
8922
|
-
const property = content.slice(0, colonIndex);
|
|
8923
|
-
return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;
|
|
8924
|
-
})();
|
|
8925
8829
|
/**
|
|
8926
8830
|
* Exported for testing only
|
|
8927
8831
|
*/
|
|
@@ -8930,77 +8834,54 @@ const createClassMap = config => {
|
|
|
8930
8834
|
theme,
|
|
8931
8835
|
classGroups
|
|
8932
8836
|
} = config;
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
const classMap = createClassPartObject();
|
|
8837
|
+
const classMap = {
|
|
8838
|
+
nextPart: new Map(),
|
|
8839
|
+
validators: []
|
|
8840
|
+
};
|
|
8938
8841
|
for (const classGroupId in classGroups) {
|
|
8939
|
-
|
|
8940
|
-
processClassesRecursively(group, classMap, classGroupId, theme);
|
|
8842
|
+
processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme);
|
|
8941
8843
|
}
|
|
8942
8844
|
return classMap;
|
|
8943
8845
|
};
|
|
8944
8846
|
const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
}
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
};
|
|
8967
|
-
const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
8968
|
-
if (isThemeGetter(classDefinition)) {
|
|
8969
|
-
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
8970
|
-
return;
|
|
8971
|
-
}
|
|
8972
|
-
if (classPartObject.validators === null) {
|
|
8973
|
-
classPartObject.validators = [];
|
|
8974
|
-
}
|
|
8975
|
-
classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
|
|
8976
|
-
};
|
|
8977
|
-
const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
8978
|
-
const entries = Object.entries(classDefinition);
|
|
8979
|
-
const len = entries.length;
|
|
8980
|
-
for (let i = 0; i < len; i++) {
|
|
8981
|
-
const [key, value] = entries[i];
|
|
8982
|
-
processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
|
|
8983
|
-
}
|
|
8847
|
+
classGroup.forEach(classDefinition => {
|
|
8848
|
+
if (typeof classDefinition === 'string') {
|
|
8849
|
+
const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
|
|
8850
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
8851
|
+
return;
|
|
8852
|
+
}
|
|
8853
|
+
if (typeof classDefinition === 'function') {
|
|
8854
|
+
if (isThemeGetter(classDefinition)) {
|
|
8855
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
8856
|
+
return;
|
|
8857
|
+
}
|
|
8858
|
+
classPartObject.validators.push({
|
|
8859
|
+
validator: classDefinition,
|
|
8860
|
+
classGroupId
|
|
8861
|
+
});
|
|
8862
|
+
return;
|
|
8863
|
+
}
|
|
8864
|
+
Object.entries(classDefinition).forEach(([key, classGroup]) => {
|
|
8865
|
+
processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
|
|
8866
|
+
});
|
|
8867
|
+
});
|
|
8984
8868
|
};
|
|
8985
8869
|
const getPart = (classPartObject, path) => {
|
|
8986
|
-
let
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
next = createClassPartObject();
|
|
8994
|
-
current.nextPart.set(part, next);
|
|
8870
|
+
let currentClassPartObject = classPartObject;
|
|
8871
|
+
path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {
|
|
8872
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
8873
|
+
currentClassPartObject.nextPart.set(pathPart, {
|
|
8874
|
+
nextPart: new Map(),
|
|
8875
|
+
validators: []
|
|
8876
|
+
});
|
|
8995
8877
|
}
|
|
8996
|
-
|
|
8997
|
-
}
|
|
8998
|
-
return
|
|
8878
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
8879
|
+
});
|
|
8880
|
+
return currentClassPartObject;
|
|
8999
8881
|
};
|
|
9000
|
-
|
|
9001
|
-
const isThemeGetter = func => 'isThemeGetter' in func && func.isThemeGetter === true;
|
|
8882
|
+
const isThemeGetter = func => func.isThemeGetter;
|
|
9002
8883
|
|
|
9003
|
-
// LRU cache
|
|
8884
|
+
// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance
|
|
9004
8885
|
const createLruCache = maxCacheSize => {
|
|
9005
8886
|
if (maxCacheSize < 1) {
|
|
9006
8887
|
return {
|
|
@@ -9009,31 +8890,31 @@ const createLruCache = maxCacheSize => {
|
|
|
9009
8890
|
};
|
|
9010
8891
|
}
|
|
9011
8892
|
let cacheSize = 0;
|
|
9012
|
-
let cache =
|
|
9013
|
-
let previousCache =
|
|
8893
|
+
let cache = new Map();
|
|
8894
|
+
let previousCache = new Map();
|
|
9014
8895
|
const update = (key, value) => {
|
|
9015
|
-
cache
|
|
8896
|
+
cache.set(key, value);
|
|
9016
8897
|
cacheSize++;
|
|
9017
8898
|
if (cacheSize > maxCacheSize) {
|
|
9018
8899
|
cacheSize = 0;
|
|
9019
8900
|
previousCache = cache;
|
|
9020
|
-
cache =
|
|
8901
|
+
cache = new Map();
|
|
9021
8902
|
}
|
|
9022
8903
|
};
|
|
9023
8904
|
return {
|
|
9024
8905
|
get(key) {
|
|
9025
|
-
let value = cache
|
|
8906
|
+
let value = cache.get(key);
|
|
9026
8907
|
if (value !== undefined) {
|
|
9027
8908
|
return value;
|
|
9028
8909
|
}
|
|
9029
|
-
if ((value = previousCache
|
|
8910
|
+
if ((value = previousCache.get(key)) !== undefined) {
|
|
9030
8911
|
update(key, value);
|
|
9031
8912
|
return value;
|
|
9032
8913
|
}
|
|
9033
8914
|
},
|
|
9034
8915
|
set(key, value) {
|
|
9035
|
-
if (key
|
|
9036
|
-
cache
|
|
8916
|
+
if (cache.has(key)) {
|
|
8917
|
+
cache.set(key, value);
|
|
9037
8918
|
} else {
|
|
9038
8919
|
update(key, value);
|
|
9039
8920
|
}
|
|
@@ -9042,15 +8923,7 @@ const createLruCache = maxCacheSize => {
|
|
|
9042
8923
|
};
|
|
9043
8924
|
const IMPORTANT_MODIFIER = '!';
|
|
9044
8925
|
const MODIFIER_SEPARATOR = ':';
|
|
9045
|
-
const
|
|
9046
|
-
// Pre-allocated result object shape for consistency
|
|
9047
|
-
const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
|
|
9048
|
-
modifiers,
|
|
9049
|
-
hasImportantModifier,
|
|
9050
|
-
baseClassName,
|
|
9051
|
-
maybePostfixModifierPosition,
|
|
9052
|
-
isExternal
|
|
9053
|
-
});
|
|
8926
|
+
const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;
|
|
9054
8927
|
const createParseClassName = config => {
|
|
9055
8928
|
const {
|
|
9056
8929
|
prefix,
|
|
@@ -9063,19 +8936,17 @@ const createParseClassName = config => {
|
|
|
9063
8936
|
* @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
|
|
9064
8937
|
*/
|
|
9065
8938
|
let parseClassName = className => {
|
|
9066
|
-
// Use simple array with push for better performance
|
|
9067
8939
|
const modifiers = [];
|
|
9068
8940
|
let bracketDepth = 0;
|
|
9069
8941
|
let parenDepth = 0;
|
|
9070
8942
|
let modifierStart = 0;
|
|
9071
8943
|
let postfixModifierPosition;
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
const currentCharacter = className[index];
|
|
8944
|
+
for (let index = 0; index < className.length; index++) {
|
|
8945
|
+
let currentCharacter = className[index];
|
|
9075
8946
|
if (bracketDepth === 0 && parenDepth === 0) {
|
|
9076
8947
|
if (currentCharacter === MODIFIER_SEPARATOR) {
|
|
9077
8948
|
modifiers.push(className.slice(modifierStart, index));
|
|
9078
|
-
modifierStart = index +
|
|
8949
|
+
modifierStart = index + MODIFIER_SEPARATOR_LENGTH;
|
|
9079
8950
|
continue;
|
|
9080
8951
|
}
|
|
9081
8952
|
if (currentCharacter === '/') {
|
|
@@ -9083,31 +8954,37 @@ const createParseClassName = config => {
|
|
|
9083
8954
|
continue;
|
|
9084
8955
|
}
|
|
9085
8956
|
}
|
|
9086
|
-
if (currentCharacter === '[')
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
} else if (
|
|
9096
|
-
/**
|
|
9097
|
-
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
9098
|
-
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
9099
|
-
*/
|
|
9100
|
-
baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
|
|
9101
|
-
baseClassName = baseClassNameWithImportantModifier.slice(1);
|
|
9102
|
-
hasImportantModifier = true;
|
|
8957
|
+
if (currentCharacter === '[') {
|
|
8958
|
+
bracketDepth++;
|
|
8959
|
+
} else if (currentCharacter === ']') {
|
|
8960
|
+
bracketDepth--;
|
|
8961
|
+
} else if (currentCharacter === '(') {
|
|
8962
|
+
parenDepth++;
|
|
8963
|
+
} else if (currentCharacter === ')') {
|
|
8964
|
+
parenDepth--;
|
|
8965
|
+
}
|
|
9103
8966
|
}
|
|
8967
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
8968
|
+
const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
|
|
8969
|
+
const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;
|
|
9104
8970
|
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
|
|
9105
|
-
return
|
|
8971
|
+
return {
|
|
8972
|
+
modifiers,
|
|
8973
|
+
hasImportantModifier,
|
|
8974
|
+
baseClassName,
|
|
8975
|
+
maybePostfixModifierPosition
|
|
8976
|
+
};
|
|
9106
8977
|
};
|
|
9107
8978
|
if (prefix) {
|
|
9108
8979
|
const fullPrefix = prefix + MODIFIER_SEPARATOR;
|
|
9109
8980
|
const parseClassNameOriginal = parseClassName;
|
|
9110
|
-
parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.
|
|
8981
|
+
parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
|
|
8982
|
+
isExternal: true,
|
|
8983
|
+
modifiers: [],
|
|
8984
|
+
hasImportantModifier: false,
|
|
8985
|
+
baseClassName: className,
|
|
8986
|
+
maybePostfixModifierPosition: undefined
|
|
8987
|
+
};
|
|
9111
8988
|
}
|
|
9112
8989
|
if (experimentalParseClassName) {
|
|
9113
8990
|
const parseClassNameOriginal = parseClassName;
|
|
@@ -9118,6 +8995,19 @@ const createParseClassName = config => {
|
|
|
9118
8995
|
}
|
|
9119
8996
|
return parseClassName;
|
|
9120
8997
|
};
|
|
8998
|
+
const stripImportantModifier = baseClassName => {
|
|
8999
|
+
if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {
|
|
9000
|
+
return baseClassName.substring(0, baseClassName.length - 1);
|
|
9001
|
+
}
|
|
9002
|
+
/**
|
|
9003
|
+
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
9004
|
+
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
9005
|
+
*/
|
|
9006
|
+
if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {
|
|
9007
|
+
return baseClassName.substring(1);
|
|
9008
|
+
}
|
|
9009
|
+
return baseClassName;
|
|
9010
|
+
};
|
|
9121
9011
|
|
|
9122
9012
|
/**
|
|
9123
9013
|
* Sorts modifiers according to following schema:
|
|
@@ -9125,41 +9015,26 @@ const createParseClassName = config => {
|
|
|
9125
9015
|
* - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
|
|
9126
9016
|
*/
|
|
9127
9017
|
const createSortModifiers = config => {
|
|
9128
|
-
|
|
9129
|
-
const
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
// Check if modifier is sensitive (starts with '[' or in orderSensitiveModifiers)
|
|
9141
|
-
const isArbitrary = modifier[0] === '[';
|
|
9142
|
-
const isOrderSensitive = modifierWeights.has(modifier);
|
|
9143
|
-
if (isArbitrary || isOrderSensitive) {
|
|
9144
|
-
// Sort and flush current segment alphabetically
|
|
9145
|
-
if (currentSegment.length > 0) {
|
|
9146
|
-
currentSegment.sort();
|
|
9147
|
-
result.push(...currentSegment);
|
|
9148
|
-
currentSegment = [];
|
|
9149
|
-
}
|
|
9150
|
-
result.push(modifier);
|
|
9018
|
+
const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true]));
|
|
9019
|
+
const sortModifiers = modifiers => {
|
|
9020
|
+
if (modifiers.length <= 1) {
|
|
9021
|
+
return modifiers;
|
|
9022
|
+
}
|
|
9023
|
+
const sortedModifiers = [];
|
|
9024
|
+
let unsortedModifiers = [];
|
|
9025
|
+
modifiers.forEach(modifier => {
|
|
9026
|
+
const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier];
|
|
9027
|
+
if (isPositionSensitive) {
|
|
9028
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
9029
|
+
unsortedModifiers = [];
|
|
9151
9030
|
} else {
|
|
9152
|
-
|
|
9153
|
-
currentSegment.push(modifier);
|
|
9031
|
+
unsortedModifiers.push(modifier);
|
|
9154
9032
|
}
|
|
9155
|
-
}
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
currentSegment.sort();
|
|
9159
|
-
result.push(...currentSegment);
|
|
9160
|
-
}
|
|
9161
|
-
return result;
|
|
9033
|
+
});
|
|
9034
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
9035
|
+
return sortedModifiers;
|
|
9162
9036
|
};
|
|
9037
|
+
return sortModifiers;
|
|
9163
9038
|
};
|
|
9164
9039
|
const createConfigUtils = config => ({
|
|
9165
9040
|
cache: createLruCache(config.cacheSize),
|
|
@@ -9214,11 +9089,10 @@ const mergeClassList = (classList, configUtils) => {
|
|
|
9214
9089
|
}
|
|
9215
9090
|
hasPostfixModifier = false;
|
|
9216
9091
|
}
|
|
9217
|
-
|
|
9218
|
-
const variantModifier = modifiers.length === 0 ? '' : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(':');
|
|
9092
|
+
const variantModifier = sortModifiers(modifiers).join(':');
|
|
9219
9093
|
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
9220
9094
|
const classId = modifierId + classGroupId;
|
|
9221
|
-
if (classGroupsInConflict.
|
|
9095
|
+
if (classGroupsInConflict.includes(classId)) {
|
|
9222
9096
|
// Tailwind class omitted due to conflict
|
|
9223
9097
|
continue;
|
|
9224
9098
|
}
|
|
@@ -9243,13 +9117,13 @@ const mergeClassList = (classList, configUtils) => {
|
|
|
9243
9117
|
*
|
|
9244
9118
|
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
9245
9119
|
*/
|
|
9246
|
-
|
|
9120
|
+
function twJoin() {
|
|
9247
9121
|
let index = 0;
|
|
9248
9122
|
let argument;
|
|
9249
9123
|
let resolvedValue;
|
|
9250
9124
|
let string = '';
|
|
9251
|
-
while (index <
|
|
9252
|
-
if (argument =
|
|
9125
|
+
while (index < arguments.length) {
|
|
9126
|
+
if (argument = arguments[index++]) {
|
|
9253
9127
|
if (resolvedValue = toValue(argument)) {
|
|
9254
9128
|
string && (string += ' ');
|
|
9255
9129
|
string += resolvedValue;
|
|
@@ -9257,9 +9131,8 @@ const twJoin = (...classLists) => {
|
|
|
9257
9131
|
}
|
|
9258
9132
|
}
|
|
9259
9133
|
return string;
|
|
9260
|
-
}
|
|
9134
|
+
}
|
|
9261
9135
|
const toValue = mix => {
|
|
9262
|
-
// Fast path for strings
|
|
9263
9136
|
if (typeof mix === 'string') {
|
|
9264
9137
|
return mix;
|
|
9265
9138
|
}
|
|
@@ -9275,20 +9148,20 @@ const toValue = mix => {
|
|
|
9275
9148
|
}
|
|
9276
9149
|
return string;
|
|
9277
9150
|
};
|
|
9278
|
-
|
|
9151
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
9279
9152
|
let configUtils;
|
|
9280
9153
|
let cacheGet;
|
|
9281
9154
|
let cacheSet;
|
|
9282
|
-
let functionToCall;
|
|
9283
|
-
|
|
9155
|
+
let functionToCall = initTailwindMerge;
|
|
9156
|
+
function initTailwindMerge(classList) {
|
|
9284
9157
|
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
9285
9158
|
configUtils = createConfigUtils(config);
|
|
9286
9159
|
cacheGet = configUtils.cache.get;
|
|
9287
9160
|
cacheSet = configUtils.cache.set;
|
|
9288
9161
|
functionToCall = tailwindMerge;
|
|
9289
9162
|
return tailwindMerge(classList);
|
|
9290
|
-
}
|
|
9291
|
-
|
|
9163
|
+
}
|
|
9164
|
+
function tailwindMerge(classList) {
|
|
9292
9165
|
const cachedResult = cacheGet(classList);
|
|
9293
9166
|
if (cachedResult) {
|
|
9294
9167
|
return cachedResult;
|
|
@@ -9296,19 +9169,19 @@ const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
|
|
|
9296
9169
|
const result = mergeClassList(classList, configUtils);
|
|
9297
9170
|
cacheSet(classList, result);
|
|
9298
9171
|
return result;
|
|
9172
|
+
}
|
|
9173
|
+
return function callTailwindMerge() {
|
|
9174
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
9299
9175
|
};
|
|
9300
|
-
|
|
9301
|
-
return (...args) => functionToCall(twJoin(...args));
|
|
9302
|
-
};
|
|
9303
|
-
const fallbackThemeArr = [];
|
|
9176
|
+
}
|
|
9304
9177
|
const fromTheme = key => {
|
|
9305
|
-
const themeGetter = theme => theme[key] ||
|
|
9178
|
+
const themeGetter = theme => theme[key] || [];
|
|
9306
9179
|
themeGetter.isThemeGetter = true;
|
|
9307
9180
|
return themeGetter;
|
|
9308
9181
|
};
|
|
9309
9182
|
const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
|
|
9310
9183
|
const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
9311
|
-
const fractionRegex = /^\d
|
|
9184
|
+
const fractionRegex = /^\d+\/\d+$/;
|
|
9312
9185
|
const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
9313
9186
|
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$/;
|
|
9314
9187
|
const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
@@ -9334,8 +9207,6 @@ const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever
|
|
|
9334
9207
|
const isArbitraryValue = value => arbitraryValueRegex.test(value);
|
|
9335
9208
|
const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
9336
9209
|
const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
9337
|
-
const isArbitraryWeight = value => getIsArbitraryValue(value, isLabelWeight, isAny);
|
|
9338
|
-
const isArbitraryFamilyName = value => getIsArbitraryValue(value, isLabelFamilyName, isNever);
|
|
9339
9210
|
const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
9340
9211
|
const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
9341
9212
|
const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
@@ -9346,7 +9217,6 @@ const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLab
|
|
|
9346
9217
|
const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);
|
|
9347
9218
|
const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);
|
|
9348
9219
|
const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);
|
|
9349
|
-
const isArbitraryVariableWeight = value => getIsArbitraryVariable(value, isLabelWeight, true);
|
|
9350
9220
|
// Helpers
|
|
9351
9221
|
const getIsArbitraryValue = (value, testLabel, testValue) => {
|
|
9352
9222
|
const result = arbitraryValueRegex.exec(value);
|
|
@@ -9375,7 +9245,6 @@ const isLabelSize = label => label === 'length' || label === 'size' || label ===
|
|
|
9375
9245
|
const isLabelLength = label => label === 'length';
|
|
9376
9246
|
const isLabelNumber = label => label === 'number';
|
|
9377
9247
|
const isLabelFamilyName = label => label === 'family-name';
|
|
9378
|
-
const isLabelWeight = label => label === 'number' || label === 'weight';
|
|
9379
9248
|
const isLabelShadow = label => label === 'shadow';
|
|
9380
9249
|
const getDefaultConfig = () => {
|
|
9381
9250
|
/**
|
|
@@ -9434,8 +9303,6 @@ const getDefaultConfig = () => {
|
|
|
9434
9303
|
const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];
|
|
9435
9304
|
const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];
|
|
9436
9305
|
const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
|
|
9437
|
-
const scaleSizingInline = () => [isFraction, 'screen', 'full', 'dvw', 'lvw', 'svw', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
|
|
9438
|
-
const scaleSizingBlock = () => [isFraction, 'screen', 'full', 'lh', 'dvh', 'lvh', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
|
|
9439
9306
|
const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
|
|
9440
9307
|
const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
|
|
9441
9308
|
position: [isArbitraryVariable, isArbitraryValue]
|
|
@@ -9634,66 +9501,40 @@ const getDefaultConfig = () => {
|
|
|
9634
9501
|
*/
|
|
9635
9502
|
position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],
|
|
9636
9503
|
/**
|
|
9637
|
-
*
|
|
9504
|
+
* Top / Right / Bottom / Left
|
|
9638
9505
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
9639
9506
|
*/
|
|
9640
9507
|
inset: [{
|
|
9641
9508
|
inset: scaleInset()
|
|
9642
9509
|
}],
|
|
9643
9510
|
/**
|
|
9644
|
-
*
|
|
9511
|
+
* Right / Left
|
|
9645
9512
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
9646
9513
|
*/
|
|
9647
9514
|
'inset-x': [{
|
|
9648
9515
|
'inset-x': scaleInset()
|
|
9649
9516
|
}],
|
|
9650
9517
|
/**
|
|
9651
|
-
*
|
|
9518
|
+
* Top / Bottom
|
|
9652
9519
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
9653
9520
|
*/
|
|
9654
9521
|
'inset-y': [{
|
|
9655
9522
|
'inset-y': scaleInset()
|
|
9656
9523
|
}],
|
|
9657
9524
|
/**
|
|
9658
|
-
*
|
|
9525
|
+
* Start
|
|
9659
9526
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
9660
|
-
* @todo class group will be renamed to `inset-s` in next major release
|
|
9661
9527
|
*/
|
|
9662
9528
|
start: [{
|
|
9663
|
-
'inset-s': scaleInset(),
|
|
9664
|
-
/**
|
|
9665
|
-
* @deprecated since Tailwind CSS v4.2.0 in favor of `inset-s-*` utilities.
|
|
9666
|
-
* @see https://github.com/tailwindlabs/tailwindcss/pull/19613
|
|
9667
|
-
*/
|
|
9668
9529
|
start: scaleInset()
|
|
9669
9530
|
}],
|
|
9670
9531
|
/**
|
|
9671
|
-
*
|
|
9532
|
+
* End
|
|
9672
9533
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
9673
|
-
* @todo class group will be renamed to `inset-e` in next major release
|
|
9674
9534
|
*/
|
|
9675
9535
|
end: [{
|
|
9676
|
-
'inset-e': scaleInset(),
|
|
9677
|
-
/**
|
|
9678
|
-
* @deprecated since Tailwind CSS v4.2.0 in favor of `inset-e-*` utilities.
|
|
9679
|
-
* @see https://github.com/tailwindlabs/tailwindcss/pull/19613
|
|
9680
|
-
*/
|
|
9681
9536
|
end: scaleInset()
|
|
9682
9537
|
}],
|
|
9683
|
-
/**
|
|
9684
|
-
* Inset Block Start
|
|
9685
|
-
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
9686
|
-
*/
|
|
9687
|
-
'inset-bs': [{
|
|
9688
|
-
'inset-bs': scaleInset()
|
|
9689
|
-
}],
|
|
9690
|
-
/**
|
|
9691
|
-
* Inset Block End
|
|
9692
|
-
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
9693
|
-
*/
|
|
9694
|
-
'inset-be': [{
|
|
9695
|
-
'inset-be': scaleInset()
|
|
9696
|
-
}],
|
|
9697
9538
|
/**
|
|
9698
9539
|
* Top
|
|
9699
9540
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
@@ -9960,47 +9801,33 @@ const getDefaultConfig = () => {
|
|
|
9960
9801
|
p: scaleUnambiguousSpacing()
|
|
9961
9802
|
}],
|
|
9962
9803
|
/**
|
|
9963
|
-
* Padding
|
|
9804
|
+
* Padding X
|
|
9964
9805
|
* @see https://tailwindcss.com/docs/padding
|
|
9965
9806
|
*/
|
|
9966
9807
|
px: [{
|
|
9967
9808
|
px: scaleUnambiguousSpacing()
|
|
9968
9809
|
}],
|
|
9969
9810
|
/**
|
|
9970
|
-
* Padding
|
|
9811
|
+
* Padding Y
|
|
9971
9812
|
* @see https://tailwindcss.com/docs/padding
|
|
9972
9813
|
*/
|
|
9973
9814
|
py: [{
|
|
9974
9815
|
py: scaleUnambiguousSpacing()
|
|
9975
9816
|
}],
|
|
9976
9817
|
/**
|
|
9977
|
-
* Padding
|
|
9818
|
+
* Padding Start
|
|
9978
9819
|
* @see https://tailwindcss.com/docs/padding
|
|
9979
9820
|
*/
|
|
9980
9821
|
ps: [{
|
|
9981
9822
|
ps: scaleUnambiguousSpacing()
|
|
9982
9823
|
}],
|
|
9983
9824
|
/**
|
|
9984
|
-
* Padding
|
|
9825
|
+
* Padding End
|
|
9985
9826
|
* @see https://tailwindcss.com/docs/padding
|
|
9986
9827
|
*/
|
|
9987
9828
|
pe: [{
|
|
9988
9829
|
pe: scaleUnambiguousSpacing()
|
|
9989
9830
|
}],
|
|
9990
|
-
/**
|
|
9991
|
-
* Padding Block Start
|
|
9992
|
-
* @see https://tailwindcss.com/docs/padding
|
|
9993
|
-
*/
|
|
9994
|
-
pbs: [{
|
|
9995
|
-
pbs: scaleUnambiguousSpacing()
|
|
9996
|
-
}],
|
|
9997
|
-
/**
|
|
9998
|
-
* Padding Block End
|
|
9999
|
-
* @see https://tailwindcss.com/docs/padding
|
|
10000
|
-
*/
|
|
10001
|
-
pbe: [{
|
|
10002
|
-
pbe: scaleUnambiguousSpacing()
|
|
10003
|
-
}],
|
|
10004
9831
|
/**
|
|
10005
9832
|
* Padding Top
|
|
10006
9833
|
* @see https://tailwindcss.com/docs/padding
|
|
@@ -10037,47 +9864,33 @@ const getDefaultConfig = () => {
|
|
|
10037
9864
|
m: scaleMargin()
|
|
10038
9865
|
}],
|
|
10039
9866
|
/**
|
|
10040
|
-
* Margin
|
|
9867
|
+
* Margin X
|
|
10041
9868
|
* @see https://tailwindcss.com/docs/margin
|
|
10042
9869
|
*/
|
|
10043
9870
|
mx: [{
|
|
10044
9871
|
mx: scaleMargin()
|
|
10045
9872
|
}],
|
|
10046
9873
|
/**
|
|
10047
|
-
* Margin
|
|
9874
|
+
* Margin Y
|
|
10048
9875
|
* @see https://tailwindcss.com/docs/margin
|
|
10049
9876
|
*/
|
|
10050
9877
|
my: [{
|
|
10051
9878
|
my: scaleMargin()
|
|
10052
9879
|
}],
|
|
10053
9880
|
/**
|
|
10054
|
-
* Margin
|
|
9881
|
+
* Margin Start
|
|
10055
9882
|
* @see https://tailwindcss.com/docs/margin
|
|
10056
9883
|
*/
|
|
10057
9884
|
ms: [{
|
|
10058
9885
|
ms: scaleMargin()
|
|
10059
9886
|
}],
|
|
10060
9887
|
/**
|
|
10061
|
-
* Margin
|
|
9888
|
+
* Margin End
|
|
10062
9889
|
* @see https://tailwindcss.com/docs/margin
|
|
10063
9890
|
*/
|
|
10064
9891
|
me: [{
|
|
10065
9892
|
me: scaleMargin()
|
|
10066
9893
|
}],
|
|
10067
|
-
/**
|
|
10068
|
-
* Margin Block Start
|
|
10069
|
-
* @see https://tailwindcss.com/docs/margin
|
|
10070
|
-
*/
|
|
10071
|
-
mbs: [{
|
|
10072
|
-
mbs: scaleMargin()
|
|
10073
|
-
}],
|
|
10074
|
-
/**
|
|
10075
|
-
* Margin Block End
|
|
10076
|
-
* @see https://tailwindcss.com/docs/margin
|
|
10077
|
-
*/
|
|
10078
|
-
mbe: [{
|
|
10079
|
-
mbe: scaleMargin()
|
|
10080
|
-
}],
|
|
10081
9894
|
/**
|
|
10082
9895
|
* Margin Top
|
|
10083
9896
|
* @see https://tailwindcss.com/docs/margin
|
|
@@ -10140,48 +9953,6 @@ const getDefaultConfig = () => {
|
|
|
10140
9953
|
size: [{
|
|
10141
9954
|
size: scaleSizing()
|
|
10142
9955
|
}],
|
|
10143
|
-
/**
|
|
10144
|
-
* Inline Size
|
|
10145
|
-
* @see https://tailwindcss.com/docs/width
|
|
10146
|
-
*/
|
|
10147
|
-
'inline-size': [{
|
|
10148
|
-
inline: ['auto', ...scaleSizingInline()]
|
|
10149
|
-
}],
|
|
10150
|
-
/**
|
|
10151
|
-
* Min-Inline Size
|
|
10152
|
-
* @see https://tailwindcss.com/docs/min-width
|
|
10153
|
-
*/
|
|
10154
|
-
'min-inline-size': [{
|
|
10155
|
-
'min-inline': ['auto', ...scaleSizingInline()]
|
|
10156
|
-
}],
|
|
10157
|
-
/**
|
|
10158
|
-
* Max-Inline Size
|
|
10159
|
-
* @see https://tailwindcss.com/docs/max-width
|
|
10160
|
-
*/
|
|
10161
|
-
'max-inline-size': [{
|
|
10162
|
-
'max-inline': ['none', ...scaleSizingInline()]
|
|
10163
|
-
}],
|
|
10164
|
-
/**
|
|
10165
|
-
* Block Size
|
|
10166
|
-
* @see https://tailwindcss.com/docs/height
|
|
10167
|
-
*/
|
|
10168
|
-
'block-size': [{
|
|
10169
|
-
block: ['auto', ...scaleSizingBlock()]
|
|
10170
|
-
}],
|
|
10171
|
-
/**
|
|
10172
|
-
* Min-Block Size
|
|
10173
|
-
* @see https://tailwindcss.com/docs/min-height
|
|
10174
|
-
*/
|
|
10175
|
-
'min-block-size': [{
|
|
10176
|
-
'min-block': ['auto', ...scaleSizingBlock()]
|
|
10177
|
-
}],
|
|
10178
|
-
/**
|
|
10179
|
-
* Max-Block Size
|
|
10180
|
-
* @see https://tailwindcss.com/docs/max-height
|
|
10181
|
-
*/
|
|
10182
|
-
'max-block-size': [{
|
|
10183
|
-
'max-block': ['none', ...scaleSizingBlock()]
|
|
10184
|
-
}],
|
|
10185
9956
|
/**
|
|
10186
9957
|
* Width
|
|
10187
9958
|
* @see https://tailwindcss.com/docs/width
|
|
@@ -10254,7 +10025,7 @@ const getDefaultConfig = () => {
|
|
|
10254
10025
|
* @see https://tailwindcss.com/docs/font-weight
|
|
10255
10026
|
*/
|
|
10256
10027
|
'font-weight': [{
|
|
10257
|
-
font: [themeFontWeight,
|
|
10028
|
+
font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]
|
|
10258
10029
|
}],
|
|
10259
10030
|
/**
|
|
10260
10031
|
* Font Stretch
|
|
@@ -10268,14 +10039,7 @@ const getDefaultConfig = () => {
|
|
|
10268
10039
|
* @see https://tailwindcss.com/docs/font-family
|
|
10269
10040
|
*/
|
|
10270
10041
|
'font-family': [{
|
|
10271
|
-
font: [isArbitraryVariableFamilyName,
|
|
10272
|
-
}],
|
|
10273
|
-
/**
|
|
10274
|
-
* Font Feature Settings
|
|
10275
|
-
* @see https://tailwindcss.com/docs/font-feature-settings
|
|
10276
|
-
*/
|
|
10277
|
-
'font-features': [{
|
|
10278
|
-
'font-features': [isArbitraryValue]
|
|
10042
|
+
font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]
|
|
10279
10043
|
}],
|
|
10280
10044
|
/**
|
|
10281
10045
|
* Font Variant Numeric
|
|
@@ -10694,47 +10458,33 @@ const getDefaultConfig = () => {
|
|
|
10694
10458
|
border: scaleBorderWidth()
|
|
10695
10459
|
}],
|
|
10696
10460
|
/**
|
|
10697
|
-
* Border Width
|
|
10461
|
+
* Border Width X
|
|
10698
10462
|
* @see https://tailwindcss.com/docs/border-width
|
|
10699
10463
|
*/
|
|
10700
10464
|
'border-w-x': [{
|
|
10701
10465
|
'border-x': scaleBorderWidth()
|
|
10702
10466
|
}],
|
|
10703
10467
|
/**
|
|
10704
|
-
* Border Width
|
|
10468
|
+
* Border Width Y
|
|
10705
10469
|
* @see https://tailwindcss.com/docs/border-width
|
|
10706
10470
|
*/
|
|
10707
10471
|
'border-w-y': [{
|
|
10708
10472
|
'border-y': scaleBorderWidth()
|
|
10709
10473
|
}],
|
|
10710
10474
|
/**
|
|
10711
|
-
* Border Width
|
|
10475
|
+
* Border Width Start
|
|
10712
10476
|
* @see https://tailwindcss.com/docs/border-width
|
|
10713
10477
|
*/
|
|
10714
10478
|
'border-w-s': [{
|
|
10715
10479
|
'border-s': scaleBorderWidth()
|
|
10716
10480
|
}],
|
|
10717
10481
|
/**
|
|
10718
|
-
* Border Width
|
|
10482
|
+
* Border Width End
|
|
10719
10483
|
* @see https://tailwindcss.com/docs/border-width
|
|
10720
10484
|
*/
|
|
10721
10485
|
'border-w-e': [{
|
|
10722
10486
|
'border-e': scaleBorderWidth()
|
|
10723
10487
|
}],
|
|
10724
|
-
/**
|
|
10725
|
-
* Border Width Block Start
|
|
10726
|
-
* @see https://tailwindcss.com/docs/border-width
|
|
10727
|
-
*/
|
|
10728
|
-
'border-w-bs': [{
|
|
10729
|
-
'border-bs': scaleBorderWidth()
|
|
10730
|
-
}],
|
|
10731
|
-
/**
|
|
10732
|
-
* Border Width Block End
|
|
10733
|
-
* @see https://tailwindcss.com/docs/border-width
|
|
10734
|
-
*/
|
|
10735
|
-
'border-w-be': [{
|
|
10736
|
-
'border-be': scaleBorderWidth()
|
|
10737
|
-
}],
|
|
10738
10488
|
/**
|
|
10739
10489
|
* Border Width Top
|
|
10740
10490
|
* @see https://tailwindcss.com/docs/border-width
|
|
@@ -10809,47 +10559,33 @@ const getDefaultConfig = () => {
|
|
|
10809
10559
|
border: scaleColor()
|
|
10810
10560
|
}],
|
|
10811
10561
|
/**
|
|
10812
|
-
* Border Color
|
|
10562
|
+
* Border Color X
|
|
10813
10563
|
* @see https://tailwindcss.com/docs/border-color
|
|
10814
10564
|
*/
|
|
10815
10565
|
'border-color-x': [{
|
|
10816
10566
|
'border-x': scaleColor()
|
|
10817
10567
|
}],
|
|
10818
10568
|
/**
|
|
10819
|
-
* Border Color
|
|
10569
|
+
* Border Color Y
|
|
10820
10570
|
* @see https://tailwindcss.com/docs/border-color
|
|
10821
10571
|
*/
|
|
10822
10572
|
'border-color-y': [{
|
|
10823
10573
|
'border-y': scaleColor()
|
|
10824
10574
|
}],
|
|
10825
10575
|
/**
|
|
10826
|
-
* Border Color
|
|
10576
|
+
* Border Color S
|
|
10827
10577
|
* @see https://tailwindcss.com/docs/border-color
|
|
10828
10578
|
*/
|
|
10829
10579
|
'border-color-s': [{
|
|
10830
10580
|
'border-s': scaleColor()
|
|
10831
10581
|
}],
|
|
10832
10582
|
/**
|
|
10833
|
-
* Border Color
|
|
10583
|
+
* Border Color E
|
|
10834
10584
|
* @see https://tailwindcss.com/docs/border-color
|
|
10835
10585
|
*/
|
|
10836
10586
|
'border-color-e': [{
|
|
10837
10587
|
'border-e': scaleColor()
|
|
10838
10588
|
}],
|
|
10839
|
-
/**
|
|
10840
|
-
* Border Color Block Start
|
|
10841
|
-
* @see https://tailwindcss.com/docs/border-color
|
|
10842
|
-
*/
|
|
10843
|
-
'border-color-bs': [{
|
|
10844
|
-
'border-bs': scaleColor()
|
|
10845
|
-
}],
|
|
10846
|
-
/**
|
|
10847
|
-
* Border Color Block End
|
|
10848
|
-
* @see https://tailwindcss.com/docs/border-color
|
|
10849
|
-
*/
|
|
10850
|
-
'border-color-be': [{
|
|
10851
|
-
'border-be': scaleColor()
|
|
10852
|
-
}],
|
|
10853
10589
|
/**
|
|
10854
10590
|
* Border Color Top
|
|
10855
10591
|
* @see https://tailwindcss.com/docs/border-color
|
|
@@ -11710,47 +11446,33 @@ const getDefaultConfig = () => {
|
|
|
11710
11446
|
'scroll-m': scaleUnambiguousSpacing()
|
|
11711
11447
|
}],
|
|
11712
11448
|
/**
|
|
11713
|
-
* Scroll Margin
|
|
11449
|
+
* Scroll Margin X
|
|
11714
11450
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
11715
11451
|
*/
|
|
11716
11452
|
'scroll-mx': [{
|
|
11717
11453
|
'scroll-mx': scaleUnambiguousSpacing()
|
|
11718
11454
|
}],
|
|
11719
11455
|
/**
|
|
11720
|
-
* Scroll Margin
|
|
11456
|
+
* Scroll Margin Y
|
|
11721
11457
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
11722
11458
|
*/
|
|
11723
11459
|
'scroll-my': [{
|
|
11724
11460
|
'scroll-my': scaleUnambiguousSpacing()
|
|
11725
11461
|
}],
|
|
11726
11462
|
/**
|
|
11727
|
-
* Scroll Margin
|
|
11463
|
+
* Scroll Margin Start
|
|
11728
11464
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
11729
11465
|
*/
|
|
11730
11466
|
'scroll-ms': [{
|
|
11731
11467
|
'scroll-ms': scaleUnambiguousSpacing()
|
|
11732
11468
|
}],
|
|
11733
11469
|
/**
|
|
11734
|
-
* Scroll Margin
|
|
11470
|
+
* Scroll Margin End
|
|
11735
11471
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
11736
11472
|
*/
|
|
11737
11473
|
'scroll-me': [{
|
|
11738
11474
|
'scroll-me': scaleUnambiguousSpacing()
|
|
11739
11475
|
}],
|
|
11740
|
-
/**
|
|
11741
|
-
* Scroll Margin Block Start
|
|
11742
|
-
* @see https://tailwindcss.com/docs/scroll-margin
|
|
11743
|
-
*/
|
|
11744
|
-
'scroll-mbs': [{
|
|
11745
|
-
'scroll-mbs': scaleUnambiguousSpacing()
|
|
11746
|
-
}],
|
|
11747
|
-
/**
|
|
11748
|
-
* Scroll Margin Block End
|
|
11749
|
-
* @see https://tailwindcss.com/docs/scroll-margin
|
|
11750
|
-
*/
|
|
11751
|
-
'scroll-mbe': [{
|
|
11752
|
-
'scroll-mbe': scaleUnambiguousSpacing()
|
|
11753
|
-
}],
|
|
11754
11476
|
/**
|
|
11755
11477
|
* Scroll Margin Top
|
|
11756
11478
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
@@ -11787,47 +11509,33 @@ const getDefaultConfig = () => {
|
|
|
11787
11509
|
'scroll-p': scaleUnambiguousSpacing()
|
|
11788
11510
|
}],
|
|
11789
11511
|
/**
|
|
11790
|
-
* Scroll Padding
|
|
11512
|
+
* Scroll Padding X
|
|
11791
11513
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
11792
11514
|
*/
|
|
11793
11515
|
'scroll-px': [{
|
|
11794
11516
|
'scroll-px': scaleUnambiguousSpacing()
|
|
11795
11517
|
}],
|
|
11796
11518
|
/**
|
|
11797
|
-
* Scroll Padding
|
|
11519
|
+
* Scroll Padding Y
|
|
11798
11520
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
11799
11521
|
*/
|
|
11800
11522
|
'scroll-py': [{
|
|
11801
11523
|
'scroll-py': scaleUnambiguousSpacing()
|
|
11802
11524
|
}],
|
|
11803
11525
|
/**
|
|
11804
|
-
* Scroll Padding
|
|
11526
|
+
* Scroll Padding Start
|
|
11805
11527
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
11806
11528
|
*/
|
|
11807
11529
|
'scroll-ps': [{
|
|
11808
11530
|
'scroll-ps': scaleUnambiguousSpacing()
|
|
11809
11531
|
}],
|
|
11810
11532
|
/**
|
|
11811
|
-
* Scroll Padding
|
|
11533
|
+
* Scroll Padding End
|
|
11812
11534
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
11813
11535
|
*/
|
|
11814
11536
|
'scroll-pe': [{
|
|
11815
11537
|
'scroll-pe': scaleUnambiguousSpacing()
|
|
11816
11538
|
}],
|
|
11817
|
-
/**
|
|
11818
|
-
* Scroll Padding Block Start
|
|
11819
|
-
* @see https://tailwindcss.com/docs/scroll-padding
|
|
11820
|
-
*/
|
|
11821
|
-
'scroll-pbs': [{
|
|
11822
|
-
'scroll-pbs': scaleUnambiguousSpacing()
|
|
11823
|
-
}],
|
|
11824
|
-
/**
|
|
11825
|
-
* Scroll Padding Block End
|
|
11826
|
-
* @see https://tailwindcss.com/docs/scroll-padding
|
|
11827
|
-
*/
|
|
11828
|
-
'scroll-pbe': [{
|
|
11829
|
-
'scroll-pbe': scaleUnambiguousSpacing()
|
|
11830
|
-
}],
|
|
11831
11539
|
/**
|
|
11832
11540
|
* Scroll Padding Top
|
|
11833
11541
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
@@ -11962,15 +11670,15 @@ const getDefaultConfig = () => {
|
|
|
11962
11670
|
conflictingClassGroups: {
|
|
11963
11671
|
overflow: ['overflow-x', 'overflow-y'],
|
|
11964
11672
|
overscroll: ['overscroll-x', 'overscroll-y'],
|
|
11965
|
-
inset: ['inset-x', 'inset-y', '
|
|
11673
|
+
inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],
|
|
11966
11674
|
'inset-x': ['right', 'left'],
|
|
11967
11675
|
'inset-y': ['top', 'bottom'],
|
|
11968
11676
|
flex: ['basis', 'grow', 'shrink'],
|
|
11969
11677
|
gap: ['gap-x', 'gap-y'],
|
|
11970
|
-
p: ['px', 'py', 'ps', 'pe', '
|
|
11678
|
+
p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],
|
|
11971
11679
|
px: ['pr', 'pl'],
|
|
11972
11680
|
py: ['pt', 'pb'],
|
|
11973
|
-
m: ['mx', 'my', 'ms', 'me', '
|
|
11681
|
+
m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
|
|
11974
11682
|
mx: ['mr', 'ml'],
|
|
11975
11683
|
my: ['mt', 'mb'],
|
|
11976
11684
|
size: ['w', 'h'],
|
|
@@ -11990,18 +11698,18 @@ const getDefaultConfig = () => {
|
|
|
11990
11698
|
'rounded-b': ['rounded-br', 'rounded-bl'],
|
|
11991
11699
|
'rounded-l': ['rounded-tl', 'rounded-bl'],
|
|
11992
11700
|
'border-spacing': ['border-spacing-x', 'border-spacing-y'],
|
|
11993
|
-
'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-
|
|
11701
|
+
'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
|
|
11994
11702
|
'border-w-x': ['border-w-r', 'border-w-l'],
|
|
11995
11703
|
'border-w-y': ['border-w-t', 'border-w-b'],
|
|
11996
|
-
'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-
|
|
11704
|
+
'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
|
|
11997
11705
|
'border-color-x': ['border-color-r', 'border-color-l'],
|
|
11998
11706
|
'border-color-y': ['border-color-t', 'border-color-b'],
|
|
11999
11707
|
translate: ['translate-x', 'translate-y', 'translate-none'],
|
|
12000
11708
|
'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],
|
|
12001
|
-
'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-
|
|
11709
|
+
'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],
|
|
12002
11710
|
'scroll-mx': ['scroll-mr', 'scroll-ml'],
|
|
12003
11711
|
'scroll-my': ['scroll-mt', 'scroll-mb'],
|
|
12004
|
-
'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-
|
|
11712
|
+
'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
|
|
12005
11713
|
'scroll-px': ['scroll-pr', 'scroll-pl'],
|
|
12006
11714
|
'scroll-py': ['scroll-pt', 'scroll-pb'],
|
|
12007
11715
|
touch: ['touch-x', 'touch-y', 'touch-pz'],
|
|
@@ -13565,7 +13273,7 @@ const Calendar = ({ className, classNames, showOutsideDays = true, ...props }) =
|
|
|
13565
13273
|
|
|
13566
13274
|
var dayjs_min = {exports: {}};
|
|
13567
13275
|
|
|
13568
|
-
(function (module, exports
|
|
13276
|
+
(function (module, exports) {
|
|
13569
13277
|
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
13570
13278
|
} (dayjs_min));
|
|
13571
13279
|
|