@app-studio/web 0.8.81 → 0.8.83
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/components/Button/Button/Button.props.d.ts +1 -1
- package/dist/components/Button/Button/Button.view.d.ts +1 -3
- package/dist/components/Gradient/Gradient/Gradient.style.d.ts +16 -15
- package/dist/components/OTPInput/OTPInput/OTPInput.props.d.ts +3 -0
- package/dist/components/OTPInput/OTPInput/OTPInput.state.d.ts +2 -1
- package/dist/components/OTPInput/OTPInput/OTPInput.view.d.ts +1 -0
- package/dist/components/Sidebar/Sidebar/Sidebar.view.d.ts +1 -1
- package/dist/components/Slider/Slider/Slider.props.d.ts +0 -4
- package/dist/web.cjs.development.js +381 -290
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +381 -290
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +382 -292
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +1 -1
package/dist/web.esm.js
CHANGED
|
@@ -27,6 +27,7 @@ import 'core-js/modules/es.string.match.js';
|
|
|
27
27
|
import 'core-js/modules/es.string.search.js';
|
|
28
28
|
import 'core-js/modules/es.array.flat-map.js';
|
|
29
29
|
import 'core-js/modules/es.array.unscopables.flat-map.js';
|
|
30
|
+
import 'core-js/modules/es.string.trim.js';
|
|
30
31
|
|
|
31
32
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
32
33
|
if (null == r) return {};
|
|
@@ -2813,71 +2814,70 @@ var Icon = {
|
|
|
2813
2814
|
* Get theme styles for different alert variants based on theme mode
|
|
2814
2815
|
*/
|
|
2815
2816
|
var getThemes = themeMode => {
|
|
2816
|
-
var isDarkMode = themeMode === 'dark';
|
|
2817
2817
|
return {
|
|
2818
2818
|
default: {
|
|
2819
2819
|
container: {
|
|
2820
|
-
backgroundColor:
|
|
2821
|
-
borderColor:
|
|
2822
|
-
boxShadow:
|
|
2820
|
+
backgroundColor: 'color.gray.50',
|
|
2821
|
+
borderColor: 'color.gray.200',
|
|
2822
|
+
boxShadow: '0 1px 2px rgba(0, 0, 0, 0.05)'
|
|
2823
2823
|
},
|
|
2824
2824
|
content: {
|
|
2825
|
-
color:
|
|
2825
|
+
color: 'color.gray.700'
|
|
2826
2826
|
},
|
|
2827
2827
|
icon: {
|
|
2828
|
-
color:
|
|
2828
|
+
color: 'color.gray.500'
|
|
2829
2829
|
}
|
|
2830
2830
|
},
|
|
2831
2831
|
info: {
|
|
2832
2832
|
container: {
|
|
2833
|
-
backgroundColor:
|
|
2834
|
-
borderColor:
|
|
2835
|
-
boxShadow:
|
|
2833
|
+
backgroundColor: 'color.blue.50',
|
|
2834
|
+
borderColor: 'color.blue.200',
|
|
2835
|
+
boxShadow: '0 1px 2px rgba(59, 130, 246, 0.05)'
|
|
2836
2836
|
},
|
|
2837
2837
|
content: {
|
|
2838
|
-
color:
|
|
2838
|
+
color: 'color.blue.700'
|
|
2839
2839
|
},
|
|
2840
2840
|
icon: {
|
|
2841
|
-
color:
|
|
2841
|
+
color: 'color.blue.500'
|
|
2842
2842
|
}
|
|
2843
2843
|
},
|
|
2844
2844
|
success: {
|
|
2845
2845
|
container: {
|
|
2846
|
-
backgroundColor:
|
|
2847
|
-
borderColor:
|
|
2848
|
-
boxShadow:
|
|
2846
|
+
backgroundColor: 'color.green.50',
|
|
2847
|
+
borderColor: 'color.green.200',
|
|
2848
|
+
boxShadow: '0 1px 2px rgba(34, 197, 94, 0.05)'
|
|
2849
2849
|
},
|
|
2850
2850
|
content: {
|
|
2851
|
-
color:
|
|
2851
|
+
color: 'color.green.700'
|
|
2852
2852
|
},
|
|
2853
2853
|
icon: {
|
|
2854
|
-
color:
|
|
2854
|
+
color: 'color.green.500'
|
|
2855
2855
|
}
|
|
2856
2856
|
},
|
|
2857
2857
|
error: {
|
|
2858
2858
|
container: {
|
|
2859
|
-
backgroundColor:
|
|
2860
|
-
borderColor:
|
|
2861
|
-
boxShadow:
|
|
2859
|
+
backgroundColor: 'color.red.50',
|
|
2860
|
+
borderColor: 'color.red.200',
|
|
2861
|
+
boxShadow: '0 1px 2px rgba(239, 68, 68, 0.05)'
|
|
2862
2862
|
},
|
|
2863
2863
|
content: {
|
|
2864
|
-
color:
|
|
2864
|
+
color: 'color.red.700'
|
|
2865
2865
|
},
|
|
2866
2866
|
icon: {
|
|
2867
|
-
color:
|
|
2867
|
+
color: 'color.red.500'
|
|
2868
2868
|
}
|
|
2869
2869
|
},
|
|
2870
2870
|
warning: {
|
|
2871
2871
|
container: {
|
|
2872
|
-
backgroundColor:
|
|
2873
|
-
borderColor:
|
|
2874
|
-
boxShadow:
|
|
2872
|
+
backgroundColor: 'color.orange.50',
|
|
2873
|
+
borderColor: 'color.orange.200',
|
|
2874
|
+
boxShadow: '0 1px 2px rgba(249, 115, 22, 0.05)'
|
|
2875
2875
|
},
|
|
2876
2876
|
content: {
|
|
2877
|
-
color:
|
|
2877
|
+
color: 'color.orange.700'
|
|
2878
2878
|
},
|
|
2879
2879
|
icon: {
|
|
2880
|
-
color:
|
|
2880
|
+
color: 'color.orange.500'
|
|
2881
2881
|
}
|
|
2882
2882
|
}
|
|
2883
2883
|
};
|
|
@@ -2900,8 +2900,7 @@ var AlertView = _ref => {
|
|
|
2900
2900
|
var {
|
|
2901
2901
|
themeMode
|
|
2902
2902
|
} = useTheme();
|
|
2903
|
-
var
|
|
2904
|
-
var themes = getThemes(currentThemeMode);
|
|
2903
|
+
var themes = getThemes();
|
|
2905
2904
|
// Select the appropriate icon based on the variant
|
|
2906
2905
|
var getIcon = () => {
|
|
2907
2906
|
var _views$icon$color, _views$icon;
|
|
@@ -3230,11 +3229,10 @@ var PositionStyles = {
|
|
|
3230
3229
|
* Get badge variants with consistent styling based on theme mode
|
|
3231
3230
|
*/
|
|
3232
3231
|
var getBadgeVariants = themeMode => {
|
|
3233
|
-
var isDarkMode = themeMode === 'dark';
|
|
3234
3232
|
return {
|
|
3235
3233
|
filled: {
|
|
3236
3234
|
backgroundColor: 'theme.primary',
|
|
3237
|
-
color:
|
|
3235
|
+
color: 'color.white',
|
|
3238
3236
|
borderWidth: '1px',
|
|
3239
3237
|
borderStyle: 'solid',
|
|
3240
3238
|
borderColor: 'transparent',
|
|
@@ -3260,7 +3258,7 @@ var getBadgeVariants = themeMode => {
|
|
|
3260
3258
|
},
|
|
3261
3259
|
ghost: {
|
|
3262
3260
|
backgroundColor: 'transparent',
|
|
3263
|
-
color:
|
|
3261
|
+
color: 'color.gray.500',
|
|
3264
3262
|
borderWidth: '1px',
|
|
3265
3263
|
borderStyle: 'solid',
|
|
3266
3264
|
borderColor: 'transparent',
|
|
@@ -3288,8 +3286,7 @@ var BadgeView = _ref => {
|
|
|
3288
3286
|
var {
|
|
3289
3287
|
themeMode
|
|
3290
3288
|
} = useTheme();
|
|
3291
|
-
var
|
|
3292
|
-
var variantStyles = getBadgeVariants(currentThemeMode)[variant];
|
|
3289
|
+
var variantStyles = getBadgeVariants()[variant];
|
|
3293
3290
|
// Combine styles for the badge
|
|
3294
3291
|
var combinedStyles = Object.assign({
|
|
3295
3292
|
// Base styles
|
|
@@ -3551,7 +3548,9 @@ var DefaultSpinner = _ref => {
|
|
|
3551
3548
|
getColor,
|
|
3552
3549
|
themeMode
|
|
3553
3550
|
} = useTheme();
|
|
3554
|
-
var colorStyle = getColor(color,
|
|
3551
|
+
var colorStyle = getColor(color, {
|
|
3552
|
+
themeMode: elementMode ? elementMode : themeMode
|
|
3553
|
+
});
|
|
3555
3554
|
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
3556
3555
|
var [angle, setAngle] = useState(0);
|
|
3557
3556
|
useEffect(() => {
|
|
@@ -3598,7 +3597,9 @@ var Dotted = _ref2 => {
|
|
|
3598
3597
|
getColor,
|
|
3599
3598
|
themeMode
|
|
3600
3599
|
} = useTheme();
|
|
3601
|
-
var colorStyle = getColor(color,
|
|
3600
|
+
var colorStyle = getColor(color, {
|
|
3601
|
+
themeMode: elementMode ? elementMode : themeMode
|
|
3602
|
+
});
|
|
3602
3603
|
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
3603
3604
|
var [angle, setAngle] = useState(0);
|
|
3604
3605
|
useEffect(() => {
|
|
@@ -3644,7 +3645,9 @@ var Quarter = _ref3 => {
|
|
|
3644
3645
|
getColor,
|
|
3645
3646
|
themeMode
|
|
3646
3647
|
} = useTheme();
|
|
3647
|
-
var colorStyle = getColor(color,
|
|
3648
|
+
var colorStyle = getColor(color, {
|
|
3649
|
+
themeMode: elementMode ? elementMode : themeMode
|
|
3650
|
+
});
|
|
3648
3651
|
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
3649
3652
|
var [angle, setAngle] = useState(0);
|
|
3650
3653
|
useEffect(() => {
|
|
@@ -3711,9 +3714,10 @@ React.createElement(LoaderView, Object.assign({}, props)));
|
|
|
3711
3714
|
// Exports the LoaderComponent as Loader, making it available for use in other parts of the application.
|
|
3712
3715
|
var Loader = LoaderComponent;
|
|
3713
3716
|
|
|
3714
|
-
var _excluded$a = ["icon", "shadow", "children", "ariaLabel", "to", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered", "setIsHovered", "isExternal", "themeMode", "views", "
|
|
3717
|
+
var _excluded$a = ["icon", "shadow", "children", "ariaLabel", "to", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered", "setIsHovered", "isExternal", "themeMode", "views", "color", "backgroundColor"],
|
|
3715
3718
|
_excluded2$3 = ["_hover", "_active"],
|
|
3716
3719
|
_excluded3$3 = ["height"];
|
|
3720
|
+
// Using require for contrast as it seems to be a common pattern in your code
|
|
3717
3721
|
var contrast = /*#__PURE__*/require('contrast');
|
|
3718
3722
|
var ButtonView = _ref => {
|
|
3719
3723
|
var _props$onClick;
|
|
@@ -3735,13 +3739,16 @@ var ButtonView = _ref => {
|
|
|
3735
3739
|
onClick = () => {},
|
|
3736
3740
|
loaderProps = {},
|
|
3737
3741
|
loaderPosition = 'left',
|
|
3738
|
-
effect = 'default',
|
|
3739
|
-
|
|
3742
|
+
effect = 'default' // 'default', 'hover', 'reverse'
|
|
3743
|
+
,
|
|
3740
3744
|
setIsHovered = () => {},
|
|
3741
3745
|
isExternal = false,
|
|
3742
3746
|
themeMode: elementMode,
|
|
3747
|
+
// Allow overriding themeMode for this element
|
|
3743
3748
|
views,
|
|
3744
|
-
|
|
3749
|
+
color,
|
|
3750
|
+
// Text color prop
|
|
3751
|
+
backgroundColor = 'theme.primary' // Background color prop
|
|
3745
3752
|
} = _ref,
|
|
3746
3753
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
3747
3754
|
var {
|
|
@@ -3753,81 +3760,170 @@ var ButtonView = _ref => {
|
|
|
3753
3760
|
var defaultNativeProps = {
|
|
3754
3761
|
disabled: !isActive
|
|
3755
3762
|
};
|
|
3756
|
-
|
|
3757
|
-
var
|
|
3758
|
-
|
|
3759
|
-
// Determine
|
|
3760
|
-
var
|
|
3761
|
-
//
|
|
3762
|
-
var
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3763
|
+
// Determine the base background color key/value, considering disabled state
|
|
3764
|
+
var buttonBackgroundColorKey = isActive ? backgroundColor : 'theme.disabled';
|
|
3765
|
+
// --- Provided Color Logic ---
|
|
3766
|
+
// Determine the effective theme mode for this button
|
|
3767
|
+
var mode = elementMode != null ? elementMode : themeMode; // effective mode
|
|
3768
|
+
// Resolve the base background color string
|
|
3769
|
+
var bg = getColor(buttonBackgroundColorKey, {
|
|
3770
|
+
themeMode: mode
|
|
3771
|
+
});
|
|
3772
|
+
// Resolve the background color string in the opposite theme mode (for reverse effect, though not directly used for ghost/outline text contrast)
|
|
3773
|
+
// const bgHover = getColor(buttonBackgroundColorKey, {
|
|
3774
|
+
// themeMode: mode === 'light' ? 'dark' : 'light',
|
|
3775
|
+
// }); // bgHover is not strictly needed for the text contrast logic below
|
|
3776
|
+
// Check contrast of base background
|
|
3777
|
+
var isBgLight = contrast(bg) === mode;
|
|
3778
|
+
// Determine contrasting text color key for the base background
|
|
3779
|
+
var txtOnBgKey = isBgLight ? 'color.black' : 'color.white';
|
|
3780
|
+
// --- End Provided Color Logic ---
|
|
3781
|
+
// Determine the default text color key/value if 'color' prop is not provided
|
|
3782
|
+
// For filled buttons, default text color should contrast with the background (use txtOnBgKey).
|
|
3783
|
+
// For outline/link/ghost, a theme-appropriate text color is usually better (e.g., theme.text or theme.primary).
|
|
3784
|
+
var defaultTextColorKey;
|
|
3785
|
+
if (variant === 'filled') {
|
|
3786
|
+
defaultTextColorKey = txtOnBgKey; // Use the calculated contrasting color key
|
|
3787
|
+
} else {
|
|
3788
|
+
// For non-filled variants, default to theme's text color or primary color
|
|
3789
|
+
defaultTextColorKey = 'theme.primary'; // Or 'theme.primary' depending on design system
|
|
3790
|
+
}
|
|
3791
|
+
// Determine the actual key/value for the base text color
|
|
3792
|
+
// Use the provided 'color' prop if available, otherwise use the calculated default
|
|
3793
|
+
var baseTextColorKey = color || defaultTextColorKey;
|
|
3794
|
+
// Resolve the actual base text color string
|
|
3795
|
+
var resolvedBaseTextColor = getColor(baseTextColorKey, {
|
|
3796
|
+
themeMode: mode
|
|
3797
|
+
});
|
|
3798
|
+
// Resolve the contrasting color string for the base background (used for text in outline/ghost reverse)
|
|
3799
|
+
var contrastingColorForBg = getColor(txtOnBgKey, {
|
|
3800
|
+
themeMode: mode
|
|
3801
|
+
});
|
|
3802
|
+
// Resolve the contrasting color string for the base text color (used for text in ghost reverse)
|
|
3803
|
+
var isBaseTextLight = contrast(resolvedBaseTextColor) === 'light';
|
|
3804
|
+
var contrastingColorForBaseText = getColor(isBaseTextLight ? 'color.black' : 'color.white', {
|
|
3805
|
+
themeMode: mode
|
|
3806
|
+
});
|
|
3807
|
+
// --- Button Variant Styles Function ---
|
|
3808
|
+
// This function calculates the styles based on the current state (base, hover, active)
|
|
3809
|
+
var getButtonVariantStyles = _ref2 => {
|
|
3810
|
+
var {
|
|
3811
|
+
currentVariant,
|
|
3812
|
+
currentEffect,
|
|
3813
|
+
resolvedBg,
|
|
3814
|
+
// Resolved base background color string (bg)
|
|
3815
|
+
resolvedBaseTextColor,
|
|
3816
|
+
// Resolved base text color string
|
|
3817
|
+
contrastingColorForBg,
|
|
3818
|
+
// Resolved contrasting color string for resolvedBg
|
|
3819
|
+
contrastingColorForBaseText,
|
|
3820
|
+
// Resolved contrasting color string for resolvedBaseTextColor
|
|
3821
|
+
resolvedBorderColor
|
|
3822
|
+
} = _ref2;
|
|
3823
|
+
// Define the base styles for each variant
|
|
3824
|
+
var baseStyles = {
|
|
3825
|
+
filled: {
|
|
3826
|
+
backgroundColor: resolvedBg,
|
|
3827
|
+
color: resolvedBaseTextColor,
|
|
3828
|
+
borderWidth: 1,
|
|
3829
|
+
borderStyle: 'solid',
|
|
3830
|
+
borderColor: 'transparent'
|
|
3773
3831
|
},
|
|
3774
|
-
|
|
3775
|
-
backgroundColor:
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
outline: {
|
|
3781
|
-
backgroundColor: reverse ? buttonColor : 'transparent',
|
|
3782
|
-
borderWidth: 1,
|
|
3783
|
-
borderStyle: 'solid',
|
|
3784
|
-
borderColor: reverse ? buttonColor : colorScheme,
|
|
3785
|
-
color: reverse ? 'white' : buttonColor,
|
|
3786
|
-
_hover: {
|
|
3787
|
-
backgroundColor: reverse ? "" + buttonColor : buttonColor + "10",
|
|
3788
|
-
transform: 'translateY(-2px)',
|
|
3789
|
-
boxShadow: '0 4px 8px rgba(0, 0, 0, 0.05)'
|
|
3832
|
+
outline: {
|
|
3833
|
+
backgroundColor: 'transparent',
|
|
3834
|
+
color: resolvedBaseTextColor,
|
|
3835
|
+
borderWidth: 1,
|
|
3836
|
+
borderStyle: 'solid',
|
|
3837
|
+
borderColor: resolvedBorderColor
|
|
3790
3838
|
},
|
|
3791
|
-
|
|
3792
|
-
backgroundColor:
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
backgroundColor: 'transparent',
|
|
3799
|
-
borderWidth: 0,
|
|
3800
|
-
borderStyle: 'none',
|
|
3801
|
-
borderColor: 'transparent',
|
|
3802
|
-
color: buttonColor,
|
|
3803
|
-
textDecoration: reverse ? 'none' : 'underline',
|
|
3804
|
-
_hover: {
|
|
3805
|
-
opacity: 0.8,
|
|
3806
|
-
textDecorationThickness: '2px'
|
|
3839
|
+
link: {
|
|
3840
|
+
backgroundColor: 'transparent',
|
|
3841
|
+
color: resolvedBg,
|
|
3842
|
+
borderWidth: 0,
|
|
3843
|
+
borderStyle: 'none',
|
|
3844
|
+
borderColor: 'transparent',
|
|
3845
|
+
textDecoration: 'underline'
|
|
3807
3846
|
},
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3847
|
+
ghost: {
|
|
3848
|
+
backgroundColor: 'transparent',
|
|
3849
|
+
color: resolvedBaseTextColor,
|
|
3850
|
+
borderWidth: 0,
|
|
3851
|
+
borderStyle: 'none',
|
|
3852
|
+
borderColor: 'transparent'
|
|
3811
3853
|
}
|
|
3812
|
-
}
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
transform: 'translateY(-2px)'
|
|
3854
|
+
};
|
|
3855
|
+
// Define the styles applied on hover/active when effect is 'reverse'
|
|
3856
|
+
var reverseHoverActiveStyles = {
|
|
3857
|
+
filled: {
|
|
3858
|
+
backgroundColor: 'transparent',
|
|
3859
|
+
color: resolvedBg,
|
|
3860
|
+
borderWidth: 1,
|
|
3861
|
+
borderStyle: 'solid',
|
|
3862
|
+
borderColor: resolvedBg
|
|
3822
3863
|
},
|
|
3823
|
-
|
|
3824
|
-
backgroundColor:
|
|
3825
|
-
|
|
3864
|
+
outline: {
|
|
3865
|
+
backgroundColor: resolvedBg,
|
|
3866
|
+
color: contrastingColorForBg,
|
|
3867
|
+
borderWidth: 1,
|
|
3868
|
+
borderStyle: 'solid',
|
|
3869
|
+
borderColor: 'transparent'
|
|
3870
|
+
},
|
|
3871
|
+
link: {
|
|
3872
|
+
backgroundColor: 'transparent',
|
|
3873
|
+
color: resolvedBg,
|
|
3874
|
+
borderWidth: 0,
|
|
3875
|
+
borderStyle: 'none',
|
|
3876
|
+
borderColor: 'transparent',
|
|
3877
|
+
textDecoration: 'none'
|
|
3878
|
+
},
|
|
3879
|
+
ghost: {
|
|
3880
|
+
backgroundColor: resolvedBg,
|
|
3881
|
+
color: contrastingColorForBaseText,
|
|
3882
|
+
borderWidth: 0,
|
|
3883
|
+
borderStyle: 'none',
|
|
3884
|
+
borderColor: 'transparent'
|
|
3826
3885
|
}
|
|
3827
|
-
}
|
|
3886
|
+
};
|
|
3887
|
+
// General hover/active effects (transform, shadow, opacity, etc.)
|
|
3888
|
+
var generalHoverStyles = {
|
|
3889
|
+
transform: 'translateY(2px)',
|
|
3890
|
+
boxShadow: currentVariant === 'link' ? undefined : '0 4px 8px rgba(0, 0, 0, 0.1)',
|
|
3891
|
+
// opacity: currentVariant === 'link' ? 0.8 : undefined,
|
|
3892
|
+
textDecorationThickness: currentVariant === 'link' ? '2px' : undefined
|
|
3893
|
+
};
|
|
3894
|
+
var generalActiveStyles = {
|
|
3895
|
+
transform: 'translateY(-1px)',
|
|
3896
|
+
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
|
|
3897
|
+
opacity: currentVariant === 'link' ? 0.8 : undefined,
|
|
3898
|
+
textDecorationThickness: currentVariant === 'link' ? '2px' : undefined
|
|
3899
|
+
};
|
|
3900
|
+
// Combine base styles with conditional hover/active overrides
|
|
3901
|
+
return Object.assign({}, baseStyles[currentVariant], {
|
|
3902
|
+
_hover: Object.assign({}, currentEffect === 'reverse' ? reverseHoverActiveStyles[currentVariant] : {}, currentEffect === 'hover' ? {
|
|
3903
|
+
filter: 'brightness(0.85)'
|
|
3904
|
+
} : {}, generalHoverStyles),
|
|
3905
|
+
_active: Object.assign({}, currentEffect === 'reverse' ? reverseHoverActiveStyles[currentVariant] : {}, currentEffect === 'hover' ? {
|
|
3906
|
+
filter: 'brightness(0.7)'
|
|
3907
|
+
} : {}, generalActiveStyles)
|
|
3908
|
+
});
|
|
3828
3909
|
};
|
|
3910
|
+
// Get the calculated variant styles for the current state
|
|
3911
|
+
var buttonVariantStyles = getButtonVariantStyles({
|
|
3912
|
+
currentVariant: variant,
|
|
3913
|
+
currentEffect: effect,
|
|
3914
|
+
resolvedBg: bg,
|
|
3915
|
+
resolvedBaseTextColor: resolvedBaseTextColor,
|
|
3916
|
+
contrastingColorForBg: contrastingColorForBg,
|
|
3917
|
+
contrastingColorForBaseText: contrastingColorForBaseText,
|
|
3918
|
+
resolvedBorderColor: bg
|
|
3919
|
+
});
|
|
3920
|
+
// Extract hover and active styles from the calculated styles
|
|
3921
|
+
var {
|
|
3922
|
+
_hover,
|
|
3923
|
+
_active
|
|
3924
|
+
} = buttonVariantStyles,
|
|
3925
|
+
baseButtonVariantStyles = _objectWithoutPropertiesLoose(buttonVariantStyles, _excluded2$3);
|
|
3829
3926
|
var buttonSizeStyles = ButtonSizes[size];
|
|
3830
|
-
var buttonVariant = ButtonVariants[variant];
|
|
3831
3927
|
var scaleWidth = {
|
|
3832
3928
|
width: isAuto === true ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width
|
|
3833
3929
|
};
|
|
@@ -3840,62 +3936,68 @@ var ButtonView = _ref => {
|
|
|
3840
3936
|
alignItems: "center",
|
|
3841
3937
|
justifyContent: "center"
|
|
3842
3938
|
}, views == null ? void 0 : views.container), isLoading && loaderPosition === 'left' && (/*#__PURE__*/React.createElement(Loader, Object.assign({
|
|
3843
|
-
size: size === 'xs' || size === 'sm' ? 'sm' : 'md'
|
|
3939
|
+
size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
|
|
3940
|
+
color: baseButtonVariantStyles.color
|
|
3844
3941
|
}, loaderProps))), icon && ['left', 'top'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
3845
3942
|
display: "flex",
|
|
3846
3943
|
alignItems: "center",
|
|
3847
|
-
justifyContent: "center"
|
|
3944
|
+
justifyContent: "center",
|
|
3945
|
+
color: baseButtonVariantStyles.color
|
|
3848
3946
|
}, views == null ? void 0 : views.icon), icon)), children, icon && ['right', 'bottom'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
3849
3947
|
display: "flex",
|
|
3850
3948
|
alignItems: "center",
|
|
3851
|
-
justifyContent: "center"
|
|
3949
|
+
justifyContent: "center",
|
|
3950
|
+
color: baseButtonVariantStyles.color
|
|
3852
3951
|
}, views == null ? void 0 : views.icon), icon)), isLoading && loaderPosition === 'right' && (/*#__PURE__*/React.createElement(Loader, Object.assign({
|
|
3853
|
-
size: size === 'xs' || size === 'sm' ? 'sm' : 'md'
|
|
3952
|
+
size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
|
|
3953
|
+
color: baseButtonVariantStyles.color
|
|
3854
3954
|
}, loaderProps))));
|
|
3855
|
-
//
|
|
3856
|
-
var
|
|
3857
|
-
{
|
|
3858
|
-
_hover,
|
|
3859
|
-
_active
|
|
3860
|
-
} = _ref2,
|
|
3861
|
-
baseButtonVariant = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
3955
|
+
// Determine if the button should render as a Link or a button Element
|
|
3956
|
+
var isLink = variant === 'link' && to;
|
|
3862
3957
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
3863
3958
|
gap: 8,
|
|
3864
|
-
as:
|
|
3865
|
-
type:
|
|
3959
|
+
as: isLink ? 'div' : 'button',
|
|
3960
|
+
type: isLink ? undefined : 'button',
|
|
3866
3961
|
display: "flex",
|
|
3867
3962
|
alignItems: "center",
|
|
3868
3963
|
justifyContent: "center",
|
|
3869
3964
|
"aria-label": ariaLabel,
|
|
3870
|
-
backgroundColor
|
|
3965
|
+
// backgroundColor="transparent" // Remove this unless it's intended to override variant styles
|
|
3871
3966
|
borderRadius: ButtonShapes[shape],
|
|
3872
3967
|
onClick: (_props$onClick = props.onClick) != null ? _props$onClick : onClick,
|
|
3873
3968
|
onMouseEnter: () => handleHover(true),
|
|
3874
3969
|
onMouseLeave: () => handleHover(false),
|
|
3875
|
-
cursor: isActive ? 'pointer' : 'default',
|
|
3876
|
-
filter: hovering && effect === 'hover' ? 'brightness(0.85)' : 'brightness(1)',
|
|
3970
|
+
cursor: isActive ? isLink ? 'pointer' : 'pointer' : 'default',
|
|
3877
3971
|
transition: "all 0.2s ease",
|
|
3878
|
-
|
|
3879
|
-
// Apply consistent styling according to design guidelines
|
|
3972
|
+
// filter and transform are now handled within _hover/_active styles
|
|
3880
3973
|
// Apply shadow if provided
|
|
3881
3974
|
boxShadow: shadow ? shadow : undefined
|
|
3882
3975
|
}, defaultNativeProps, (_ref3 => {
|
|
3883
3976
|
var rest = _objectWithoutPropertiesLoose(_ref3, _excluded3$3);
|
|
3884
3977
|
return rest;
|
|
3885
|
-
})(props), buttonSizeStyles,
|
|
3978
|
+
})(props), buttonSizeStyles, baseButtonVariantStyles, scaleWidth, props.padding || props.paddingHorizontal || props.paddingVertical || props.paddingLeft || props.paddingRight || props.paddingTop || props.paddingBottom ? {} : changePadding, {
|
|
3886
3979
|
// Apply hover and active styles
|
|
3887
3980
|
_hover: _hover,
|
|
3888
3981
|
_active: _active
|
|
3889
|
-
}
|
|
3982
|
+
}), to ? (/*#__PURE__*/React.createElement(Link, Object.assign({
|
|
3890
3983
|
to: to,
|
|
3891
|
-
|
|
3892
|
-
|
|
3984
|
+
isExternal: isExternal,
|
|
3985
|
+
// Link styles should inherit from the button's calculated styles or be defined here
|
|
3986
|
+
// Let's apply relevant styles from the button variant to the Link
|
|
3987
|
+
color: baseButtonVariantStyles.color,
|
|
3988
|
+
textDecoration: baseButtonVariantStyles.textDecoration,
|
|
3989
|
+
textDecorationColor: baseButtonVariantStyles.color,
|
|
3990
|
+
textDecorationThickness: "1px" // Base thickness
|
|
3991
|
+
,
|
|
3893
3992
|
textUnderlineOffset: "2px",
|
|
3894
3993
|
transition: "all 0.2s ease",
|
|
3895
|
-
|
|
3896
|
-
_hover: {
|
|
3994
|
+
// Apply Link-specific hover/active styles if needed, or let Element's _hover/_active handle it
|
|
3995
|
+
_hover: Object.assign({}, _hover, {
|
|
3897
3996
|
textDecorationThickness: '2px'
|
|
3898
|
-
}
|
|
3997
|
+
}),
|
|
3998
|
+
_active: Object.assign({}, _active, {
|
|
3999
|
+
textDecorationThickness: '2px'
|
|
4000
|
+
})
|
|
3899
4001
|
}, views == null ? void 0 : views.link), content)) : content);
|
|
3900
4002
|
};
|
|
3901
4003
|
|
|
@@ -3948,30 +4050,29 @@ var CardShapes = {
|
|
|
3948
4050
|
* Get card variants with consistent styling based on theme mode
|
|
3949
4051
|
*/
|
|
3950
4052
|
var getCardVariants = themeMode => {
|
|
3951
|
-
var isDarkMode = themeMode === 'dark';
|
|
3952
4053
|
return {
|
|
3953
4054
|
default: {
|
|
3954
|
-
backgroundColor:
|
|
4055
|
+
backgroundColor: 'color.white',
|
|
3955
4056
|
border: 'none',
|
|
3956
4057
|
transition: 'all 0.2s ease'
|
|
3957
4058
|
},
|
|
3958
4059
|
outlined: {
|
|
3959
|
-
backgroundColor:
|
|
4060
|
+
backgroundColor: 'color.white',
|
|
3960
4061
|
borderWidth: '1px',
|
|
3961
4062
|
borderStyle: 'solid',
|
|
3962
|
-
borderColor:
|
|
4063
|
+
borderColor: 'color.gray.200',
|
|
3963
4064
|
transition: 'all 0.2s ease',
|
|
3964
4065
|
_hover: {
|
|
3965
|
-
borderColor:
|
|
4066
|
+
borderColor: 'color.gray.300'
|
|
3966
4067
|
}
|
|
3967
4068
|
},
|
|
3968
4069
|
elevated: {
|
|
3969
|
-
backgroundColor:
|
|
3970
|
-
boxShadow:
|
|
4070
|
+
backgroundColor: 'color.white',
|
|
4071
|
+
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.08)',
|
|
3971
4072
|
border: 'none',
|
|
3972
4073
|
transition: 'all 0.2s ease',
|
|
3973
4074
|
_hover: {
|
|
3974
|
-
boxShadow:
|
|
4075
|
+
boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.12)',
|
|
3975
4076
|
transform: 'translateY(-2px)'
|
|
3976
4077
|
}
|
|
3977
4078
|
}
|
|
@@ -3982,14 +4083,10 @@ var getCardVariants = themeMode => {
|
|
|
3982
4083
|
* @param theme - Theme object from useTheme hook
|
|
3983
4084
|
*/
|
|
3984
4085
|
var getDefaultCardStyles = theme => {
|
|
3985
|
-
var {
|
|
3986
|
-
themeMode
|
|
3987
|
-
} = theme;
|
|
3988
|
-
var isDarkMode = themeMode === 'dark';
|
|
3989
4086
|
return {
|
|
3990
4087
|
container: {
|
|
3991
|
-
backgroundColor:
|
|
3992
|
-
color:
|
|
4088
|
+
backgroundColor: 'color.white',
|
|
4089
|
+
color: 'color.black',
|
|
3993
4090
|
borderRadius: '8px',
|
|
3994
4091
|
overflow: 'hidden',
|
|
3995
4092
|
transition: 'all 0.2s ease'
|
|
@@ -3998,17 +4095,18 @@ var getDefaultCardStyles = theme => {
|
|
|
3998
4095
|
padding: '16px',
|
|
3999
4096
|
borderBottomWidth: '1px',
|
|
4000
4097
|
borderBottomStyle: 'solid',
|
|
4001
|
-
borderBottomColor:
|
|
4098
|
+
borderBottomColor: 'color.gray.200',
|
|
4099
|
+
color: 'color.black'
|
|
4002
4100
|
},
|
|
4003
4101
|
content: {
|
|
4004
4102
|
padding: '16px',
|
|
4005
|
-
color:
|
|
4103
|
+
color: 'color.black'
|
|
4006
4104
|
},
|
|
4007
4105
|
footer: {
|
|
4008
4106
|
padding: '16px',
|
|
4009
4107
|
borderTopWidth: '1px',
|
|
4010
4108
|
borderTopStyle: 'solid',
|
|
4011
|
-
borderTopColor:
|
|
4109
|
+
borderTopColor: 'color.gray.200'
|
|
4012
4110
|
}
|
|
4013
4111
|
};
|
|
4014
4112
|
};
|
|
@@ -4033,7 +4131,7 @@ var CardHeader = _ref => {
|
|
|
4033
4131
|
var {
|
|
4034
4132
|
styles: contextStyles
|
|
4035
4133
|
} = useCardContext();
|
|
4036
|
-
var defaultStyles = getDefaultCardStyles(
|
|
4134
|
+
var defaultStyles = getDefaultCardStyles().header;
|
|
4037
4135
|
// Merge styles: Default < Context Override < Direct Props/Style
|
|
4038
4136
|
var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.header, props, {
|
|
4039
4137
|
style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$header = contextStyles.header) == null ? void 0 : _contextStyles$header.style, style)
|
|
@@ -4051,7 +4149,7 @@ var CardContent = _ref2 => {
|
|
|
4051
4149
|
var {
|
|
4052
4150
|
styles: contextStyles
|
|
4053
4151
|
} = useCardContext();
|
|
4054
|
-
var defaultStyles = getDefaultCardStyles(
|
|
4152
|
+
var defaultStyles = getDefaultCardStyles().content;
|
|
4055
4153
|
// Merge styles: Default < Context Override < Direct Props/Style
|
|
4056
4154
|
var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.content, props, {
|
|
4057
4155
|
style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$conten = contextStyles.content) == null ? void 0 : _contextStyles$conten.style, style)
|
|
@@ -4069,7 +4167,7 @@ var CardFooter = _ref3 => {
|
|
|
4069
4167
|
var {
|
|
4070
4168
|
styles: contextStyles
|
|
4071
4169
|
} = useCardContext();
|
|
4072
|
-
var defaultStyles = getDefaultCardStyles(
|
|
4170
|
+
var defaultStyles = getDefaultCardStyles().footer;
|
|
4073
4171
|
// Merge styles: Default < Context Override < Direct Props/Style
|
|
4074
4172
|
var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.footer, props, {
|
|
4075
4173
|
style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$footer = contextStyles.footer) == null ? void 0 : _contextStyles$footer.style, style)
|
|
@@ -4092,7 +4190,7 @@ var CardView = _ref4 => {
|
|
|
4092
4190
|
} = _ref4,
|
|
4093
4191
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
|
|
4094
4192
|
var theme = useTheme();
|
|
4095
|
-
var defaultStyles = getDefaultCardStyles(
|
|
4193
|
+
var defaultStyles = getDefaultCardStyles();
|
|
4096
4194
|
// Prepare context value, merging default styles with user's `views` overrides
|
|
4097
4195
|
var contextValue = useMemo(() => ({
|
|
4098
4196
|
styles: {
|
|
@@ -4105,12 +4203,7 @@ var CardView = _ref4 => {
|
|
|
4105
4203
|
// Determine if we have explicit Card.Header, Card.Content, Card.Footer components
|
|
4106
4204
|
// or if we need to wrap children in a default layout
|
|
4107
4205
|
var hasExplicitStructure = React.Children.toArray(children).some(child => /*#__PURE__*/React.isValidElement(child) && (child.type === CardHeader || child.type === CardContent || child.type === CardFooter));
|
|
4108
|
-
|
|
4109
|
-
var {
|
|
4110
|
-
themeMode
|
|
4111
|
-
} = theme;
|
|
4112
|
-
var currentThemeMode = elementMode || themeMode;
|
|
4113
|
-
var variantStyles = getCardVariants(currentThemeMode)[variant];
|
|
4206
|
+
var variantStyles = getCardVariants()[variant];
|
|
4114
4207
|
// Merge styles for the root element
|
|
4115
4208
|
var mergedRootProps = Object.assign({
|
|
4116
4209
|
width: isFullWidth ? '100%' : 'auto',
|
|
@@ -4357,7 +4450,7 @@ var ActiveIndicatorStyles = {
|
|
|
4357
4450
|
},
|
|
4358
4451
|
number: {
|
|
4359
4452
|
backgroundColor: 'theme.primary',
|
|
4360
|
-
color: 'white'
|
|
4453
|
+
color: 'color.white'
|
|
4361
4454
|
}
|
|
4362
4455
|
};
|
|
4363
4456
|
var NavigationButtonStyles = {
|
|
@@ -4432,7 +4525,7 @@ var _excluded$c = ["children", "isActive", "views"],
|
|
|
4432
4525
|
_excluded3$5 = ["views", "children"],
|
|
4433
4526
|
_excluded4$4 = ["children", "views"],
|
|
4434
4527
|
_excluded5$1 = ["children", "views", "style"],
|
|
4435
|
-
_excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "themeMode"];
|
|
4528
|
+
_excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "stepIndices", "themeMode"];
|
|
4436
4529
|
var CarouselSlide = _ref => {
|
|
4437
4530
|
var {
|
|
4438
4531
|
children,
|
|
@@ -4802,7 +4895,7 @@ var LegendTextStyles = {
|
|
|
4802
4895
|
// Default styles for tooltip
|
|
4803
4896
|
var TooltipStyles = {
|
|
4804
4897
|
position: 'absolute',
|
|
4805
|
-
backgroundColor: 'white',
|
|
4898
|
+
backgroundColor: 'color.white',
|
|
4806
4899
|
padding: '8px 12px',
|
|
4807
4900
|
borderRadius: '4px',
|
|
4808
4901
|
boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
|
|
@@ -5639,7 +5732,7 @@ var ContextMenuSizes = {
|
|
|
5639
5732
|
};
|
|
5640
5733
|
var ContextMenuVariants = {
|
|
5641
5734
|
default: {
|
|
5642
|
-
backgroundColor: 'white',
|
|
5735
|
+
backgroundColor: 'color.white',
|
|
5643
5736
|
color: 'color.gray.800'
|
|
5644
5737
|
},
|
|
5645
5738
|
filled: {
|
|
@@ -5647,7 +5740,7 @@ var ContextMenuVariants = {
|
|
|
5647
5740
|
color: 'color.gray.800'
|
|
5648
5741
|
},
|
|
5649
5742
|
outline: {
|
|
5650
|
-
backgroundColor: 'white',
|
|
5743
|
+
backgroundColor: 'color.white',
|
|
5651
5744
|
borderWidth: '1px',
|
|
5652
5745
|
borderStyle: 'solid',
|
|
5653
5746
|
borderColor: 'color.gray.200',
|
|
@@ -6317,7 +6410,7 @@ var InputVariants = {
|
|
|
6317
6410
|
borderWidth: '1px',
|
|
6318
6411
|
borderStyle: 'solid',
|
|
6319
6412
|
borderColor: 'color.gray.200',
|
|
6320
|
-
backgroundColor: 'white',
|
|
6413
|
+
backgroundColor: 'color.white',
|
|
6321
6414
|
transition: 'all 0.2s ease',
|
|
6322
6415
|
_hover: {
|
|
6323
6416
|
borderColor: 'color.gray.300'
|
|
@@ -6325,17 +6418,6 @@ var InputVariants = {
|
|
|
6325
6418
|
_focus: {
|
|
6326
6419
|
borderColor: 'theme.primary',
|
|
6327
6420
|
boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.2)'
|
|
6328
|
-
},
|
|
6329
|
-
'@media (prefers-color-scheme: dark)': {
|
|
6330
|
-
backgroundColor: 'color.gray.800',
|
|
6331
|
-
borderColor: 'color.gray.700',
|
|
6332
|
-
_hover: {
|
|
6333
|
-
borderColor: 'color.gray.600'
|
|
6334
|
-
},
|
|
6335
|
-
_focus: {
|
|
6336
|
-
borderColor: 'theme.primary',
|
|
6337
|
-
boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.4)'
|
|
6338
|
-
}
|
|
6339
6421
|
}
|
|
6340
6422
|
},
|
|
6341
6423
|
default: {
|
|
@@ -6344,23 +6426,13 @@ var InputVariants = {
|
|
|
6344
6426
|
borderBottomStyle: 'solid',
|
|
6345
6427
|
borderBottomColor: 'color.gray.200',
|
|
6346
6428
|
borderRadius: 0,
|
|
6347
|
-
backgroundColor: 'white',
|
|
6429
|
+
backgroundColor: 'color.white',
|
|
6348
6430
|
transition: 'all 0.2s ease',
|
|
6349
6431
|
_hover: {
|
|
6350
6432
|
borderBottomColor: 'color.gray.300'
|
|
6351
6433
|
},
|
|
6352
6434
|
_focus: {
|
|
6353
6435
|
borderBottomColor: 'theme.primary'
|
|
6354
|
-
},
|
|
6355
|
-
'@media (prefers-color-scheme: dark)': {
|
|
6356
|
-
backgroundColor: 'color.gray.800',
|
|
6357
|
-
borderBottomColor: 'color.gray.700',
|
|
6358
|
-
_hover: {
|
|
6359
|
-
borderBottomColor: 'color.gray.600'
|
|
6360
|
-
},
|
|
6361
|
-
_focus: {
|
|
6362
|
-
borderBottomColor: 'theme.primary'
|
|
6363
|
-
}
|
|
6364
6436
|
}
|
|
6365
6437
|
},
|
|
6366
6438
|
none: {
|
|
@@ -6492,7 +6564,7 @@ var HeadingSizes$1 = {
|
|
|
6492
6564
|
}
|
|
6493
6565
|
};
|
|
6494
6566
|
|
|
6495
|
-
var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
|
|
6567
|
+
var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size", "dropDown"];
|
|
6496
6568
|
var LabelView = _ref => {
|
|
6497
6569
|
var {
|
|
6498
6570
|
children,
|
|
@@ -6702,11 +6774,7 @@ var SelectBox = _ref2 => {
|
|
|
6702
6774
|
// State properties
|
|
6703
6775
|
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
6704
6776
|
// Animation
|
|
6705
|
-
transition: 'all 0.2s ease'
|
|
6706
|
-
// Dark mode support
|
|
6707
|
-
'@media (prefers-color-scheme: dark)': {
|
|
6708
|
-
color: isDisabled ? 'color.gray.600' : 'color.gray.100'
|
|
6709
|
-
}
|
|
6777
|
+
transition: 'all 0.2s ease'
|
|
6710
6778
|
}, views['field'], views['text']);
|
|
6711
6779
|
var option = options.length > 0 && options.find(option => option.value === value);
|
|
6712
6780
|
return /*#__PURE__*/React.createElement(Text, Object.assign({}, fieldStyles), (value === '' || Array.isArray(value) && value.length === 0) && !!placeholder ? placeholder : (/*#__PURE__*/React.createElement(React.Fragment, null, typeof value === 'string' ? (_ref3 = option && option.label) != null ? _ref3 : value :
|
|
@@ -6765,9 +6833,7 @@ var HiddenSelect = _ref4 => {
|
|
|
6765
6833
|
var DropDown = _ref5 => {
|
|
6766
6834
|
var {
|
|
6767
6835
|
size,
|
|
6768
|
-
views = {
|
|
6769
|
-
dropDown: {}
|
|
6770
|
-
},
|
|
6836
|
+
views = {},
|
|
6771
6837
|
options,
|
|
6772
6838
|
callback = () => {},
|
|
6773
6839
|
highlightedIndex,
|
|
@@ -6796,7 +6862,7 @@ var DropDown = _ref5 => {
|
|
|
6796
6862
|
,
|
|
6797
6863
|
overflowY: "auto",
|
|
6798
6864
|
zIndex: 1000,
|
|
6799
|
-
backgroundColor: "white",
|
|
6865
|
+
backgroundColor: "color.white",
|
|
6800
6866
|
borderRadius: "8px" // Consistent with design system (rounded-md)
|
|
6801
6867
|
,
|
|
6802
6868
|
borderWidth: "1px",
|
|
@@ -6817,7 +6883,7 @@ var DropDown = _ref5 => {
|
|
|
6817
6883
|
borderRadius: '4px'
|
|
6818
6884
|
}
|
|
6819
6885
|
}
|
|
6820
|
-
}, shadow, views
|
|
6886
|
+
}, shadow, views == null ? void 0 : views.dropDown), options.length > 0 && options.map((option, index) => (/*#__PURE__*/React.createElement(Item, Object.assign({
|
|
6821
6887
|
key: option.value,
|
|
6822
6888
|
size: size,
|
|
6823
6889
|
style: views['text'],
|
|
@@ -7127,7 +7193,7 @@ var ColorSchemes = {
|
|
|
7127
7193
|
}
|
|
7128
7194
|
};
|
|
7129
7195
|
|
|
7130
|
-
var _excluded$p = ["id", "name", "label", "inActiveChild", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
|
|
7196
|
+
var _excluded$p = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
|
|
7131
7197
|
var SwitchContent = props => /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
7132
7198
|
type: "checkbox"
|
|
7133
7199
|
}, props));
|
|
@@ -7505,7 +7571,9 @@ var TextFieldView = _ref => {
|
|
|
7505
7571
|
getColor,
|
|
7506
7572
|
themeMode
|
|
7507
7573
|
} = useTheme();
|
|
7508
|
-
var IconColor = getColor('color.blueGray.700',
|
|
7574
|
+
var IconColor = getColor('color.blueGray.700', {
|
|
7575
|
+
themeMode: elementMode ? elementMode : themeMode
|
|
7576
|
+
});
|
|
7509
7577
|
var showLabel = !!(isFocused && label);
|
|
7510
7578
|
/**
|
|
7511
7579
|
* Styles for the input field
|
|
@@ -7534,11 +7602,7 @@ var TextFieldView = _ref => {
|
|
|
7534
7602
|
// State properties
|
|
7535
7603
|
cursor: isDisabled ? 'not-allowed' : 'text',
|
|
7536
7604
|
// Animation
|
|
7537
|
-
transition: 'all 0.2s ease'
|
|
7538
|
-
// Dark mode support
|
|
7539
|
-
'@media (prefers-color-scheme: dark)': {
|
|
7540
|
-
color: isDisabled ? 'color.gray.600' : 'color.gray.100'
|
|
7541
|
-
}
|
|
7605
|
+
transition: 'all 0.2s ease'
|
|
7542
7606
|
}, views['field']);
|
|
7543
7607
|
var handleFocus = () => {
|
|
7544
7608
|
setIsFocused(true);
|
|
@@ -7695,19 +7759,19 @@ var VariantStyles = {
|
|
|
7695
7759
|
selected: {
|
|
7696
7760
|
backgroundColor: 'theme.primary',
|
|
7697
7761
|
borderColor: 'theme.primary',
|
|
7698
|
-
color: 'white'
|
|
7762
|
+
color: 'color.white'
|
|
7699
7763
|
},
|
|
7700
7764
|
unselected: {
|
|
7701
|
-
backgroundColor: '
|
|
7765
|
+
backgroundColor: 'color.white',
|
|
7702
7766
|
borderWidth: '2px',
|
|
7703
7767
|
borderStyle: 'solid',
|
|
7704
7768
|
borderColor: 'color.gray.300',
|
|
7705
|
-
color: '
|
|
7769
|
+
color: 'color.black'
|
|
7706
7770
|
},
|
|
7707
7771
|
indeterminate: {
|
|
7708
7772
|
backgroundColor: 'theme.primary',
|
|
7709
7773
|
borderColor: 'theme.primary',
|
|
7710
|
-
color: 'white'
|
|
7774
|
+
color: 'color.white'
|
|
7711
7775
|
}
|
|
7712
7776
|
};
|
|
7713
7777
|
/**
|
|
@@ -9441,7 +9505,7 @@ var DropDown$1 = _ref4 => {
|
|
|
9441
9505
|
borderRadius: 4,
|
|
9442
9506
|
position: "absolute",
|
|
9443
9507
|
flexDirection: "column",
|
|
9444
|
-
backgroundColor: "white",
|
|
9508
|
+
backgroundColor: "color.white",
|
|
9445
9509
|
boxShadow: "rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px"
|
|
9446
9510
|
}, views['dropDown']), options.map(option => (/*#__PURE__*/React.createElement(DropDownItem, Object.assign({
|
|
9447
9511
|
key: option.code,
|
|
@@ -9491,7 +9555,9 @@ var CountryPickerView = _ref5 => {
|
|
|
9491
9555
|
getColor,
|
|
9492
9556
|
themeMode
|
|
9493
9557
|
} = useTheme();
|
|
9494
|
-
var IconColor = getColor('color.blueGray.700',
|
|
9558
|
+
var IconColor = getColor('color.blueGray.700', {
|
|
9559
|
+
themeMode: elementMode ? elementMode : themeMode
|
|
9560
|
+
});
|
|
9495
9561
|
var handleHover = () => setIsHovered(!isHovered);
|
|
9496
9562
|
var handleFocus = () => setIsFocused(true);
|
|
9497
9563
|
var handleCallback = option => {
|
|
@@ -9519,8 +9585,8 @@ var CountryPickerView = _ref5 => {
|
|
|
9519
9585
|
var showLabel = !!(label && (isFocused || value));
|
|
9520
9586
|
var fieldStyles = Object.assign({
|
|
9521
9587
|
margin: 0,
|
|
9522
|
-
|
|
9523
|
-
|
|
9588
|
+
paddingVertical: 8,
|
|
9589
|
+
paddingHorizontal: 0,
|
|
9524
9590
|
width: '100%',
|
|
9525
9591
|
heigth: '100%',
|
|
9526
9592
|
border: 'none',
|
|
@@ -9868,7 +9934,7 @@ var ComboBoxView = _ref => {
|
|
|
9868
9934
|
position: "relative"
|
|
9869
9935
|
}, /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
9870
9936
|
cursor: "pointer",
|
|
9871
|
-
backgroundColor: "white",
|
|
9937
|
+
backgroundColor: "color.white",
|
|
9872
9938
|
boxShadow: "rgba(0, 0, 0, 0.16) 0px 1px 4px",
|
|
9873
9939
|
padding: "12px",
|
|
9874
9940
|
display: "flex",
|
|
@@ -9890,7 +9956,7 @@ var ComboBoxView = _ref => {
|
|
|
9890
9956
|
}, views == null ? void 0 : views.label), selectedItem.label)), right, isDropdownVisible && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
9891
9957
|
id: "combobox-dropdown",
|
|
9892
9958
|
position: "absolute",
|
|
9893
|
-
backgroundColor: "white",
|
|
9959
|
+
backgroundColor: "color.white",
|
|
9894
9960
|
boxShadow: "rgba(0, 0 ,0 ,0.16) 0px 1px 4px",
|
|
9895
9961
|
width: "100%",
|
|
9896
9962
|
overflowY: "auto",
|
|
@@ -9984,6 +10050,12 @@ var useOTPInputState = _ref => {
|
|
|
9984
10050
|
onChange,
|
|
9985
10051
|
onChangeText,
|
|
9986
10052
|
onComplete,
|
|
10053
|
+
onKeyDown,
|
|
10054
|
+
onKeyPress,
|
|
10055
|
+
onBlur,
|
|
10056
|
+
onFocus,
|
|
10057
|
+
isReadOnly,
|
|
10058
|
+
isDisabled,
|
|
9987
10059
|
pattern,
|
|
9988
10060
|
stepValues,
|
|
9989
10061
|
pasteTransformer
|
|
@@ -10097,6 +10169,16 @@ var useOTPInputState = _ref => {
|
|
|
10097
10169
|
var handleKeyDown = useCallback(_ => {
|
|
10098
10170
|
// Handle special keys like backspace, arrows, etc.
|
|
10099
10171
|
// This is handled by the browser for the single input
|
|
10172
|
+
if (onKeyDown) {
|
|
10173
|
+
onKeyDown(_);
|
|
10174
|
+
}
|
|
10175
|
+
}, []);
|
|
10176
|
+
var handleKeyPress = useCallback(e => {
|
|
10177
|
+
// Handle key press events
|
|
10178
|
+
// This is handled by the browser for the single input
|
|
10179
|
+
if (onKeyPress) {
|
|
10180
|
+
onKeyPress(e);
|
|
10181
|
+
}
|
|
10100
10182
|
}, []);
|
|
10101
10183
|
var handlePaste = useCallback(e => {
|
|
10102
10184
|
var input = inputRef.current;
|
|
@@ -10253,11 +10335,12 @@ var useOTPInputState = _ref => {
|
|
|
10253
10335
|
handleFocus,
|
|
10254
10336
|
handleBlur,
|
|
10255
10337
|
handleKeyDown,
|
|
10338
|
+
handleKeyPress,
|
|
10256
10339
|
handlePaste
|
|
10257
10340
|
};
|
|
10258
10341
|
};
|
|
10259
10342
|
|
|
10260
|
-
var _excluded$y = ["id", "name", "label", "value", "length", "onChange", "onChangeText", "onComplete", "helperText", "placeholder", "shadow", "views", "size", "shape", "variant", "gap", "type", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isAutoFocus", "setValue", "setIsFocused", "setIsHovered", "inputRef", "containerRef", "mirrorSelectionStart", "mirrorSelectionEnd", "setMirrorSelectionStart", "setMirrorSelectionEnd", "handlePaste", "handleChange", "handleFocus", "handleBlur", "handleKeyDown", "stepValues", "setInputRef", "onBlur", "onClick", "onFocus"];
|
|
10343
|
+
var _excluded$y = ["id", "name", "label", "value", "length", "onChange", "onChangeText", "onComplete", "helperText", "placeholder", "shadow", "views", "size", "shape", "variant", "gap", "type", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isAutoFocus", "setValue", "setIsFocused", "setIsHovered", "inputRef", "containerRef", "mirrorSelectionStart", "mirrorSelectionEnd", "setMirrorSelectionStart", "setMirrorSelectionEnd", "handlePaste", "handleChange", "handleFocus", "handleBlur", "handleKeyDown", "handleKeyPress", "secureTextEntry", "isFirstColumn", "stepValues", "setInputRef", "onBlur", "onClick", "onFocus"];
|
|
10261
10344
|
// Create a context for OTP input slots
|
|
10262
10345
|
var OTPInputContext = /*#__PURE__*/createContext({
|
|
10263
10346
|
slots: [],
|
|
@@ -10265,7 +10348,7 @@ var OTPInputContext = /*#__PURE__*/createContext({
|
|
|
10265
10348
|
isHovering: false
|
|
10266
10349
|
});
|
|
10267
10350
|
// CSS for noscript fallback
|
|
10268
|
-
var NOSCRIPT_CSS_FALLBACK = "\n@keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n}\n\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n
|
|
10351
|
+
var NOSCRIPT_CSS_FALLBACK = "\n@keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n}\n\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n";
|
|
10269
10352
|
// Helper function to safely insert CSS rules
|
|
10270
10353
|
function safeInsertRule(sheet, rule) {
|
|
10271
10354
|
try {
|
|
@@ -10513,7 +10596,8 @@ var OTPInputComponent = props => {
|
|
|
10513
10596
|
handleFocus,
|
|
10514
10597
|
handleBlur,
|
|
10515
10598
|
handleKeyDown,
|
|
10516
|
-
handlePaste
|
|
10599
|
+
handlePaste,
|
|
10600
|
+
handleKeyPress
|
|
10517
10601
|
} = useOTPInputState(props);
|
|
10518
10602
|
// Use the controlled value if it exists, otherwise use the internal state value
|
|
10519
10603
|
var displayValue = controlledValue !== undefined ? controlledValue : value;
|
|
@@ -10535,6 +10619,7 @@ var OTPInputComponent = props => {
|
|
|
10535
10619
|
handleFocus: handleFocus,
|
|
10536
10620
|
handleBlur: handleBlur,
|
|
10537
10621
|
handleKeyDown: handleKeyDown,
|
|
10622
|
+
handleKeyPress: handleKeyPress,
|
|
10538
10623
|
handlePaste: handlePaste,
|
|
10539
10624
|
stepValues: props.stepValues
|
|
10540
10625
|
}));
|
|
@@ -11088,7 +11173,7 @@ var OrientationStyles = {
|
|
|
11088
11173
|
}
|
|
11089
11174
|
};
|
|
11090
11175
|
|
|
11091
|
-
var _excluded$F = ["min", "max", "step", "currentValue", "stepValues", "shape", "size", "variant", "orientation", "isDisabled", "showValue", "showTooltip", "
|
|
11176
|
+
var _excluded$F = ["min", "max", "step", "currentValue", "stepValues", "shape", "size", "variant", "orientation", "isDisabled", "showValue", "showTooltip", "backgroundColor", "label", "helperText", "themeMode", "shadow", "isDragging", "isHovered", "setIsHovered", "trackRef", "thumbRef", "handleThumbMouseDown", "handleTrackMouseDown", "handleKeyDown", "thumbPositionPercent", "ariaLabel", "views"];
|
|
11092
11177
|
var SliderView = _ref => {
|
|
11093
11178
|
var _views$tooltip, _views$tooltip2;
|
|
11094
11179
|
var {
|
|
@@ -11104,7 +11189,7 @@ var SliderView = _ref => {
|
|
|
11104
11189
|
isDisabled = false,
|
|
11105
11190
|
showValue = false,
|
|
11106
11191
|
showTooltip = false,
|
|
11107
|
-
|
|
11192
|
+
backgroundColor = 'theme.primary',
|
|
11108
11193
|
label,
|
|
11109
11194
|
helperText,
|
|
11110
11195
|
themeMode: elementMode,
|
|
@@ -11136,9 +11221,15 @@ var SliderView = _ref => {
|
|
|
11136
11221
|
getColor,
|
|
11137
11222
|
themeMode
|
|
11138
11223
|
} = useTheme();
|
|
11139
|
-
var themeColor = getColor(
|
|
11140
|
-
|
|
11141
|
-
|
|
11224
|
+
var themeColor = getColor(backgroundColor, {
|
|
11225
|
+
themeMode: elementMode || themeMode
|
|
11226
|
+
});
|
|
11227
|
+
var disabledColor = getColor('theme.disabled', {
|
|
11228
|
+
themeMode: elementMode || themeMode
|
|
11229
|
+
});
|
|
11230
|
+
var trackColor = getColor(SliderVariants[variant].backgroundColor, {
|
|
11231
|
+
themeMode: elementMode || themeMode
|
|
11232
|
+
});
|
|
11142
11233
|
var isVertical = orientation === 'vertical';
|
|
11143
11234
|
var {
|
|
11144
11235
|
trackCrossAxisSize,
|
|
@@ -11208,7 +11299,7 @@ var SliderView = _ref => {
|
|
|
11208
11299
|
top: "50%",
|
|
11209
11300
|
left: thumbPositionPercent + "%",
|
|
11210
11301
|
borderRadius: "50%",
|
|
11211
|
-
backgroundColor: "white",
|
|
11302
|
+
backgroundColor: "color.white",
|
|
11212
11303
|
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
|
|
11213
11304
|
border: "2px solid " + (isDisabled ? disabledColor : themeColor),
|
|
11214
11305
|
transition: isDragging ? 'none' : 'transform 0.1s ease-in-out',
|
|
@@ -11952,12 +12043,12 @@ var UploadView = _ref => {
|
|
|
11952
12043
|
} = _ref;
|
|
11953
12044
|
var finalPreviewUrl = externalPreviewUrl || previewUrl;
|
|
11954
12045
|
// Debug log to help troubleshoot
|
|
11955
|
-
console.log('Uploader state:', {
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
});
|
|
12046
|
+
// console.log('Uploader state:', {
|
|
12047
|
+
// fileType,
|
|
12048
|
+
// finalPreviewUrl,
|
|
12049
|
+
// selectedFile: selectedFile?.name,
|
|
12050
|
+
// progress,
|
|
12051
|
+
// });
|
|
11961
12052
|
return /*#__PURE__*/React.createElement(Center, Object.assign({
|
|
11962
12053
|
onClick: handleClick,
|
|
11963
12054
|
cursor: "pointer",
|
|
@@ -12208,7 +12299,7 @@ var ModalTypography = {
|
|
|
12208
12299
|
};
|
|
12209
12300
|
|
|
12210
12301
|
var _excluded$H = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
|
|
12211
|
-
_excluded2$c = ["children", "shadow", "isFullScreen", "shape", "views"],
|
|
12302
|
+
_excluded2$c = ["children", "shadow", "isFullScreen", "shape", "views", "isOpen"],
|
|
12212
12303
|
_excluded3$9 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
|
|
12213
12304
|
_excluded4$7 = ["children", "views"],
|
|
12214
12305
|
_excluded5$3 = ["children", "views"];
|
|
@@ -12276,7 +12367,7 @@ var ModalContainer = _ref2 => {
|
|
|
12276
12367
|
};
|
|
12277
12368
|
return /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
12278
12369
|
cursor: "default",
|
|
12279
|
-
backgroundColor: "white",
|
|
12370
|
+
backgroundColor: "color.white",
|
|
12280
12371
|
width: isFullScreen ? '100%' : 600,
|
|
12281
12372
|
height: isFullScreen ? '100%' : 'fit-content',
|
|
12282
12373
|
onClick: handleClick,
|
|
@@ -13094,7 +13185,9 @@ var useTabsState = (propTabs, initialTabValue) => {
|
|
|
13094
13185
|
return foundTab;
|
|
13095
13186
|
}
|
|
13096
13187
|
// Warn if initialTabValue is provided but not found
|
|
13097
|
-
console.warn(
|
|
13188
|
+
// console.warn(
|
|
13189
|
+
// `Tabs: initialTabValue "${initialTabValue}" not found in tabs. Defaulting to the first tab.`
|
|
13190
|
+
// );
|
|
13098
13191
|
}
|
|
13099
13192
|
return propTabs[0]; // Default to the first tab
|
|
13100
13193
|
};
|
|
@@ -13681,7 +13774,7 @@ var DropdownMenuSizes = {
|
|
|
13681
13774
|
};
|
|
13682
13775
|
var DropdownMenuVariants = {
|
|
13683
13776
|
default: {
|
|
13684
|
-
backgroundColor: 'white',
|
|
13777
|
+
backgroundColor: 'color.white',
|
|
13685
13778
|
color: 'color.gray.800'
|
|
13686
13779
|
},
|
|
13687
13780
|
filled: {
|
|
@@ -13689,7 +13782,7 @@ var DropdownMenuVariants = {
|
|
|
13689
13782
|
color: 'color.gray.800'
|
|
13690
13783
|
},
|
|
13691
13784
|
outline: {
|
|
13692
|
-
backgroundColor: 'white',
|
|
13785
|
+
backgroundColor: 'color.white',
|
|
13693
13786
|
borderWidth: '1px',
|
|
13694
13787
|
borderStyle: 'solid',
|
|
13695
13788
|
borderColor: 'color.gray.200',
|
|
@@ -14569,7 +14662,7 @@ var MenubarContent = _ref5 => {
|
|
|
14569
14662
|
position: "absolute",
|
|
14570
14663
|
zIndex: 1000,
|
|
14571
14664
|
minWidth: "200px",
|
|
14572
|
-
backgroundColor: "white",
|
|
14665
|
+
backgroundColor: "color.white",
|
|
14573
14666
|
borderRadius: 4,
|
|
14574
14667
|
boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
|
|
14575
14668
|
overflow: "hidden"
|
|
@@ -14821,7 +14914,7 @@ var PaginationShapes = {
|
|
|
14821
14914
|
};
|
|
14822
14915
|
var ActivePageButtonStyles = {
|
|
14823
14916
|
backgroundColor: 'color.blue.500',
|
|
14824
|
-
color: 'white',
|
|
14917
|
+
color: 'color.white',
|
|
14825
14918
|
_hover: {
|
|
14826
14919
|
backgroundColor: 'color.blue.600'
|
|
14827
14920
|
}
|
|
@@ -14974,7 +15067,7 @@ var PaginationView = _ref => {
|
|
|
14974
15067
|
borderWidth: "1px",
|
|
14975
15068
|
borderStyle: "solid",
|
|
14976
15069
|
borderColor: "color.gray.200",
|
|
14977
|
-
backgroundColor: "white",
|
|
15070
|
+
backgroundColor: "color.white",
|
|
14978
15071
|
cursor: "pointer",
|
|
14979
15072
|
value: pageSize,
|
|
14980
15073
|
onChange: handlePageSizeChange
|
|
@@ -15250,7 +15343,7 @@ var SidebarSizes = {
|
|
|
15250
15343
|
var getSidebar = themeMode => {
|
|
15251
15344
|
return {
|
|
15252
15345
|
default: {
|
|
15253
|
-
backgroundColor: 'white',
|
|
15346
|
+
backgroundColor: 'color.white',
|
|
15254
15347
|
color: 'color.gray.800',
|
|
15255
15348
|
transition: 'all 0.2s ease'
|
|
15256
15349
|
},
|
|
@@ -15260,7 +15353,7 @@ var getSidebar = themeMode => {
|
|
|
15260
15353
|
transition: 'all 0.2s ease'
|
|
15261
15354
|
},
|
|
15262
15355
|
outline: {
|
|
15263
|
-
backgroundColor: 'white',
|
|
15356
|
+
backgroundColor: 'color.white',
|
|
15264
15357
|
borderWidth: '1px',
|
|
15265
15358
|
borderStyle: 'solid',
|
|
15266
15359
|
borderColor: 'color.gray.200',
|
|
@@ -15273,7 +15366,7 @@ var getSidebar = themeMode => {
|
|
|
15273
15366
|
transition: 'all 0.2s ease'
|
|
15274
15367
|
},
|
|
15275
15368
|
elevated: {
|
|
15276
|
-
backgroundColor: 'white',
|
|
15369
|
+
backgroundColor: 'color.white',
|
|
15277
15370
|
boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1)',
|
|
15278
15371
|
color: 'color.gray.800',
|
|
15279
15372
|
transition: 'all 0.2s ease'
|
|
@@ -16002,7 +16095,7 @@ var HandleIconStyles = {
|
|
|
16002
16095
|
|
|
16003
16096
|
var _excluded$X = ["children", "id", "defaultSize", "minSize", "maxSize", "collapsible", "defaultCollapsed", "onCollapseChange", "views"],
|
|
16004
16097
|
_excluded2$g = ["id", "position", "disabled", "withVisualIndicator", "withCollapseButton", "collapseTarget", "views"],
|
|
16005
|
-
_excluded3$c = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "views"];
|
|
16098
|
+
_excluded3$c = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "autoSaveId", "views"];
|
|
16006
16099
|
// Create context for the Resizable component
|
|
16007
16100
|
var ResizableContext = /*#__PURE__*/createContext({
|
|
16008
16101
|
orientation: 'horizontal',
|
|
@@ -16798,6 +16891,16 @@ var Toast = /*#__PURE__*/Object.assign(ToastComponent, {
|
|
|
16798
16891
|
// Export the hook for component usage
|
|
16799
16892
|
var useToast$1 = useToast;
|
|
16800
16893
|
|
|
16894
|
+
// Default filter function defined outside the hook to avoid recreating it on each render
|
|
16895
|
+
var defaultFilterFn = (value, item) => {
|
|
16896
|
+
var _item$description, _item$keywords;
|
|
16897
|
+
if (!value) return true;
|
|
16898
|
+
var searchValue = value.toLowerCase();
|
|
16899
|
+
var matchesName = item.name.toLowerCase().includes(searchValue);
|
|
16900
|
+
var matchesDescription = ((_item$description = item.description) == null ? void 0 : _item$description.toLowerCase().includes(searchValue)) || false;
|
|
16901
|
+
var matchesKeywords = ((_item$keywords = item.keywords) == null ? void 0 : _item$keywords.some(keyword => keyword.toLowerCase().includes(searchValue))) || false;
|
|
16902
|
+
return matchesName || matchesDescription || matchesKeywords;
|
|
16903
|
+
};
|
|
16801
16904
|
var useCommandState = _ref => {
|
|
16802
16905
|
var {
|
|
16803
16906
|
open,
|
|
@@ -16806,46 +16909,36 @@ var useCommandState = _ref => {
|
|
|
16806
16909
|
commands = [],
|
|
16807
16910
|
filter
|
|
16808
16911
|
} = _ref;
|
|
16809
|
-
// Combine commands from groups and flat list
|
|
16810
|
-
var allCommands = useCallback(() => {
|
|
16811
|
-
var groupCommands = groups.flatMap(group => group.commands);
|
|
16812
|
-
return [...groupCommands, ...commands];
|
|
16813
|
-
}, [groups, commands]);
|
|
16814
16912
|
// State for search input
|
|
16815
16913
|
var [search, setSearch] = useState('');
|
|
16816
16914
|
// State for selected item index
|
|
16817
16915
|
var [selectedIndex, setSelectedIndex] = useState(0);
|
|
16818
16916
|
// Ref for the command list element
|
|
16819
16917
|
var listRef = useRef(null);
|
|
16820
|
-
//
|
|
16821
|
-
var
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
var
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
}, [allCommands, filter, defaultFilter]);
|
|
16835
|
-
// Filtered commands based on search
|
|
16836
|
-
var [filteredCommands, setFilteredCommands] = useState(allCommands());
|
|
16837
|
-
// Filtered groups based on search
|
|
16838
|
-
var filteredGroups = useCallback(() => {
|
|
16918
|
+
// Use the provided filter or fall back to the default
|
|
16919
|
+
var filterFn = useMemo(() => filter || defaultFilterFn, [filter]);
|
|
16920
|
+
// Combine and memoize all commands from groups and flat list
|
|
16921
|
+
var allCommands = useMemo(() => {
|
|
16922
|
+
var groupCommands = groups.flatMap(group => group.commands);
|
|
16923
|
+
return [...groupCommands, ...commands];
|
|
16924
|
+
}, [groups, commands]);
|
|
16925
|
+
// Filter and memoize commands based on search
|
|
16926
|
+
var filteredCommands = useMemo(() => {
|
|
16927
|
+
if (!search.trim()) return allCommands;
|
|
16928
|
+
return allCommands.filter(item => filterFn(search, item));
|
|
16929
|
+
}, [allCommands, search, filterFn]);
|
|
16930
|
+
// Filter and memoize groups based on search
|
|
16931
|
+
var filteredGroups = useMemo(() => {
|
|
16839
16932
|
if (!search) return groups;
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16933
|
+
var filterFn = filter || defaultFilterFn;
|
|
16934
|
+
return groups.map(g => Object.assign({}, g, {
|
|
16935
|
+
commands: g.commands.filter(c => filterFn(search, c))
|
|
16936
|
+
})).filter(g => g.commands.length);
|
|
16937
|
+
}, [groups, search, filter]);
|
|
16938
|
+
// Reset selected index when filtered commands change
|
|
16845
16939
|
useEffect(() => {
|
|
16846
|
-
setFilteredCommands(filterCommands(search));
|
|
16847
16940
|
setSelectedIndex(0);
|
|
16848
|
-
}, [
|
|
16941
|
+
}, [filteredCommands.length]);
|
|
16849
16942
|
// Handle keyboard navigation
|
|
16850
16943
|
var handleKeyDown = useCallback(e => {
|
|
16851
16944
|
if (!open) return;
|
|
@@ -16895,6 +16988,9 @@ var useCommandState = _ref => {
|
|
|
16895
16988
|
useEffect(() => {
|
|
16896
16989
|
if (open) {
|
|
16897
16990
|
setSelectedIndex(0);
|
|
16991
|
+
} else {
|
|
16992
|
+
// Clear search when closed
|
|
16993
|
+
setSearch('');
|
|
16898
16994
|
}
|
|
16899
16995
|
}, [open]);
|
|
16900
16996
|
return {
|
|
@@ -16903,7 +16999,7 @@ var useCommandState = _ref => {
|
|
|
16903
16999
|
selectedIndex,
|
|
16904
17000
|
setSelectedIndex,
|
|
16905
17001
|
filteredCommands,
|
|
16906
|
-
filteredGroups
|
|
17002
|
+
filteredGroups,
|
|
16907
17003
|
listRef
|
|
16908
17004
|
};
|
|
16909
17005
|
};
|
|
@@ -16925,7 +17021,7 @@ var CommandSizes = {
|
|
|
16925
17021
|
var getCommand = themeMode => {
|
|
16926
17022
|
return {
|
|
16927
17023
|
default: {
|
|
16928
|
-
backgroundColor: 'white',
|
|
17024
|
+
backgroundColor: 'color.white',
|
|
16929
17025
|
borderWidth: '1px',
|
|
16930
17026
|
borderStyle: 'solid',
|
|
16931
17027
|
borderColor: 'color.gray.200',
|
|
@@ -16939,7 +17035,7 @@ var getCommand = themeMode => {
|
|
|
16939
17035
|
boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)'
|
|
16940
17036
|
},
|
|
16941
17037
|
outline: {
|
|
16942
|
-
backgroundColor: 'white',
|
|
17038
|
+
backgroundColor: 'color.white',
|
|
16943
17039
|
borderWidth: '2px',
|
|
16944
17040
|
borderStyle: 'solid',
|
|
16945
17041
|
borderColor: 'color.gray.300',
|
|
@@ -17172,26 +17268,21 @@ var CommandView = _ref7 => {
|
|
|
17172
17268
|
} = _ref7,
|
|
17173
17269
|
props = _objectWithoutPropertiesLoose(_ref7, _excluded6$3);
|
|
17174
17270
|
if (!open) return null;
|
|
17175
|
-
var handleItemSelect = item => {
|
|
17176
|
-
if (
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
var
|
|
17183
|
-
if (e.target === e.currentTarget) {
|
|
17184
|
-
onOpenChange(false);
|
|
17185
|
-
}
|
|
17186
|
-
};
|
|
17187
|
-
var contextValue = {
|
|
17271
|
+
var handleItemSelect = React.useCallback(item => {
|
|
17272
|
+
if (item.disabled) return;
|
|
17273
|
+
item.onSelect();
|
|
17274
|
+
onOpenChange(false);
|
|
17275
|
+
setSearch('');
|
|
17276
|
+
}, [onOpenChange, setSearch]);
|
|
17277
|
+
var handleBackdropClick = React.useCallback(e => e.target === e.currentTarget && onOpenChange(false), [onOpenChange]);
|
|
17278
|
+
var contextValue = React.useMemo(() => ({
|
|
17188
17279
|
search,
|
|
17189
17280
|
setSearch,
|
|
17190
17281
|
selectedIndex,
|
|
17191
17282
|
setSelectedIndex,
|
|
17192
17283
|
filteredCommands,
|
|
17193
17284
|
onSelect: handleItemSelect
|
|
17194
|
-
};
|
|
17285
|
+
}), [search, selectedIndex, filteredCommands, handleItemSelect, setSearch, setSelectedIndex]);
|
|
17195
17286
|
var hasGroups = groups.length > 0;
|
|
17196
17287
|
// const hasCommands = commands.length > 0;
|
|
17197
17288
|
var isEmpty = filteredCommands.length === 0;
|