@app-studio/web 0.9.63 → 0.9.66
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 +4 -1
- package/dist/components/Button/Button/Button.style.d.ts +1 -1
- package/dist/components/Title/Title/SlideEffect.d.ts +2 -1
- package/dist/components/Title/Title/Title.props.d.ts +5 -0
- package/dist/components/Title/Title/TypewriterEffect.d.ts +1 -0
- package/dist/web.cjs.development.js +385 -306
- 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 +385 -306
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +385 -306
- 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/docs/components/ChatInput.mdx +489 -8
- package/package.json +2 -2
- package/dist/components/Title/Title/useInView.d.ts +0 -9
package/dist/web.esm.js
CHANGED
|
@@ -3093,14 +3093,14 @@ var AlertView = _ref => {
|
|
|
3093
3093
|
,
|
|
3094
3094
|
lineHeight: "24px",
|
|
3095
3095
|
color: themes[variant].content.color,
|
|
3096
|
-
|
|
3096
|
+
backgroundColor: themes[variant].container.backgroundColor
|
|
3097
3097
|
}, views == null ? void 0 : views.title), title), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3098
3098
|
fontSize: "14px",
|
|
3099
3099
|
fontWeight: "400" // Regular
|
|
3100
3100
|
,
|
|
3101
3101
|
lineHeight: "20px",
|
|
3102
3102
|
color: themes[variant].content.color,
|
|
3103
|
-
|
|
3103
|
+
backgroundColor: themes[variant].container.backgroundColor
|
|
3104
3104
|
}, views == null ? void 0 : views.description), description || children)));
|
|
3105
3105
|
};
|
|
3106
3106
|
|
|
@@ -3423,16 +3423,16 @@ var MessageView = _ref => {
|
|
|
3423
3423
|
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3424
3424
|
size: "md",
|
|
3425
3425
|
weight: "semiBold",
|
|
3426
|
-
|
|
3426
|
+
backgroundColor: Theme[variant].container.backgroundColor
|
|
3427
3427
|
}, views == null ? void 0 : views.title), title), subtitle && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3428
3428
|
size: "sm",
|
|
3429
|
-
|
|
3429
|
+
backgroundColor: Theme[variant].container.backgroundColor
|
|
3430
3430
|
}, views == null ? void 0 : views.subtitle), subtitle))), showAction && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3431
3431
|
marginRight: 10,
|
|
3432
3432
|
onClick: action,
|
|
3433
3433
|
padding: "6px 10px",
|
|
3434
3434
|
whiteSpace: "nowrap",
|
|
3435
|
-
|
|
3435
|
+
backgroundColor: Theme[variant].container.backgroundColor
|
|
3436
3436
|
}, containerStyle, views == null ? void 0 : views.actionText), actionText)), isClosable && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
3437
3437
|
position: "absolute",
|
|
3438
3438
|
zIndex: 10000,
|
|
@@ -4790,6 +4790,11 @@ var LoaderView = _ref4 => {
|
|
|
4790
4790
|
views
|
|
4791
4791
|
} = _ref4,
|
|
4792
4792
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$2);
|
|
4793
|
+
var {
|
|
4794
|
+
getColor
|
|
4795
|
+
} = useTheme();
|
|
4796
|
+
loaderColor = getColor(loaderColor || props.color || 'theme.loading');
|
|
4797
|
+
textColor = getColor(textColor || props.color || 'theme.loading');
|
|
4793
4798
|
var style = {
|
|
4794
4799
|
size,
|
|
4795
4800
|
speed,
|
|
@@ -4903,12 +4908,19 @@ var IconSizes$1 = {
|
|
|
4903
4908
|
padding: 14
|
|
4904
4909
|
}
|
|
4905
4910
|
};
|
|
4906
|
-
var getButtonVariants = function getButtonVariants(color, isLight,
|
|
4911
|
+
var getButtonVariants = function getButtonVariants(color, isLight, reversed) {
|
|
4912
|
+
if (reversed === void 0) {
|
|
4913
|
+
reversed = false;
|
|
4914
|
+
}
|
|
4907
4915
|
var textColor = isLight ? '#000000' : '#FFFFFF';
|
|
4916
|
+
// Determine effective colors based on reversed state
|
|
4917
|
+
var effectiveBg = reversed ? textColor : color;
|
|
4918
|
+
var effectiveContent = reversed ? color : textColor;
|
|
4919
|
+
var effectiveBorder = reversed ? textColor : color;
|
|
4908
4920
|
return {
|
|
4909
4921
|
filled: {
|
|
4910
|
-
backgroundColor:
|
|
4911
|
-
color:
|
|
4922
|
+
backgroundColor: effectiveBg,
|
|
4923
|
+
color: effectiveContent,
|
|
4912
4924
|
borderWidth: 1,
|
|
4913
4925
|
borderStyle: 'solid',
|
|
4914
4926
|
borderColor: 'transparent',
|
|
@@ -4920,57 +4932,57 @@ var getButtonVariants = function getButtonVariants(color, isLight, isThemeLight)
|
|
|
4920
4932
|
},
|
|
4921
4933
|
_focusVisible: {
|
|
4922
4934
|
outline: 'none',
|
|
4923
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
4935
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBg
|
|
4924
4936
|
},
|
|
4925
4937
|
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
4926
4938
|
},
|
|
4927
|
-
|
|
4928
|
-
backgroundColor:
|
|
4929
|
-
color:
|
|
4939
|
+
empty: {
|
|
4940
|
+
backgroundColor: 'transparent',
|
|
4941
|
+
color: effectiveBorder,
|
|
4930
4942
|
borderWidth: 1,
|
|
4931
4943
|
borderStyle: 'solid',
|
|
4932
|
-
borderColor:
|
|
4944
|
+
borderColor: effectiveBorder,
|
|
4933
4945
|
_hover: {
|
|
4934
4946
|
opacity: 0.9
|
|
4935
4947
|
},
|
|
4936
4948
|
_active: {
|
|
4937
4949
|
opacity: 0.95
|
|
4938
4950
|
},
|
|
4951
|
+
_focusVisible: {
|
|
4952
|
+
outline: 'none',
|
|
4953
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
4954
|
+
},
|
|
4939
4955
|
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
4940
4956
|
},
|
|
4941
4957
|
outline: {
|
|
4942
4958
|
backgroundColor: 'transparent',
|
|
4943
|
-
color:
|
|
4959
|
+
color: effectiveBorder,
|
|
4944
4960
|
borderWidth: 1,
|
|
4945
4961
|
borderStyle: 'solid',
|
|
4946
|
-
borderColor:
|
|
4962
|
+
borderColor: effectiveBorder,
|
|
4947
4963
|
_hover: {
|
|
4948
|
-
backgroundColor: color,
|
|
4949
|
-
color: textColor,
|
|
4950
4964
|
opacity: 0.9
|
|
4951
4965
|
},
|
|
4952
4966
|
_active: {
|
|
4953
|
-
backgroundColor: color,
|
|
4954
|
-
color: textColor,
|
|
4955
4967
|
opacity: 0.95
|
|
4956
4968
|
},
|
|
4957
4969
|
_focusVisible: {
|
|
4958
4970
|
outline: 'none',
|
|
4959
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
4971
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
4960
4972
|
},
|
|
4961
4973
|
transition: 'background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease'
|
|
4962
4974
|
},
|
|
4963
4975
|
ghost: {
|
|
4964
4976
|
backgroundColor: 'transparent',
|
|
4965
|
-
color:
|
|
4977
|
+
color: effectiveBorder,
|
|
4966
4978
|
borderWidth: 1,
|
|
4967
4979
|
borderStyle: 'solid',
|
|
4968
4980
|
borderColor: 'transparent',
|
|
4969
4981
|
_hover: {
|
|
4970
4982
|
borderWidth: 1,
|
|
4971
4983
|
borderStyle: 'solid',
|
|
4972
|
-
borderColor:
|
|
4973
|
-
color:
|
|
4984
|
+
borderColor: effectiveBorder,
|
|
4985
|
+
color: effectiveBorder,
|
|
4974
4986
|
opacity: 0.9
|
|
4975
4987
|
},
|
|
4976
4988
|
_active: {
|
|
@@ -4978,20 +4990,20 @@ var getButtonVariants = function getButtonVariants(color, isLight, isThemeLight)
|
|
|
4978
4990
|
},
|
|
4979
4991
|
_focusVisible: {
|
|
4980
4992
|
outline: 'none',
|
|
4981
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
4993
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
4982
4994
|
},
|
|
4983
4995
|
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
4984
4996
|
},
|
|
4985
4997
|
link: {
|
|
4986
4998
|
backgroundColor: 'transparent',
|
|
4987
|
-
color:
|
|
4999
|
+
color: effectiveBorder,
|
|
4988
5000
|
borderWidth: 0,
|
|
4989
5001
|
borderStyle: 'none',
|
|
4990
5002
|
borderColor: 'transparent',
|
|
4991
5003
|
textDecoration: 'underline',
|
|
4992
5004
|
textUnderlineOffset: '2px',
|
|
4993
5005
|
textDecorationThickness: '1px',
|
|
4994
|
-
textDecorationColor:
|
|
5006
|
+
textDecorationColor: effectiveBorder,
|
|
4995
5007
|
_hover: {
|
|
4996
5008
|
opacity: 0.8
|
|
4997
5009
|
},
|
|
@@ -5000,83 +5012,35 @@ var getButtonVariants = function getButtonVariants(color, isLight, isThemeLight)
|
|
|
5000
5012
|
},
|
|
5001
5013
|
_focusVisible: {
|
|
5002
5014
|
outline: 'none',
|
|
5003
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
5004
|
-
},
|
|
5005
|
-
transition: 'opacity 0.2s ease'
|
|
5006
|
-
},
|
|
5007
|
-
borderMoving: {
|
|
5008
|
-
position: 'relative',
|
|
5009
|
-
backgroundColor: 'black',
|
|
5010
|
-
color: textColor,
|
|
5011
|
-
overflow: 'hidden',
|
|
5012
|
-
borderWidth: 0,
|
|
5013
|
-
borderStyle: 'none',
|
|
5014
|
-
borderColor: 'transparent',
|
|
5015
|
-
_hover: {
|
|
5016
|
-
color: textColor
|
|
5017
|
-
},
|
|
5018
|
-
_active: {
|
|
5019
|
-
color: textColor
|
|
5020
|
-
},
|
|
5021
|
-
_focusVisible: {
|
|
5022
|
-
outline: 'none',
|
|
5023
|
-
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.8)'
|
|
5024
|
-
},
|
|
5025
|
-
transition: 'opacity 0.2s ease'
|
|
5026
|
-
},
|
|
5027
|
-
animatedStroke: {
|
|
5028
|
-
display: 'inline-block',
|
|
5029
|
-
margin: '0 auto',
|
|
5030
|
-
textAlign: 'center',
|
|
5031
|
-
textDecoration: 'none',
|
|
5032
|
-
position: 'relative',
|
|
5033
|
-
cursor: 'pointer',
|
|
5034
|
-
backgroundColor: 'transparent',
|
|
5035
|
-
color: color,
|
|
5036
|
-
borderWidth: 0,
|
|
5037
|
-
borderStyle: 'none',
|
|
5038
|
-
borderColor: 'transparent',
|
|
5039
|
-
_hover: {
|
|
5040
|
-
color: color
|
|
5041
|
-
},
|
|
5042
|
-
_active: {
|
|
5043
|
-
color: color
|
|
5044
|
-
},
|
|
5045
|
-
_focusVisible: {
|
|
5046
|
-
outline: 'none',
|
|
5047
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5015
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
5048
5016
|
},
|
|
5049
5017
|
transition: 'opacity 0.2s ease'
|
|
5050
5018
|
},
|
|
5051
5019
|
subtle: {
|
|
5052
|
-
backgroundColor:
|
|
5053
|
-
color:
|
|
5020
|
+
backgroundColor: reversed ? "color-mix(in srgb, " + effectiveBorder + " 20%, transparent)" : "color-mix(in srgb, " + effectiveBorder + " 5%, transparent)",
|
|
5021
|
+
color: effectiveBorder,
|
|
5054
5022
|
borderWidth: 1,
|
|
5055
5023
|
borderStyle: 'solid',
|
|
5056
|
-
borderColor:
|
|
5057
|
-
paddingHorizontal: 12,
|
|
5058
|
-
paddingVertical: 6,
|
|
5059
|
-
borderRadius: 6,
|
|
5060
|
-
fontWeight: 500,
|
|
5024
|
+
borderColor: effectiveBorder,
|
|
5061
5025
|
_hover: {
|
|
5062
|
-
backgroundColor:
|
|
5026
|
+
backgroundColor: reversed ? "color-mix(in srgb, " + effectiveBorder + " 40%, transparent)" : "color-mix(in srgb, " + effectiveBorder + " 15%, transparent)"
|
|
5063
5027
|
},
|
|
5064
5028
|
_active: {
|
|
5065
|
-
backgroundColor: 'rgba(0, 0, 0, 0.
|
|
5029
|
+
backgroundColor: reversed ? 'rgba(255, 255, 255, 0.3)' : 'rgba(0, 0, 0, 0.15)'
|
|
5066
5030
|
},
|
|
5067
5031
|
_focusVisible: {
|
|
5068
5032
|
outline: 'none',
|
|
5069
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
5033
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
5070
5034
|
},
|
|
5071
5035
|
transition: 'all 0.2s ease'
|
|
5072
5036
|
}
|
|
5073
5037
|
};
|
|
5074
5038
|
};
|
|
5075
5039
|
|
|
5076
|
-
var _excluded$d = ["
|
|
5077
|
-
_excluded2$3 = ["
|
|
5078
|
-
_excluded3$3 = ["variant", "to", "isDisabled", "isLoading", "isAuto", "isFilled", "isExternal", "shape", "shadow", "onClick", "views", "baseStyles", "sizeStyles", "iconPad", "resolvedTextColor", "content", "size"],
|
|
5079
|
-
_excluded4$3 = ["variant", "size", "shape", "iconPosition", "loaderPosition", "backgroundColor", "color", "isAuto", "isFilled", "isDisabled", "isLoading", "isIconRounded", "icon", "children", "to", "isExternal", "shadow", "onClick", "views", "
|
|
5040
|
+
var _excluded$d = ["asComponent", "isDisabled", "isLoading", "isWrapped", "borderRadius", "width", "height", "baseStyles", "sizeStyles", "iconPad", "mainTone", "resolvedTextColor", "children", "borderWidth"],
|
|
5041
|
+
_excluded2$3 = ["shape", "isDisabled", "onClick", "shadow", "borderWidth", "isAuto", "isFilled", "views", "children"],
|
|
5042
|
+
_excluded3$3 = ["variant", "animation", "to", "isDisabled", "isLoading", "isAuto", "isFilled", "isExternal", "shape", "shadow", "onClick", "views", "baseStyles", "sizeStyles", "iconPad", "resolvedTextColor", "content", "size", "mainTone", "tone", "borderMovingDuration", "borderMovingGradientColors", "animatedStrokeAccentColor", "animatedStrokeTextColor", "getColor"],
|
|
5043
|
+
_excluded4$3 = ["variant", "size", "shape", "iconPosition", "loaderPosition", "backgroundColor", "color", "scheme", "reversed", "isAuto", "isFilled", "isDisabled", "isLoading", "isIconRounded", "icon", "children", "to", "isExternal", "shadow", "onClick", "views", "borderMovingDuration", "borderMovingGradientColors", "animatedStrokeAccentColor", "animatedStrokeTextColor"];
|
|
5080
5044
|
// --- Helper: Button Content ---
|
|
5081
5045
|
// Renders the inner content: Loader, Icon, and Children.
|
|
5082
5046
|
var ButtonContent = _ref => {
|
|
@@ -5100,176 +5064,95 @@ var ButtonContent = _ref => {
|
|
|
5100
5064
|
justifyContent: "center"
|
|
5101
5065
|
}, sizeStyles, iconPad, views == null ? void 0 : views.content), isLoading && loaderPosition === 'left' && (/*#__PURE__*/React.createElement(Loader, Object.assign({
|
|
5102
5066
|
size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
|
|
5103
|
-
color:
|
|
5067
|
+
color: resolvedTextColor
|
|
5104
5068
|
}, views == null ? void 0 : views.loader))), icon && ['left', 'top'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
5105
|
-
color:
|
|
5069
|
+
color: resolvedTextColor
|
|
5106
5070
|
}, views == null ? void 0 : views.icon), icon)), children, icon && ['right', 'bottom'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
5107
|
-
color:
|
|
5071
|
+
color: resolvedTextColor
|
|
5108
5072
|
}, views == null ? void 0 : views.icon), icon)), isLoading && loaderPosition === 'right' && (/*#__PURE__*/React.createElement(Loader, Object.assign({
|
|
5109
5073
|
size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
|
|
5110
|
-
color:
|
|
5074
|
+
color: resolvedTextColor
|
|
5111
5075
|
}, views == null ? void 0 : views.loader))));
|
|
5112
5076
|
};
|
|
5113
|
-
// ---
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5077
|
+
// --- Animation Logic moved to StandardButton ---
|
|
5078
|
+
// --- Variant: Standard Button ---
|
|
5079
|
+
// --- Helpers ---
|
|
5080
|
+
// Helper to calculate numeric border radius
|
|
5081
|
+
var getNumericBorderRadius = shape => {
|
|
5082
|
+
var shapeValue = ButtonShapes[shape];
|
|
5083
|
+
if (typeof shapeValue === 'number') return shapeValue;
|
|
5084
|
+
if (typeof shapeValue === 'string') return parseInt(shapeValue, 10) || 0;
|
|
5085
|
+
return 0;
|
|
5086
|
+
};
|
|
5087
|
+
// Common Inner Button Surface
|
|
5088
|
+
var InnerButton = _ref2 => {
|
|
5089
|
+
var {
|
|
5090
|
+
asComponent,
|
|
5118
5091
|
isDisabled,
|
|
5119
|
-
|
|
5120
|
-
|
|
5092
|
+
isLoading,
|
|
5093
|
+
isWrapped = false,
|
|
5094
|
+
borderRadius,
|
|
5095
|
+
width,
|
|
5096
|
+
height,
|
|
5097
|
+
baseStyles,
|
|
5098
|
+
sizeStyles,
|
|
5099
|
+
iconPad,
|
|
5121
5100
|
mainTone,
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
content,
|
|
5126
|
-
shadow
|
|
5101
|
+
resolvedTextColor,
|
|
5102
|
+
children,
|
|
5103
|
+
borderWidth = 0
|
|
5127
5104
|
} = _ref2,
|
|
5128
5105
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded$d);
|
|
5129
|
-
var sizeStyles = ButtonSizes[size];
|
|
5130
|
-
var borderWidth = 3;
|
|
5131
|
-
var numericWidth = typeof sizeStyles.width === 'number' ? sizeStyles.width : 300;
|
|
5132
|
-
var numericHeight = typeof sizeStyles.height === 'number' ? sizeStyles.height : 64;
|
|
5133
|
-
var numericBorderRadius = (() => {
|
|
5134
|
-
var shapeValue = ButtonShapes[shape];
|
|
5135
|
-
if (typeof shapeValue === 'number') {
|
|
5136
|
-
return shapeValue;
|
|
5137
|
-
}
|
|
5138
|
-
if (typeof shapeValue === 'string') {
|
|
5139
|
-
return parseInt(shapeValue, 10) || 50;
|
|
5140
|
-
}
|
|
5141
|
-
return 50;
|
|
5142
|
-
})();
|
|
5143
|
-
var containerBg = mainTone;
|
|
5144
|
-
// Use high contrast text color for this variant
|
|
5145
|
-
var borderMovingTextColor = tone === 'light' ? '#000000' : '#FFFFFF';
|
|
5146
|
-
// Create gradient string for border animation
|
|
5147
|
-
var gradientColors = borderMovingGradientColors.join(', ');
|
|
5148
|
-
// Animation sequence for the moving border effect
|
|
5149
|
-
var borderAnimation = {
|
|
5150
|
-
from: {
|
|
5151
|
-
backgroundPosition: '0% 50%'
|
|
5152
|
-
},
|
|
5153
|
-
to: {
|
|
5154
|
-
backgroundPosition: '200% 50%'
|
|
5155
|
-
},
|
|
5156
|
-
duration: borderMovingDuration + "s",
|
|
5157
|
-
timingFunction: 'linear',
|
|
5158
|
-
iterationCount: 'infinite'
|
|
5159
|
-
};
|
|
5160
5106
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
5161
|
-
|
|
5162
|
-
|
|
5107
|
+
as: asComponent,
|
|
5108
|
+
disabled: Boolean(isDisabled || isLoading),
|
|
5109
|
+
display: isWrapped ? 'flex' : 'inline-flex',
|
|
5163
5110
|
alignItems: "center",
|
|
5164
5111
|
justifyContent: "center",
|
|
5165
|
-
borderRadius:
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
alignItems: "center",
|
|
5176
|
-
justifyContent: "center",
|
|
5177
|
-
backgroundColor: containerBg,
|
|
5178
|
-
borderRadius: Math.max(0, numericBorderRadius - borderWidth),
|
|
5179
|
-
width: "100%",
|
|
5180
|
-
height: "100%",
|
|
5181
|
-
minWidth: numericWidth - borderWidth * 2,
|
|
5182
|
-
minHeight: numericHeight - borderWidth * 2,
|
|
5183
|
-
color: borderMovingTextColor,
|
|
5184
|
-
fontSize: 14,
|
|
5185
|
-
cursor: "pointer"
|
|
5186
|
-
}, content));
|
|
5112
|
+
borderRadius: borderRadius,
|
|
5113
|
+
width: width,
|
|
5114
|
+
height: height
|
|
5115
|
+
}, baseStyles, sizeStyles, iconPad, {
|
|
5116
|
+
// Ensure background is solid for wrapped buttons if baseStyles doesn't provide it
|
|
5117
|
+
backgroundColor: (baseStyles == null ? void 0 : baseStyles.backgroundColor) || (isWrapped ? mainTone : undefined),
|
|
5118
|
+
color: resolvedTextColor,
|
|
5119
|
+
borderWidth: isWrapped ? 0 : undefined,
|
|
5120
|
+
cursor: isDisabled ? 'default' : 'pointer'
|
|
5121
|
+
}, props), children);
|
|
5187
5122
|
};
|
|
5188
|
-
//
|
|
5189
|
-
var
|
|
5123
|
+
// Common Header for Border Animations
|
|
5124
|
+
var BorderWrapper = _ref3 => {
|
|
5190
5125
|
var {
|
|
5191
|
-
|
|
5126
|
+
shape,
|
|
5127
|
+
isDisabled,
|
|
5192
5128
|
onClick,
|
|
5129
|
+
shadow,
|
|
5130
|
+
borderWidth,
|
|
5131
|
+
isAuto,
|
|
5132
|
+
isFilled,
|
|
5193
5133
|
views,
|
|
5194
|
-
children
|
|
5195
|
-
size = 'md',
|
|
5196
|
-
accentColor,
|
|
5197
|
-
textColor,
|
|
5198
|
-
getColor,
|
|
5199
|
-
shadow
|
|
5134
|
+
children
|
|
5200
5135
|
} = _ref3,
|
|
5201
5136
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);
|
|
5202
|
-
var resolvedAccentColor = getColor(accentColor);
|
|
5203
|
-
var resolvedTextColor = getColor(textColor);
|
|
5204
|
-
var sizeStyles = ButtonSizes[size];
|
|
5205
|
-
var numericWidth = typeof sizeStyles.width === 'number' ? sizeStyles.width : 300;
|
|
5206
|
-
var numericHeight = typeof sizeStyles.height === 'number' ? sizeStyles.height : 60;
|
|
5207
|
-
var strokeAnimation = {
|
|
5208
|
-
from: {
|
|
5209
|
-
strokeWidth: '8px',
|
|
5210
|
-
strokeDasharray: '0 500',
|
|
5211
|
-
strokeDashoffset: -454
|
|
5212
|
-
},
|
|
5213
|
-
to: {
|
|
5214
|
-
strokeWidth: '3px',
|
|
5215
|
-
strokeDasharray: '760',
|
|
5216
|
-
strokeDashoffset: 0
|
|
5217
|
-
},
|
|
5218
|
-
duration: '0.9s',
|
|
5219
|
-
timingFunction: 'ease-in',
|
|
5220
|
-
fillMode: 'forwards'
|
|
5221
|
-
};
|
|
5222
5137
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
5223
|
-
as:
|
|
5224
|
-
href: to ? to : undefined,
|
|
5225
|
-
onClick: onClick,
|
|
5226
|
-
display: "inline-block",
|
|
5227
|
-
maxWidth: "20rem",
|
|
5228
|
-
margin: "0 auto",
|
|
5229
|
-
textAlign: "center",
|
|
5230
|
-
textDecoration: "none",
|
|
5138
|
+
as: "div",
|
|
5231
5139
|
position: "relative",
|
|
5232
|
-
|
|
5233
|
-
boxShadow: shadow
|
|
5234
|
-
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(View, {
|
|
5235
|
-
as: "svg",
|
|
5236
|
-
display: "block",
|
|
5237
|
-
height: numericHeight,
|
|
5238
|
-
width: numericWidth,
|
|
5239
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
5240
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
5241
|
-
as: "rect",
|
|
5242
|
-
height: numericHeight,
|
|
5243
|
-
width: numericWidth,
|
|
5244
|
-
fill: "transparent",
|
|
5245
|
-
stroke: resolvedAccentColor,
|
|
5246
|
-
strokeWidth: "8px",
|
|
5247
|
-
strokeDasharray: "0 500",
|
|
5248
|
-
strokeDashoffset: -454,
|
|
5249
|
-
on: {
|
|
5250
|
-
hover: {
|
|
5251
|
-
animate: strokeAnimation
|
|
5252
|
-
}
|
|
5253
|
-
}
|
|
5254
|
-
})), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
5255
|
-
position: "absolute",
|
|
5256
|
-
top: 0,
|
|
5257
|
-
right: 0,
|
|
5258
|
-
bottom: 0,
|
|
5259
|
-
left: 0,
|
|
5260
|
-
display: "flex",
|
|
5140
|
+
display: "inline-flex",
|
|
5261
5141
|
alignItems: "center",
|
|
5262
5142
|
justifyContent: "center",
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5143
|
+
borderRadius: ButtonShapes[shape],
|
|
5144
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
5145
|
+
onClick: onClick,
|
|
5146
|
+
boxShadow: shadow,
|
|
5147
|
+
padding: borderWidth,
|
|
5148
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : undefined
|
|
5149
|
+
}, views == null ? void 0 : views.container, props), children);
|
|
5268
5150
|
};
|
|
5269
5151
|
// --- Variant: Standard Button ---
|
|
5270
5152
|
var StandardButton = _ref4 => {
|
|
5271
5153
|
var {
|
|
5272
5154
|
variant,
|
|
5155
|
+
animation,
|
|
5273
5156
|
to,
|
|
5274
5157
|
isDisabled,
|
|
5275
5158
|
isLoading,
|
|
@@ -5283,9 +5166,220 @@ var StandardButton = _ref4 => {
|
|
|
5283
5166
|
baseStyles,
|
|
5284
5167
|
sizeStyles,
|
|
5285
5168
|
iconPad,
|
|
5286
|
-
|
|
5169
|
+
resolvedTextColor,
|
|
5170
|
+
content,
|
|
5171
|
+
mainTone,
|
|
5172
|
+
borderMovingDuration = 2,
|
|
5173
|
+
borderMovingGradientColors = ['#705CFF', '#FF5C97', '#FFC75C'],
|
|
5174
|
+
animatedStrokeAccentColor = '#705CFF',
|
|
5175
|
+
animatedStrokeTextColor = '#333333',
|
|
5176
|
+
getColor = c => c
|
|
5287
5177
|
} = _ref4,
|
|
5288
5178
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded3$3);
|
|
5179
|
+
// --- Common Helpers ---
|
|
5180
|
+
var numericBorderRadius = getNumericBorderRadius(shape);
|
|
5181
|
+
var linkOrContent = to ? (/*#__PURE__*/React.createElement(Link, Object.assign({
|
|
5182
|
+
to: to,
|
|
5183
|
+
isExternal: isExternal,
|
|
5184
|
+
color: "currentColor",
|
|
5185
|
+
textDecoration: "inherit",
|
|
5186
|
+
_hover: {
|
|
5187
|
+
color: 'currentColor'
|
|
5188
|
+
}
|
|
5189
|
+
}, views == null ? void 0 : views.link), content)) : content;
|
|
5190
|
+
var innerProps = {
|
|
5191
|
+
isDisabled,
|
|
5192
|
+
isLoading,
|
|
5193
|
+
baseStyles,
|
|
5194
|
+
sizeStyles,
|
|
5195
|
+
iconPad,
|
|
5196
|
+
resolvedTextColor,
|
|
5197
|
+
mainTone,
|
|
5198
|
+
children: linkOrContent
|
|
5199
|
+
};
|
|
5200
|
+
// --- Animation: Border Moving ---
|
|
5201
|
+
if (animation === 'borderMoving' && borderMovingGradientColors) {
|
|
5202
|
+
var borderWidth = 3;
|
|
5203
|
+
var borderAnimation = {
|
|
5204
|
+
from: {
|
|
5205
|
+
backgroundPosition: '0% 50%'
|
|
5206
|
+
},
|
|
5207
|
+
to: {
|
|
5208
|
+
backgroundPosition: '200% 50%'
|
|
5209
|
+
},
|
|
5210
|
+
duration: borderMovingDuration + "s",
|
|
5211
|
+
timingFunction: 'linear',
|
|
5212
|
+
iterationCount: 'infinite'
|
|
5213
|
+
};
|
|
5214
|
+
return /*#__PURE__*/React.createElement(BorderWrapper, Object.assign({
|
|
5215
|
+
shape: shape,
|
|
5216
|
+
isDisabled: isDisabled,
|
|
5217
|
+
onClick: onClick,
|
|
5218
|
+
shadow: shadow,
|
|
5219
|
+
borderWidth: borderWidth,
|
|
5220
|
+
isAuto: isAuto,
|
|
5221
|
+
isFilled: isFilled,
|
|
5222
|
+
views: views,
|
|
5223
|
+
background: "linear-gradient(90deg, " + borderMovingGradientColors[0] + ", " + borderMovingGradientColors[1] + ", " + borderMovingGradientColors[2] + ", " + borderMovingGradientColors[0] + ")",
|
|
5224
|
+
backgroundSize: "200% 100%",
|
|
5225
|
+
animate: borderAnimation
|
|
5226
|
+
}, props), /*#__PURE__*/React.createElement(InnerButton, Object.assign({
|
|
5227
|
+
asComponent: to ? 'div' : 'button',
|
|
5228
|
+
isWrapped: true,
|
|
5229
|
+
borderRadius: Math.max(0, numericBorderRadius - borderWidth),
|
|
5230
|
+
width: "100%",
|
|
5231
|
+
height: "100%"
|
|
5232
|
+
}, innerProps)));
|
|
5233
|
+
}
|
|
5234
|
+
// --- Animation: Animated Stroke ---
|
|
5235
|
+
if (animation === 'animatedStroke') {
|
|
5236
|
+
var _views$container;
|
|
5237
|
+
var resolvedAccentColor = getColor(animatedStrokeAccentColor);
|
|
5238
|
+
var resolvedStrokeTextColor = getColor(animatedStrokeTextColor);
|
|
5239
|
+
var strokePathLength = 1000;
|
|
5240
|
+
var strokeAnimation = {
|
|
5241
|
+
from: {
|
|
5242
|
+
strokeWidth: '8px',
|
|
5243
|
+
strokeDasharray: "0 " + strokePathLength,
|
|
5244
|
+
strokeDashoffset: -Math.round(strokePathLength * 0.63)
|
|
5245
|
+
},
|
|
5246
|
+
to: {
|
|
5247
|
+
strokeWidth: '3px',
|
|
5248
|
+
strokeDasharray: "" + strokePathLength,
|
|
5249
|
+
strokeDashoffset: 0
|
|
5250
|
+
},
|
|
5251
|
+
duration: '0.9s',
|
|
5252
|
+
timingFunction: 'ease-in',
|
|
5253
|
+
fillMode: 'forwards'
|
|
5254
|
+
};
|
|
5255
|
+
var mergedClassName = ['group', views == null || (_views$container = views.container) == null ? void 0 : _views$container.className, props == null ? void 0 : props.className].filter(Boolean).join(' ');
|
|
5256
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
5257
|
+
as: to ? 'div' : 'button',
|
|
5258
|
+
type: to ? undefined : 'button',
|
|
5259
|
+
disabled: Boolean(!to && (isDisabled || isLoading)),
|
|
5260
|
+
onClick: onClick,
|
|
5261
|
+
position: "relative",
|
|
5262
|
+
display: "inline-flex",
|
|
5263
|
+
alignItems: "center",
|
|
5264
|
+
justifyContent: "center",
|
|
5265
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : undefined,
|
|
5266
|
+
borderRadius: ButtonShapes[shape],
|
|
5267
|
+
boxShadow: shadow,
|
|
5268
|
+
transition: "all 0.2s ease",
|
|
5269
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
5270
|
+
color: resolvedStrokeTextColor,
|
|
5271
|
+
backgroundColor: "transparent",
|
|
5272
|
+
borderWidth: 0
|
|
5273
|
+
}, views == null ? void 0 : views.container, props, {
|
|
5274
|
+
className: mergedClassName
|
|
5275
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
5276
|
+
as: "svg",
|
|
5277
|
+
position: "absolute",
|
|
5278
|
+
top: 0,
|
|
5279
|
+
right: 0,
|
|
5280
|
+
bottom: 0,
|
|
5281
|
+
left: 0,
|
|
5282
|
+
width: "100%",
|
|
5283
|
+
height: "100%",
|
|
5284
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5285
|
+
pointerEvents: "none",
|
|
5286
|
+
zIndex: 1,
|
|
5287
|
+
"aria-hidden": "true"
|
|
5288
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
5289
|
+
as: "rect",
|
|
5290
|
+
x: "0",
|
|
5291
|
+
y: "0",
|
|
5292
|
+
height: "100%",
|
|
5293
|
+
width: "100%",
|
|
5294
|
+
rx: numericBorderRadius,
|
|
5295
|
+
ry: numericBorderRadius,
|
|
5296
|
+
fill: "transparent",
|
|
5297
|
+
stroke: resolvedAccentColor,
|
|
5298
|
+
strokeWidth: "8px",
|
|
5299
|
+
strokeDasharray: "0 " + strokePathLength,
|
|
5300
|
+
strokeDashoffset: -Math.round(strokePathLength * 0.63),
|
|
5301
|
+
pathLength: strokePathLength,
|
|
5302
|
+
on: {
|
|
5303
|
+
groupHover: {
|
|
5304
|
+
animate: strokeAnimation
|
|
5305
|
+
}
|
|
5306
|
+
}
|
|
5307
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
5308
|
+
position: "relative",
|
|
5309
|
+
zIndex: 0
|
|
5310
|
+
}, linkOrContent));
|
|
5311
|
+
}
|
|
5312
|
+
// --- Animation: Border Reveal ---
|
|
5313
|
+
if (animation === 'borderReveal') {
|
|
5314
|
+
var _borderWidth = 3;
|
|
5315
|
+
// Use the first color from gradient colors or fall back to mainTone
|
|
5316
|
+
var activeColor = (borderMovingGradientColors == null ? void 0 : borderMovingGradientColors[0]) || mainTone || '#000000';
|
|
5317
|
+
// Sides duration
|
|
5318
|
+
// The default duration (2s) is too slow for a hover interaction.
|
|
5319
|
+
// We scale it by 0.25 to make it responsive (0.5s total).
|
|
5320
|
+
var effectiveDuration = borderMovingDuration * 0.75;
|
|
5321
|
+
var sideDuration = effectiveDuration / 4;
|
|
5322
|
+
// Gradients for each side (color 50%, transparent 50%)
|
|
5323
|
+
var topGrad = "linear-gradient(90deg, " + activeColor + " 50%, transparent 50%)";
|
|
5324
|
+
var rightGrad = "linear-gradient(180deg, " + activeColor + " 50%, transparent 50%)";
|
|
5325
|
+
var bottomGrad = "linear-gradient(270deg, " + activeColor + " 50%, transparent 50%)";
|
|
5326
|
+
var leftGrad = "linear-gradient(0deg, " + activeColor + " 50%, transparent 50%)";
|
|
5327
|
+
// Coordinates:
|
|
5328
|
+
// Top (L->R): 100% 0 -> 0 0
|
|
5329
|
+
// Right (T->B): 100% 100% -> 100% 0
|
|
5330
|
+
// Bottom (R->L): 0 100% -> 100% 100%
|
|
5331
|
+
// Left (B->T): 0 0 -> 0 100%
|
|
5332
|
+
var bgPosStart = "100% 0, 100% 100%, 0 100%, 0 0";
|
|
5333
|
+
var bgPosEnd = "0 0, 100% 0, 100% 100%, 0 100%";
|
|
5334
|
+
// Delays:
|
|
5335
|
+
// Enter (Forward): Top(0), Right(1), Bottom(2), Left(3)
|
|
5336
|
+
var delayEnter = "0s, " + sideDuration + "s, " + sideDuration * 2 + "s, " + sideDuration * 2 + "s";
|
|
5337
|
+
// Exit (Reverse): Top(3), Right(2), Bottom(1), Left(0)
|
|
5338
|
+
var delayExit = sideDuration * 2 + "s, " + sideDuration * 2 + "s, " + sideDuration + "s, 0s";
|
|
5339
|
+
// Use slightly larger gradient size to overlap with button content (avoid gaps)
|
|
5340
|
+
var gradientSize = _borderWidth + 1;
|
|
5341
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
5342
|
+
as: "div",
|
|
5343
|
+
position: "relative",
|
|
5344
|
+
display: "inline-flex",
|
|
5345
|
+
alignItems: "center",
|
|
5346
|
+
justifyContent: "center",
|
|
5347
|
+
borderRadius: ButtonShapes[shape],
|
|
5348
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
5349
|
+
onClick: onClick,
|
|
5350
|
+
boxShadow: shadow,
|
|
5351
|
+
padding: _borderWidth,
|
|
5352
|
+
background: "\n " + topGrad + " no-repeat,\n " + rightGrad + " no-repeat,\n " + bottomGrad + " no-repeat,\n " + leftGrad + " no-repeat\n ",
|
|
5353
|
+
backgroundSize: "200% " + gradientSize + "px, " + gradientSize + "px 200%, 200% " + gradientSize + "px, " + gradientSize + "px 200%",
|
|
5354
|
+
// Default State (Hidden)
|
|
5355
|
+
backgroundPosition: bgPosStart,
|
|
5356
|
+
transitionProperty: "background-position",
|
|
5357
|
+
transitionDuration: sideDuration + "s",
|
|
5358
|
+
transitionTimingFunction: "linear",
|
|
5359
|
+
transitionDelay: delayExit,
|
|
5360
|
+
// Hover State (Visible)
|
|
5361
|
+
_hover: {
|
|
5362
|
+
backgroundPosition: bgPosEnd,
|
|
5363
|
+
transitionDelay: delayEnter
|
|
5364
|
+
},
|
|
5365
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : undefined
|
|
5366
|
+
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
5367
|
+
as: to ? 'div' : 'button',
|
|
5368
|
+
disabled: Boolean(isDisabled || isLoading),
|
|
5369
|
+
display: "flex",
|
|
5370
|
+
alignItems: "center",
|
|
5371
|
+
justifyContent: "center",
|
|
5372
|
+
borderRadius: Math.max(0, numericBorderRadius - _borderWidth),
|
|
5373
|
+
width: "100%",
|
|
5374
|
+
height: "100%"
|
|
5375
|
+
}, baseStyles, sizeStyles, iconPad, {
|
|
5376
|
+
backgroundColor: (baseStyles == null ? void 0 : baseStyles.backgroundColor) || mainTone,
|
|
5377
|
+
color: resolvedTextColor,
|
|
5378
|
+
borderWidth: 0,
|
|
5379
|
+
cursor: isDisabled ? 'default' : 'pointer'
|
|
5380
|
+
}), linkOrContent));
|
|
5381
|
+
}
|
|
5382
|
+
// --- Default: Standard Button ---
|
|
5289
5383
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
5290
5384
|
as: variant === 'link' && to ? 'div' : 'button',
|
|
5291
5385
|
type: variant === 'link' && to ? undefined : 'button',
|
|
@@ -5301,19 +5395,12 @@ var StandardButton = _ref4 => {
|
|
|
5301
5395
|
transition: "all 0.2s ease",
|
|
5302
5396
|
cursor: isDisabled ? 'default' : 'pointer',
|
|
5303
5397
|
onClick: onClick
|
|
5304
|
-
}, baseStyles, views == null ? void 0 : views.container, props),
|
|
5305
|
-
to: to,
|
|
5306
|
-
isExternal: isExternal,
|
|
5307
|
-
color: "currentColor",
|
|
5308
|
-
textDecoration: "inherit",
|
|
5309
|
-
_hover: {
|
|
5310
|
-
color: 'currentColor'
|
|
5311
|
-
}
|
|
5312
|
-
}, views == null ? void 0 : views.link), content)) : content);
|
|
5398
|
+
}, baseStyles, views == null ? void 0 : views.container, props), linkOrContent);
|
|
5313
5399
|
};
|
|
5314
5400
|
// --- Main Component ---
|
|
5401
|
+
// --- Main Component ---
|
|
5315
5402
|
var ButtonView = _ref5 => {
|
|
5316
|
-
var _ref6, _base$color;
|
|
5403
|
+
var _ref6, _ref7, _base$color;
|
|
5317
5404
|
var {
|
|
5318
5405
|
/* behaviour */
|
|
5319
5406
|
variant = 'filled',
|
|
@@ -5325,6 +5412,10 @@ var ButtonView = _ref5 => {
|
|
|
5325
5412
|
// primary candidate for main color
|
|
5326
5413
|
color,
|
|
5327
5414
|
// 2nd candidate for main color (NOT text‑color)
|
|
5415
|
+
scheme,
|
|
5416
|
+
// New scheme prop
|
|
5417
|
+
reversed = false,
|
|
5418
|
+
// New reversed prop
|
|
5328
5419
|
isAuto = true,
|
|
5329
5420
|
isFilled,
|
|
5330
5421
|
isDisabled,
|
|
@@ -5340,7 +5431,6 @@ var ButtonView = _ref5 => {
|
|
|
5340
5431
|
shadow,
|
|
5341
5432
|
onClick,
|
|
5342
5433
|
views = {},
|
|
5343
|
-
themeMode: elementMode,
|
|
5344
5434
|
/* effect props */
|
|
5345
5435
|
borderMovingDuration = 2,
|
|
5346
5436
|
borderMovingGradientColors = ['#705CFF', '#FF5C97', '#FFC75C'],
|
|
@@ -5350,20 +5440,22 @@ var ButtonView = _ref5 => {
|
|
|
5350
5440
|
props = _objectWithoutPropertiesLoose(_ref5, _excluded4$3);
|
|
5351
5441
|
/* theme helpers */
|
|
5352
5442
|
var {
|
|
5353
|
-
|
|
5443
|
+
getColorHex,
|
|
5354
5444
|
themeMode
|
|
5355
5445
|
} = useTheme();
|
|
5356
|
-
var mode = elementMode != null ? elementMode : themeMode;
|
|
5357
5446
|
/* MAIN COLOR – determines the entire palette */
|
|
5358
|
-
var mainColorKey = (_ref6 = backgroundColor != null ? backgroundColor : color) != null ? _ref6 : 'theme.primary';
|
|
5359
|
-
var mainTone =
|
|
5360
|
-
themeMode: mode
|
|
5361
|
-
});
|
|
5447
|
+
var mainColorKey = (_ref6 = (_ref7 = backgroundColor != null ? backgroundColor : color) != null ? _ref7 : scheme) != null ? _ref6 : 'theme.primary';
|
|
5448
|
+
var mainTone = getColorHex(isDisabled ? 'theme.disabled' : mainColorKey);
|
|
5362
5449
|
var tone = contrast(mainTone);
|
|
5363
5450
|
/* text color with mixBlendMode for maximum visibility */
|
|
5364
|
-
var textColor
|
|
5451
|
+
var textColor;
|
|
5452
|
+
if (tone === 'light') {
|
|
5453
|
+
textColor = '#000000';
|
|
5454
|
+
} else {
|
|
5455
|
+
textColor = '#FFFFFF';
|
|
5456
|
+
}
|
|
5365
5457
|
/* variant palette */
|
|
5366
|
-
var palette = useMemo(() => getButtonVariants(mainTone, tone === 'light'), [mainTone, tone,
|
|
5458
|
+
var palette = useMemo(() => getButtonVariants(mainTone, tone === 'light', reversed), [mainTone, tone, reversed]);
|
|
5367
5459
|
var base = palette[variant];
|
|
5368
5460
|
var resolvedTextColor = (_base$color = base == null ? void 0 : base.color) != null ? _base$color : textColor;
|
|
5369
5461
|
// Render content logic safely
|
|
@@ -5377,39 +5469,12 @@ var ButtonView = _ref5 => {
|
|
|
5377
5469
|
isIconRounded: isIconRounded,
|
|
5378
5470
|
views: views
|
|
5379
5471
|
}, children);
|
|
5380
|
-
// Dispatch to the correct variant component
|
|
5381
|
-
if (variant === 'borderMoving') {
|
|
5382
|
-
return /*#__PURE__*/React.createElement(BorderMovingButton, Object.assign({
|
|
5383
|
-
variant: variant,
|
|
5384
|
-
shape: shape,
|
|
5385
|
-
size: size,
|
|
5386
|
-
isDisabled: isDisabled,
|
|
5387
|
-
onClick: onClick,
|
|
5388
|
-
views: views,
|
|
5389
|
-
mainTone: mainTone,
|
|
5390
|
-
tone: tone,
|
|
5391
|
-
borderMovingGradientColors: borderMovingGradientColors,
|
|
5392
|
-
borderMovingDuration: borderMovingDuration,
|
|
5393
|
-
content: content
|
|
5394
|
-
}, props));
|
|
5395
|
-
}
|
|
5396
|
-
if (variant === 'animatedStroke') {
|
|
5397
|
-
return /*#__PURE__*/React.createElement(AnimatedStrokeButton, Object.assign({
|
|
5398
|
-
variant: variant,
|
|
5399
|
-
to: to,
|
|
5400
|
-
onClick: onClick,
|
|
5401
|
-
views: views,
|
|
5402
|
-
size: size,
|
|
5403
|
-
accentColor: animatedStrokeAccentColor,
|
|
5404
|
-
textColor: animatedStrokeTextColor,
|
|
5405
|
-
getColor: getColor
|
|
5406
|
-
}, props), children);
|
|
5407
|
-
}
|
|
5408
5472
|
// Standard variants (filled, outline, ghost, link)
|
|
5409
5473
|
var sizeStyles = ButtonSizes[size];
|
|
5410
5474
|
var iconPad = isIconRounded ? IconSizes$1[size] : {};
|
|
5411
5475
|
return /*#__PURE__*/React.createElement(StandardButton, Object.assign({
|
|
5412
5476
|
variant: variant,
|
|
5477
|
+
animation: props.animation,
|
|
5413
5478
|
to: to,
|
|
5414
5479
|
isDisabled: isDisabled,
|
|
5415
5480
|
isLoading: isLoading,
|
|
@@ -5425,7 +5490,14 @@ var ButtonView = _ref5 => {
|
|
|
5425
5490
|
iconPad: iconPad,
|
|
5426
5491
|
resolvedTextColor: resolvedTextColor,
|
|
5427
5492
|
content: content,
|
|
5428
|
-
size: size
|
|
5493
|
+
size: size,
|
|
5494
|
+
mainTone: mainTone,
|
|
5495
|
+
tone: tone,
|
|
5496
|
+
borderMovingDuration: borderMovingDuration,
|
|
5497
|
+
borderMovingGradientColors: borderMovingGradientColors,
|
|
5498
|
+
animatedStrokeAccentColor: animatedStrokeAccentColor,
|
|
5499
|
+
animatedStrokeTextColor: animatedStrokeTextColor,
|
|
5500
|
+
getColor: getColorHex
|
|
5429
5501
|
}, props));
|
|
5430
5502
|
};
|
|
5431
5503
|
|
|
@@ -9635,7 +9707,7 @@ var SelectorView = _ref => {
|
|
|
9635
9707
|
var isSelected = value === option.value;
|
|
9636
9708
|
var borderColor = getColor('color.gray.200');
|
|
9637
9709
|
var textColor = getColor('color.gray.500');
|
|
9638
|
-
var
|
|
9710
|
+
var backgroundColor = 'transparent';
|
|
9639
9711
|
if (isSelected) {
|
|
9640
9712
|
if (option.color) {
|
|
9641
9713
|
// We need a way to get related colors (50, 500, 700 etc) from a base color if we want full fidelity.
|
|
@@ -9646,13 +9718,13 @@ var SelectorView = _ref => {
|
|
|
9646
9718
|
// Simplification: if color provided, use it for border/text.
|
|
9647
9719
|
// Background is hard to derive without more specific props.
|
|
9648
9720
|
// Let's try to use a very light opacity of the color for background.
|
|
9649
|
-
|
|
9721
|
+
backgroundColor = 'rgba(0,0,0,0.05)'; // Generic active background
|
|
9650
9722
|
} else {
|
|
9651
9723
|
// Default active style
|
|
9652
9724
|
var primary = getColor('theme.primary');
|
|
9653
9725
|
borderColor = primary;
|
|
9654
9726
|
textColor = primary;
|
|
9655
|
-
|
|
9727
|
+
backgroundColor = 'color.gray.50';
|
|
9656
9728
|
}
|
|
9657
9729
|
// Specific overrides based on user request "ComplexitySelector" style
|
|
9658
9730
|
// If the values match 'High', 'Medium', 'Low' we can hardcode for *demo* fidelity if generic logic fails.
|
|
@@ -9662,12 +9734,12 @@ var SelectorView = _ref => {
|
|
|
9662
9734
|
// Fallback for customized options
|
|
9663
9735
|
borderColor = getColor(option.color);
|
|
9664
9736
|
textColor = getColor(option.color);
|
|
9665
|
-
|
|
9737
|
+
backgroundColor = 'transparent';
|
|
9666
9738
|
} else {
|
|
9667
9739
|
// Default fallback
|
|
9668
9740
|
borderColor = getColor('theme.primary');
|
|
9669
9741
|
textColor = getColor('theme.primary');
|
|
9670
|
-
|
|
9742
|
+
backgroundColor = 'transparent';
|
|
9671
9743
|
}
|
|
9672
9744
|
}
|
|
9673
9745
|
return /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
@@ -9687,7 +9759,7 @@ var SelectorView = _ref => {
|
|
|
9687
9759
|
borderBottom: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
|
|
9688
9760
|
borderLeft: "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')),
|
|
9689
9761
|
borderRight: index === arr.length - 1 || isSelected ? "1px solid " + (isSelected ? borderColor : getColor('color.gray.200')) : 'none',
|
|
9690
|
-
backgroundColor:
|
|
9762
|
+
backgroundColor: backgroundColor,
|
|
9691
9763
|
color: textColor,
|
|
9692
9764
|
borderRadius: index === 0 ? '6px 0 0 6px' : index === arr.length - 1 ? '0 6px 6px 0' : '0',
|
|
9693
9765
|
zIndex: isSelected ? 1 : 0,
|
|
@@ -16616,16 +16688,16 @@ var SliderView = _ref => {
|
|
|
16616
16688
|
} = _ref,
|
|
16617
16689
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$S);
|
|
16618
16690
|
var {
|
|
16619
|
-
|
|
16691
|
+
getColorHex,
|
|
16620
16692
|
themeMode
|
|
16621
16693
|
} = useTheme();
|
|
16622
|
-
var themeColor =
|
|
16694
|
+
var themeColor = getColorHex(backgroundColor, {
|
|
16623
16695
|
themeMode: elementMode || themeMode
|
|
16624
16696
|
});
|
|
16625
|
-
var disabledColor =
|
|
16697
|
+
var disabledColor = getColorHex('theme.disabled', {
|
|
16626
16698
|
themeMode: elementMode || themeMode
|
|
16627
16699
|
});
|
|
16628
|
-
var trackColor =
|
|
16700
|
+
var trackColor = getColorHex(SliderVariants[variant].backgroundColor, {
|
|
16629
16701
|
themeMode: elementMode || themeMode
|
|
16630
16702
|
});
|
|
16631
16703
|
var isVertical = orientation === 'vertical';
|
|
@@ -16797,7 +16869,7 @@ var SliderView = _ref => {
|
|
|
16797
16869
|
height: thumbSize + "px",
|
|
16798
16870
|
borderRadius: "50%",
|
|
16799
16871
|
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
16800
|
-
border: "2px solid
|
|
16872
|
+
border: "2px solid color.white",
|
|
16801
16873
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
|
|
16802
16874
|
cursor: isDisabled ? 'not-allowed' : 'grab',
|
|
16803
16875
|
transform: isVertical ? 'translateX(-50%)' : 'translateY(-50%)',
|
|
@@ -16816,8 +16888,8 @@ var SliderView = _ref => {
|
|
|
16816
16888
|
}, views == null ? void 0 : views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
16817
16889
|
position: "absolute",
|
|
16818
16890
|
padding: "4px 8px",
|
|
16819
|
-
backgroundColor:
|
|
16820
|
-
color:
|
|
16891
|
+
backgroundColor: 'color.black',
|
|
16892
|
+
color: 'color.white',
|
|
16821
16893
|
borderRadius: "4px",
|
|
16822
16894
|
whiteSpace: "nowrap",
|
|
16823
16895
|
zIndex: 3
|
|
@@ -19228,7 +19300,7 @@ var HighlightStyles = {
|
|
|
19228
19300
|
})
|
|
19229
19301
|
};
|
|
19230
19302
|
|
|
19231
|
-
var _excluded$Z = ["text", "typingSpeed", "pauseTime", "onComplete", "showCursor", "cursorColor", "textStyle", "as"];
|
|
19303
|
+
var _excluded$Z = ["text", "typingSpeed", "pauseTime", "onComplete", "showCursor", "cursorColor", "textStyle", "textComponent", "as"];
|
|
19232
19304
|
/**
|
|
19233
19305
|
* A component that creates a typewriter effect for text
|
|
19234
19306
|
*/
|
|
@@ -19240,9 +19312,11 @@ var TypewriterEffect = _ref => {
|
|
|
19240
19312
|
onComplete,
|
|
19241
19313
|
showCursor = true,
|
|
19242
19314
|
cursorColor = 'currentColor',
|
|
19243
|
-
textStyle
|
|
19315
|
+
textStyle,
|
|
19316
|
+
textComponent
|
|
19244
19317
|
} = _ref,
|
|
19245
19318
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$Z);
|
|
19319
|
+
var TextComponent = textComponent || Text;
|
|
19246
19320
|
// Convert text to array if it's a string
|
|
19247
19321
|
var textArray = Array.isArray(text) ? text : [text];
|
|
19248
19322
|
// State for the currently displayed text
|
|
@@ -19295,7 +19369,7 @@ var TypewriterEffect = _ref => {
|
|
|
19295
19369
|
}, [textArray, currentTextIndex, charIndex, isComplete, onComplete, pauseTime, typingSpeed]);
|
|
19296
19370
|
return /*#__PURE__*/React.createElement(React.Fragment, null, displayedText.map((text, index) => (/*#__PURE__*/React.createElement(React.Fragment, {
|
|
19297
19371
|
key: index
|
|
19298
|
-
}, text, showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React.createElement(
|
|
19372
|
+
}, text, showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React.createElement(TextComponent, Object.assign({
|
|
19299
19373
|
as: "span",
|
|
19300
19374
|
display: "inline-block",
|
|
19301
19375
|
width: "0.1em",
|
|
@@ -19308,7 +19382,7 @@ var TypewriterEffect = _ref => {
|
|
|
19308
19382
|
}, textStyle))))))));
|
|
19309
19383
|
};
|
|
19310
19384
|
|
|
19311
|
-
var _excluded$_ = ["text", "duration", "direction", "stagger", "sequential", "textStyle", "as", "wordProps"],
|
|
19385
|
+
var _excluded$_ = ["text", "duration", "direction", "stagger", "sequential", "textStyle", "as", "wordProps", "textComponent"],
|
|
19312
19386
|
_excluded2$g = ["style"];
|
|
19313
19387
|
var SlideEffect = _ref => {
|
|
19314
19388
|
var {
|
|
@@ -19318,12 +19392,14 @@ var SlideEffect = _ref => {
|
|
|
19318
19392
|
stagger = 50,
|
|
19319
19393
|
sequential = false,
|
|
19320
19394
|
textStyle,
|
|
19321
|
-
wordProps
|
|
19395
|
+
wordProps,
|
|
19396
|
+
textComponent
|
|
19322
19397
|
} = _ref,
|
|
19323
19398
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$_);
|
|
19324
19399
|
var [displayedText, setDisplayedText] = useState(text);
|
|
19325
19400
|
var [phase, setPhase] = useState('entering');
|
|
19326
19401
|
var [animKey, setAnimKey] = useState(0);
|
|
19402
|
+
var TextComponent = textComponent || Text;
|
|
19327
19403
|
var pendingTextRef = useRef(null);
|
|
19328
19404
|
var timeoutRef = useRef(null);
|
|
19329
19405
|
// Handle text changes
|
|
@@ -19477,7 +19553,7 @@ var SlideEffect = _ref => {
|
|
|
19477
19553
|
transform: phase === 'visible' ? 'translateY(0)' : undefined,
|
|
19478
19554
|
opacity: phase === 'visible' ? 1 : undefined
|
|
19479
19555
|
});
|
|
19480
|
-
return /*#__PURE__*/React.createElement(
|
|
19556
|
+
return /*#__PURE__*/React.createElement(TextComponent, Object.assign({
|
|
19481
19557
|
key: animKey + "-" + index,
|
|
19482
19558
|
as: "span",
|
|
19483
19559
|
animate: wordAnimation
|
|
@@ -19485,7 +19561,7 @@ var SlideEffect = _ref => {
|
|
|
19485
19561
|
})));
|
|
19486
19562
|
};
|
|
19487
19563
|
|
|
19488
|
-
var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential", "themeMode"];
|
|
19564
|
+
var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential", "themeMode", "textComponent"];
|
|
19489
19565
|
function escapeRegExp(string) {
|
|
19490
19566
|
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
19491
19567
|
}
|
|
@@ -19509,7 +19585,8 @@ var TitleView = _ref => {
|
|
|
19509
19585
|
highlightSlideDuration = 500,
|
|
19510
19586
|
highlightSlideStagger = 50,
|
|
19511
19587
|
highlightSlideSequential = true,
|
|
19512
|
-
themeMode: elementMode
|
|
19588
|
+
themeMode: elementMode,
|
|
19589
|
+
textComponent
|
|
19513
19590
|
} = _ref,
|
|
19514
19591
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$$);
|
|
19515
19592
|
var {
|
|
@@ -19563,6 +19640,7 @@ var TitleView = _ref => {
|
|
|
19563
19640
|
highlightSlideStagger,
|
|
19564
19641
|
highlightSlideSequential
|
|
19565
19642
|
}, props));
|
|
19643
|
+
var TextComponent = textComponent || Text;
|
|
19566
19644
|
// Common style calculations
|
|
19567
19645
|
var useResponsive = responsive && !props.media;
|
|
19568
19646
|
var fontSize = TitleSizes[size];
|
|
@@ -19611,8 +19689,8 @@ var TitleView = _ref => {
|
|
|
19611
19689
|
return /*#__PURE__*/React.createElement(TypewriterEffect, Object.assign({
|
|
19612
19690
|
text: content,
|
|
19613
19691
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (content.length * 10)),
|
|
19614
|
-
|
|
19615
|
-
|
|
19692
|
+
cursorColor: "currentColor",
|
|
19693
|
+
textComponent: TextComponent
|
|
19616
19694
|
}, highlightProps));
|
|
19617
19695
|
}
|
|
19618
19696
|
if (highlightSlide) {
|
|
@@ -19624,7 +19702,8 @@ var TitleView = _ref => {
|
|
|
19624
19702
|
direction: "up",
|
|
19625
19703
|
fontSize: useResponsive ? undefined : fontSize,
|
|
19626
19704
|
fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
|
|
19627
|
-
wordProps: highlightProps
|
|
19705
|
+
wordProps: highlightProps,
|
|
19706
|
+
textComponent: TextComponent
|
|
19628
19707
|
});
|
|
19629
19708
|
}
|
|
19630
19709
|
return content;
|
|
@@ -19644,7 +19723,7 @@ var TitleView = _ref => {
|
|
|
19644
19723
|
lastIndex = match.index + match[0].length;
|
|
19645
19724
|
}
|
|
19646
19725
|
if (lastIndex < text.length) parts.push(text.substring(lastIndex));
|
|
19647
|
-
return /*#__PURE__*/React.createElement(Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React.createElement(
|
|
19726
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React.createElement(TextComponent, Object.assign({
|
|
19648
19727
|
key: "highlight-" + idx,
|
|
19649
19728
|
as: "span",
|
|
19650
19729
|
display: "inline",
|
|
@@ -19654,7 +19733,7 @@ var TitleView = _ref => {
|
|
|
19654
19733
|
}
|
|
19655
19734
|
// Case 2: Has highlight style but no highlight target - apply style to entire title
|
|
19656
19735
|
if (highlightStyle && !activeHighlightTarget) {
|
|
19657
|
-
return /*#__PURE__*/React.createElement(Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(
|
|
19736
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(TextComponent, Object.assign({
|
|
19658
19737
|
as: "span",
|
|
19659
19738
|
fontSize: fontSize,
|
|
19660
19739
|
display: "inline",
|
|
@@ -19662,7 +19741,7 @@ var TitleView = _ref => {
|
|
|
19662
19741
|
}, !highlightSlide ? highlightProps : {}, views == null ? void 0 : views.highlight), renderHighlightedContent(text)));
|
|
19663
19742
|
}
|
|
19664
19743
|
// Case 3: Default - no highlighting
|
|
19665
|
-
return /*#__PURE__*/React.createElement(
|
|
19744
|
+
return /*#__PURE__*/React.createElement(TextComponent, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), text);
|
|
19666
19745
|
};
|
|
19667
19746
|
|
|
19668
19747
|
/**
|
|
@@ -26195,13 +26274,13 @@ var ToastView = _ref => {
|
|
|
26195
26274
|
fontWeight: "600" // Semi-bold for better readability
|
|
26196
26275
|
,
|
|
26197
26276
|
color: Theme[variant].content.color,
|
|
26198
|
-
|
|
26277
|
+
backgroundColor: Theme[variant].container.backgroundColor
|
|
26199
26278
|
}, views == null ? void 0 : views.title), title), description && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
26200
26279
|
size: "sm",
|
|
26201
26280
|
color: Theme[variant].content.color,
|
|
26202
26281
|
fontWeight: "400" // Regular weight
|
|
26203
26282
|
,
|
|
26204
|
-
|
|
26283
|
+
backgroundColor: Theme[variant].container.backgroundColor
|
|
26205
26284
|
}, views == null ? void 0 : views.description), description)), action && actionText && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
26206
26285
|
size: "sm",
|
|
26207
26286
|
fontWeight: "600" // Semi-bold for better readability
|
|
@@ -26210,7 +26289,7 @@ var ToastView = _ref => {
|
|
|
26210
26289
|
,
|
|
26211
26290
|
cursor: "pointer",
|
|
26212
26291
|
color: Theme[variant].content.color,
|
|
26213
|
-
|
|
26292
|
+
backgroundColor: Theme[variant].container.backgroundColor,
|
|
26214
26293
|
onClick: e => {
|
|
26215
26294
|
e.stopPropagation();
|
|
26216
26295
|
action();
|