@app-studio/web 0.9.62 → 0.9.65
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 +1 -0
- 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 +384 -309
- 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 +384 -309
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +384 -309
- 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 +2 -2
- package/dist/components/Title/Title/useInView.d.ts +0 -9
|
@@ -4759,6 +4759,11 @@
|
|
|
4759
4759
|
views
|
|
4760
4760
|
} = _ref4,
|
|
4761
4761
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$2);
|
|
4762
|
+
var {
|
|
4763
|
+
getColor
|
|
4764
|
+
} = appStudio.useTheme();
|
|
4765
|
+
loaderColor = getColor(loaderColor || props.color || 'theme.loading');
|
|
4766
|
+
textColor = getColor(textColor || props.color || 'theme.loading');
|
|
4762
4767
|
var style = {
|
|
4763
4768
|
size,
|
|
4764
4769
|
speed,
|
|
@@ -4872,12 +4877,19 @@
|
|
|
4872
4877
|
padding: 14
|
|
4873
4878
|
}
|
|
4874
4879
|
};
|
|
4875
|
-
var getButtonVariants = function getButtonVariants(color, isLight,
|
|
4880
|
+
var getButtonVariants = function getButtonVariants(color, isLight, reversed) {
|
|
4881
|
+
if (reversed === void 0) {
|
|
4882
|
+
reversed = false;
|
|
4883
|
+
}
|
|
4876
4884
|
var textColor = isLight ? '#000000' : '#FFFFFF';
|
|
4885
|
+
// Determine effective colors based on reversed state
|
|
4886
|
+
var effectiveBg = reversed ? textColor : color;
|
|
4887
|
+
var effectiveContent = reversed ? color : textColor;
|
|
4888
|
+
var effectiveBorder = reversed ? textColor : color;
|
|
4877
4889
|
return {
|
|
4878
4890
|
filled: {
|
|
4879
|
-
backgroundColor:
|
|
4880
|
-
color:
|
|
4891
|
+
backgroundColor: effectiveBg,
|
|
4892
|
+
color: effectiveContent,
|
|
4881
4893
|
borderWidth: 1,
|
|
4882
4894
|
borderStyle: 'solid',
|
|
4883
4895
|
borderColor: 'transparent',
|
|
@@ -4889,57 +4901,57 @@
|
|
|
4889
4901
|
},
|
|
4890
4902
|
_focusVisible: {
|
|
4891
4903
|
outline: 'none',
|
|
4892
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
4904
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBg
|
|
4893
4905
|
},
|
|
4894
4906
|
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
4895
4907
|
},
|
|
4896
|
-
|
|
4897
|
-
backgroundColor:
|
|
4898
|
-
color:
|
|
4908
|
+
empty: {
|
|
4909
|
+
backgroundColor: 'transparent',
|
|
4910
|
+
color: effectiveBorder,
|
|
4899
4911
|
borderWidth: 1,
|
|
4900
4912
|
borderStyle: 'solid',
|
|
4901
|
-
borderColor:
|
|
4913
|
+
borderColor: effectiveBorder,
|
|
4902
4914
|
_hover: {
|
|
4903
4915
|
opacity: 0.9
|
|
4904
4916
|
},
|
|
4905
4917
|
_active: {
|
|
4906
4918
|
opacity: 0.95
|
|
4907
4919
|
},
|
|
4920
|
+
_focusVisible: {
|
|
4921
|
+
outline: 'none',
|
|
4922
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
4923
|
+
},
|
|
4908
4924
|
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
4909
4925
|
},
|
|
4910
4926
|
outline: {
|
|
4911
4927
|
backgroundColor: 'transparent',
|
|
4912
|
-
color:
|
|
4928
|
+
color: effectiveBorder,
|
|
4913
4929
|
borderWidth: 1,
|
|
4914
4930
|
borderStyle: 'solid',
|
|
4915
|
-
borderColor:
|
|
4931
|
+
borderColor: effectiveBorder,
|
|
4916
4932
|
_hover: {
|
|
4917
|
-
backgroundColor: color,
|
|
4918
|
-
color: textColor,
|
|
4919
4933
|
opacity: 0.9
|
|
4920
4934
|
},
|
|
4921
4935
|
_active: {
|
|
4922
|
-
backgroundColor: color,
|
|
4923
|
-
color: textColor,
|
|
4924
4936
|
opacity: 0.95
|
|
4925
4937
|
},
|
|
4926
4938
|
_focusVisible: {
|
|
4927
4939
|
outline: 'none',
|
|
4928
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
4940
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
4929
4941
|
},
|
|
4930
4942
|
transition: 'background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease'
|
|
4931
4943
|
},
|
|
4932
4944
|
ghost: {
|
|
4933
4945
|
backgroundColor: 'transparent',
|
|
4934
|
-
color:
|
|
4946
|
+
color: effectiveBorder,
|
|
4935
4947
|
borderWidth: 1,
|
|
4936
4948
|
borderStyle: 'solid',
|
|
4937
4949
|
borderColor: 'transparent',
|
|
4938
4950
|
_hover: {
|
|
4939
4951
|
borderWidth: 1,
|
|
4940
4952
|
borderStyle: 'solid',
|
|
4941
|
-
borderColor:
|
|
4942
|
-
color:
|
|
4953
|
+
borderColor: effectiveBorder,
|
|
4954
|
+
color: effectiveBorder,
|
|
4943
4955
|
opacity: 0.9
|
|
4944
4956
|
},
|
|
4945
4957
|
_active: {
|
|
@@ -4947,20 +4959,20 @@
|
|
|
4947
4959
|
},
|
|
4948
4960
|
_focusVisible: {
|
|
4949
4961
|
outline: 'none',
|
|
4950
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
4962
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
4951
4963
|
},
|
|
4952
4964
|
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
4953
4965
|
},
|
|
4954
4966
|
link: {
|
|
4955
4967
|
backgroundColor: 'transparent',
|
|
4956
|
-
color:
|
|
4968
|
+
color: effectiveBorder,
|
|
4957
4969
|
borderWidth: 0,
|
|
4958
4970
|
borderStyle: 'none',
|
|
4959
4971
|
borderColor: 'transparent',
|
|
4960
4972
|
textDecoration: 'underline',
|
|
4961
4973
|
textUnderlineOffset: '2px',
|
|
4962
4974
|
textDecorationThickness: '1px',
|
|
4963
|
-
textDecorationColor:
|
|
4975
|
+
textDecorationColor: effectiveBorder,
|
|
4964
4976
|
_hover: {
|
|
4965
4977
|
opacity: 0.8
|
|
4966
4978
|
},
|
|
@@ -4969,83 +4981,35 @@
|
|
|
4969
4981
|
},
|
|
4970
4982
|
_focusVisible: {
|
|
4971
4983
|
outline: 'none',
|
|
4972
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
4973
|
-
},
|
|
4974
|
-
transition: 'opacity 0.2s ease'
|
|
4975
|
-
},
|
|
4976
|
-
borderMoving: {
|
|
4977
|
-
position: 'relative',
|
|
4978
|
-
backgroundColor: 'black',
|
|
4979
|
-
color: textColor,
|
|
4980
|
-
overflow: 'hidden',
|
|
4981
|
-
borderWidth: 0,
|
|
4982
|
-
borderStyle: 'none',
|
|
4983
|
-
borderColor: 'transparent',
|
|
4984
|
-
_hover: {
|
|
4985
|
-
color: textColor
|
|
4986
|
-
},
|
|
4987
|
-
_active: {
|
|
4988
|
-
color: textColor
|
|
4989
|
-
},
|
|
4990
|
-
_focusVisible: {
|
|
4991
|
-
outline: 'none',
|
|
4992
|
-
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.8)'
|
|
4993
|
-
},
|
|
4994
|
-
transition: 'opacity 0.2s ease'
|
|
4995
|
-
},
|
|
4996
|
-
animatedStroke: {
|
|
4997
|
-
display: 'inline-block',
|
|
4998
|
-
margin: '0 auto',
|
|
4999
|
-
textAlign: 'center',
|
|
5000
|
-
textDecoration: 'none',
|
|
5001
|
-
position: 'relative',
|
|
5002
|
-
cursor: 'pointer',
|
|
5003
|
-
backgroundColor: 'transparent',
|
|
5004
|
-
color: color,
|
|
5005
|
-
borderWidth: 0,
|
|
5006
|
-
borderStyle: 'none',
|
|
5007
|
-
borderColor: 'transparent',
|
|
5008
|
-
_hover: {
|
|
5009
|
-
color: color
|
|
5010
|
-
},
|
|
5011
|
-
_active: {
|
|
5012
|
-
color: color
|
|
5013
|
-
},
|
|
5014
|
-
_focusVisible: {
|
|
5015
|
-
outline: 'none',
|
|
5016
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
4984
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
5017
4985
|
},
|
|
5018
4986
|
transition: 'opacity 0.2s ease'
|
|
5019
4987
|
},
|
|
5020
4988
|
subtle: {
|
|
5021
|
-
backgroundColor:
|
|
5022
|
-
color:
|
|
4989
|
+
backgroundColor: reversed ? "color-mix(in srgb, " + effectiveBorder + " 20%, transparent)" : "color-mix(in srgb, " + effectiveBorder + " 5%, transparent)",
|
|
4990
|
+
color: effectiveBorder,
|
|
5023
4991
|
borderWidth: 1,
|
|
5024
4992
|
borderStyle: 'solid',
|
|
5025
|
-
borderColor:
|
|
5026
|
-
paddingHorizontal: 12,
|
|
5027
|
-
paddingVertical: 6,
|
|
5028
|
-
borderRadius: 6,
|
|
5029
|
-
fontWeight: 500,
|
|
4993
|
+
borderColor: effectiveBorder,
|
|
5030
4994
|
_hover: {
|
|
5031
|
-
backgroundColor:
|
|
4995
|
+
backgroundColor: reversed ? "color-mix(in srgb, " + effectiveBorder + " 40%, transparent)" : "color-mix(in srgb, " + effectiveBorder + " 15%, transparent)"
|
|
5032
4996
|
},
|
|
5033
4997
|
_active: {
|
|
5034
|
-
backgroundColor: 'rgba(0, 0, 0, 0.
|
|
4998
|
+
backgroundColor: reversed ? 'rgba(255, 255, 255, 0.3)' : 'rgba(0, 0, 0, 0.15)'
|
|
5035
4999
|
},
|
|
5036
5000
|
_focusVisible: {
|
|
5037
5001
|
outline: 'none',
|
|
5038
|
-
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " +
|
|
5002
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + effectiveBorder
|
|
5039
5003
|
},
|
|
5040
5004
|
transition: 'all 0.2s ease'
|
|
5041
5005
|
}
|
|
5042
5006
|
};
|
|
5043
5007
|
};
|
|
5044
5008
|
|
|
5045
|
-
var _excluded$d = ["
|
|
5046
|
-
_excluded2$3 = ["
|
|
5047
|
-
_excluded3$3 = ["variant", "to", "isDisabled", "isLoading", "isAuto", "isFilled", "isExternal", "shape", "shadow", "onClick", "views", "baseStyles", "sizeStyles", "iconPad", "resolvedTextColor", "content", "size"],
|
|
5048
|
-
_excluded4$3 = ["variant", "size", "shape", "iconPosition", "loaderPosition", "backgroundColor", "color", "isAuto", "isFilled", "isDisabled", "isLoading", "isIconRounded", "icon", "children", "to", "isExternal", "shadow", "onClick", "views", "
|
|
5009
|
+
var _excluded$d = ["asComponent", "isDisabled", "isLoading", "isWrapped", "borderRadius", "width", "height", "baseStyles", "sizeStyles", "iconPad", "mainTone", "resolvedTextColor", "children", "borderWidth"],
|
|
5010
|
+
_excluded2$3 = ["shape", "isDisabled", "onClick", "shadow", "borderWidth", "isAuto", "isFilled", "views", "children"],
|
|
5011
|
+
_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"],
|
|
5012
|
+
_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"];
|
|
5049
5013
|
// --- Helper: Button Content ---
|
|
5050
5014
|
// Renders the inner content: Loader, Icon, and Children.
|
|
5051
5015
|
var ButtonContent = _ref => {
|
|
@@ -5069,176 +5033,95 @@
|
|
|
5069
5033
|
justifyContent: "center"
|
|
5070
5034
|
}, sizeStyles, iconPad, views == null ? void 0 : views.content), isLoading && loaderPosition === 'left' && (/*#__PURE__*/React__default.createElement(Loader, Object.assign({
|
|
5071
5035
|
size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
|
|
5072
|
-
color:
|
|
5036
|
+
color: resolvedTextColor
|
|
5073
5037
|
}, views == null ? void 0 : views.loader))), icon && ['left', 'top'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
5074
|
-
color:
|
|
5038
|
+
color: resolvedTextColor
|
|
5075
5039
|
}, views == null ? void 0 : views.icon), icon)), children, icon && ['right', 'bottom'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
5076
|
-
color:
|
|
5040
|
+
color: resolvedTextColor
|
|
5077
5041
|
}, views == null ? void 0 : views.icon), icon)), isLoading && loaderPosition === 'right' && (/*#__PURE__*/React__default.createElement(Loader, Object.assign({
|
|
5078
5042
|
size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
|
|
5079
|
-
color:
|
|
5043
|
+
color: resolvedTextColor
|
|
5080
5044
|
}, views == null ? void 0 : views.loader))));
|
|
5081
5045
|
};
|
|
5082
|
-
// ---
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5046
|
+
// --- Animation Logic moved to StandardButton ---
|
|
5047
|
+
// --- Variant: Standard Button ---
|
|
5048
|
+
// --- Helpers ---
|
|
5049
|
+
// Helper to calculate numeric border radius
|
|
5050
|
+
var getNumericBorderRadius = shape => {
|
|
5051
|
+
var shapeValue = ButtonShapes[shape];
|
|
5052
|
+
if (typeof shapeValue === 'number') return shapeValue;
|
|
5053
|
+
if (typeof shapeValue === 'string') return parseInt(shapeValue, 10) || 0;
|
|
5054
|
+
return 0;
|
|
5055
|
+
};
|
|
5056
|
+
// Common Inner Button Surface
|
|
5057
|
+
var InnerButton = _ref2 => {
|
|
5058
|
+
var {
|
|
5059
|
+
asComponent,
|
|
5087
5060
|
isDisabled,
|
|
5088
|
-
|
|
5089
|
-
|
|
5061
|
+
isLoading,
|
|
5062
|
+
isWrapped = false,
|
|
5063
|
+
borderRadius,
|
|
5064
|
+
width,
|
|
5065
|
+
height,
|
|
5066
|
+
baseStyles,
|
|
5067
|
+
sizeStyles,
|
|
5068
|
+
iconPad,
|
|
5090
5069
|
mainTone,
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
content,
|
|
5095
|
-
shadow
|
|
5070
|
+
resolvedTextColor,
|
|
5071
|
+
children,
|
|
5072
|
+
borderWidth = 0
|
|
5096
5073
|
} = _ref2,
|
|
5097
5074
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded$d);
|
|
5098
|
-
var sizeStyles = ButtonSizes[size];
|
|
5099
|
-
var borderWidth = 3;
|
|
5100
|
-
var numericWidth = typeof sizeStyles.width === 'number' ? sizeStyles.width : 300;
|
|
5101
|
-
var numericHeight = typeof sizeStyles.height === 'number' ? sizeStyles.height : 64;
|
|
5102
|
-
var numericBorderRadius = (() => {
|
|
5103
|
-
var shapeValue = ButtonShapes[shape];
|
|
5104
|
-
if (typeof shapeValue === 'number') {
|
|
5105
|
-
return shapeValue;
|
|
5106
|
-
}
|
|
5107
|
-
if (typeof shapeValue === 'string') {
|
|
5108
|
-
return parseInt(shapeValue, 10) || 50;
|
|
5109
|
-
}
|
|
5110
|
-
return 50;
|
|
5111
|
-
})();
|
|
5112
|
-
var containerBg = mainTone;
|
|
5113
|
-
// Use high contrast text color for this variant
|
|
5114
|
-
var borderMovingTextColor = tone === 'light' ? '#000000' : '#FFFFFF';
|
|
5115
|
-
// Create gradient string for border animation
|
|
5116
|
-
var gradientColors = borderMovingGradientColors.join(', ');
|
|
5117
|
-
// Animation sequence for the moving border effect
|
|
5118
|
-
var borderAnimation = {
|
|
5119
|
-
from: {
|
|
5120
|
-
backgroundPosition: '0% 50%'
|
|
5121
|
-
},
|
|
5122
|
-
to: {
|
|
5123
|
-
backgroundPosition: '200% 50%'
|
|
5124
|
-
},
|
|
5125
|
-
duration: borderMovingDuration + "s",
|
|
5126
|
-
timingFunction: 'linear',
|
|
5127
|
-
iterationCount: 'infinite'
|
|
5128
|
-
};
|
|
5129
5075
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
5130
|
-
|
|
5131
|
-
|
|
5076
|
+
as: asComponent,
|
|
5077
|
+
disabled: Boolean(isDisabled || isLoading),
|
|
5078
|
+
display: isWrapped ? 'flex' : 'inline-flex',
|
|
5132
5079
|
alignItems: "center",
|
|
5133
5080
|
justifyContent: "center",
|
|
5134
|
-
borderRadius:
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
alignItems: "center",
|
|
5145
|
-
justifyContent: "center",
|
|
5146
|
-
backgroundColor: containerBg,
|
|
5147
|
-
borderRadius: Math.max(0, numericBorderRadius - borderWidth),
|
|
5148
|
-
width: "100%",
|
|
5149
|
-
height: "100%",
|
|
5150
|
-
minWidth: numericWidth - borderWidth * 2,
|
|
5151
|
-
minHeight: numericHeight - borderWidth * 2,
|
|
5152
|
-
color: borderMovingTextColor,
|
|
5153
|
-
fontSize: 14,
|
|
5154
|
-
cursor: "pointer"
|
|
5155
|
-
}, content));
|
|
5081
|
+
borderRadius: borderRadius,
|
|
5082
|
+
width: width,
|
|
5083
|
+
height: height
|
|
5084
|
+
}, baseStyles, sizeStyles, iconPad, {
|
|
5085
|
+
// Ensure background is solid for wrapped buttons if baseStyles doesn't provide it
|
|
5086
|
+
backgroundColor: (baseStyles == null ? void 0 : baseStyles.backgroundColor) || (isWrapped ? mainTone : undefined),
|
|
5087
|
+
color: resolvedTextColor,
|
|
5088
|
+
borderWidth: isWrapped ? 0 : undefined,
|
|
5089
|
+
cursor: isDisabled ? 'default' : 'pointer'
|
|
5090
|
+
}, props), children);
|
|
5156
5091
|
};
|
|
5157
|
-
//
|
|
5158
|
-
var
|
|
5092
|
+
// Common Header for Border Animations
|
|
5093
|
+
var BorderWrapper = _ref3 => {
|
|
5159
5094
|
var {
|
|
5160
|
-
|
|
5095
|
+
shape,
|
|
5096
|
+
isDisabled,
|
|
5161
5097
|
onClick,
|
|
5098
|
+
shadow,
|
|
5099
|
+
borderWidth,
|
|
5100
|
+
isAuto,
|
|
5101
|
+
isFilled,
|
|
5162
5102
|
views,
|
|
5163
|
-
children
|
|
5164
|
-
size = 'md',
|
|
5165
|
-
accentColor,
|
|
5166
|
-
textColor,
|
|
5167
|
-
getColor,
|
|
5168
|
-
shadow
|
|
5103
|
+
children
|
|
5169
5104
|
} = _ref3,
|
|
5170
5105
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);
|
|
5171
|
-
var resolvedAccentColor = getColor(accentColor);
|
|
5172
|
-
var resolvedTextColor = getColor(textColor);
|
|
5173
|
-
var sizeStyles = ButtonSizes[size];
|
|
5174
|
-
var numericWidth = typeof sizeStyles.width === 'number' ? sizeStyles.width : 300;
|
|
5175
|
-
var numericHeight = typeof sizeStyles.height === 'number' ? sizeStyles.height : 60;
|
|
5176
|
-
var strokeAnimation = {
|
|
5177
|
-
from: {
|
|
5178
|
-
strokeWidth: '8px',
|
|
5179
|
-
strokeDasharray: '0 500',
|
|
5180
|
-
strokeDashoffset: -454
|
|
5181
|
-
},
|
|
5182
|
-
to: {
|
|
5183
|
-
strokeWidth: '3px',
|
|
5184
|
-
strokeDasharray: '760',
|
|
5185
|
-
strokeDashoffset: 0
|
|
5186
|
-
},
|
|
5187
|
-
duration: '0.9s',
|
|
5188
|
-
timingFunction: 'ease-in',
|
|
5189
|
-
fillMode: 'forwards'
|
|
5190
|
-
};
|
|
5191
5106
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
5192
|
-
as:
|
|
5193
|
-
href: to ? to : undefined,
|
|
5194
|
-
onClick: onClick,
|
|
5195
|
-
display: "inline-block",
|
|
5196
|
-
maxWidth: "20rem",
|
|
5197
|
-
margin: "0 auto",
|
|
5198
|
-
textAlign: "center",
|
|
5199
|
-
textDecoration: "none",
|
|
5107
|
+
as: "div",
|
|
5200
5108
|
position: "relative",
|
|
5201
|
-
|
|
5202
|
-
boxShadow: shadow
|
|
5203
|
-
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
5204
|
-
as: "svg",
|
|
5205
|
-
display: "block",
|
|
5206
|
-
height: numericHeight,
|
|
5207
|
-
width: numericWidth,
|
|
5208
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
5209
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
5210
|
-
as: "rect",
|
|
5211
|
-
height: numericHeight,
|
|
5212
|
-
width: numericWidth,
|
|
5213
|
-
fill: "transparent",
|
|
5214
|
-
stroke: resolvedAccentColor,
|
|
5215
|
-
strokeWidth: "8px",
|
|
5216
|
-
strokeDasharray: "0 500",
|
|
5217
|
-
strokeDashoffset: -454,
|
|
5218
|
-
on: {
|
|
5219
|
-
hover: {
|
|
5220
|
-
animate: strokeAnimation
|
|
5221
|
-
}
|
|
5222
|
-
}
|
|
5223
|
-
})), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
5224
|
-
position: "absolute",
|
|
5225
|
-
top: 0,
|
|
5226
|
-
right: 0,
|
|
5227
|
-
bottom: 0,
|
|
5228
|
-
left: 0,
|
|
5229
|
-
display: "flex",
|
|
5109
|
+
display: "inline-flex",
|
|
5230
5110
|
alignItems: "center",
|
|
5231
5111
|
justifyContent: "center",
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5112
|
+
borderRadius: ButtonShapes[shape],
|
|
5113
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
5114
|
+
onClick: onClick,
|
|
5115
|
+
boxShadow: shadow,
|
|
5116
|
+
padding: borderWidth,
|
|
5117
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : undefined
|
|
5118
|
+
}, views == null ? void 0 : views.container, props), children);
|
|
5237
5119
|
};
|
|
5238
5120
|
// --- Variant: Standard Button ---
|
|
5239
5121
|
var StandardButton = _ref4 => {
|
|
5240
5122
|
var {
|
|
5241
5123
|
variant,
|
|
5124
|
+
animation,
|
|
5242
5125
|
to,
|
|
5243
5126
|
isDisabled,
|
|
5244
5127
|
isLoading,
|
|
@@ -5252,9 +5135,220 @@
|
|
|
5252
5135
|
baseStyles,
|
|
5253
5136
|
sizeStyles,
|
|
5254
5137
|
iconPad,
|
|
5255
|
-
|
|
5138
|
+
resolvedTextColor,
|
|
5139
|
+
content,
|
|
5140
|
+
mainTone,
|
|
5141
|
+
borderMovingDuration = 2,
|
|
5142
|
+
borderMovingGradientColors = ['#705CFF', '#FF5C97', '#FFC75C'],
|
|
5143
|
+
animatedStrokeAccentColor = '#705CFF',
|
|
5144
|
+
animatedStrokeTextColor = '#333333',
|
|
5145
|
+
getColor = c => c
|
|
5256
5146
|
} = _ref4,
|
|
5257
5147
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded3$3);
|
|
5148
|
+
// --- Common Helpers ---
|
|
5149
|
+
var numericBorderRadius = getNumericBorderRadius(shape);
|
|
5150
|
+
var linkOrContent = to ? (/*#__PURE__*/React__default.createElement(Link, Object.assign({
|
|
5151
|
+
to: to,
|
|
5152
|
+
isExternal: isExternal,
|
|
5153
|
+
color: "currentColor",
|
|
5154
|
+
textDecoration: "inherit",
|
|
5155
|
+
_hover: {
|
|
5156
|
+
color: 'currentColor'
|
|
5157
|
+
}
|
|
5158
|
+
}, views == null ? void 0 : views.link), content)) : content;
|
|
5159
|
+
var innerProps = {
|
|
5160
|
+
isDisabled,
|
|
5161
|
+
isLoading,
|
|
5162
|
+
baseStyles,
|
|
5163
|
+
sizeStyles,
|
|
5164
|
+
iconPad,
|
|
5165
|
+
resolvedTextColor,
|
|
5166
|
+
mainTone,
|
|
5167
|
+
children: linkOrContent
|
|
5168
|
+
};
|
|
5169
|
+
// --- Animation: Border Moving ---
|
|
5170
|
+
if (animation === 'borderMoving' && borderMovingGradientColors) {
|
|
5171
|
+
var borderWidth = 3;
|
|
5172
|
+
var borderAnimation = {
|
|
5173
|
+
from: {
|
|
5174
|
+
backgroundPosition: '0% 50%'
|
|
5175
|
+
},
|
|
5176
|
+
to: {
|
|
5177
|
+
backgroundPosition: '200% 50%'
|
|
5178
|
+
},
|
|
5179
|
+
duration: borderMovingDuration + "s",
|
|
5180
|
+
timingFunction: 'linear',
|
|
5181
|
+
iterationCount: 'infinite'
|
|
5182
|
+
};
|
|
5183
|
+
return /*#__PURE__*/React__default.createElement(BorderWrapper, Object.assign({
|
|
5184
|
+
shape: shape,
|
|
5185
|
+
isDisabled: isDisabled,
|
|
5186
|
+
onClick: onClick,
|
|
5187
|
+
shadow: shadow,
|
|
5188
|
+
borderWidth: borderWidth,
|
|
5189
|
+
isAuto: isAuto,
|
|
5190
|
+
isFilled: isFilled,
|
|
5191
|
+
views: views,
|
|
5192
|
+
background: "linear-gradient(90deg, " + borderMovingGradientColors[0] + ", " + borderMovingGradientColors[1] + ", " + borderMovingGradientColors[2] + ", " + borderMovingGradientColors[0] + ")",
|
|
5193
|
+
backgroundSize: "200% 100%",
|
|
5194
|
+
animate: borderAnimation
|
|
5195
|
+
}, props), /*#__PURE__*/React__default.createElement(InnerButton, Object.assign({
|
|
5196
|
+
asComponent: to ? 'div' : 'button',
|
|
5197
|
+
isWrapped: true,
|
|
5198
|
+
borderRadius: Math.max(0, numericBorderRadius - borderWidth),
|
|
5199
|
+
width: "100%",
|
|
5200
|
+
height: "100%"
|
|
5201
|
+
}, innerProps)));
|
|
5202
|
+
}
|
|
5203
|
+
// --- Animation: Animated Stroke ---
|
|
5204
|
+
if (animation === 'animatedStroke') {
|
|
5205
|
+
var _views$container;
|
|
5206
|
+
var resolvedAccentColor = getColor(animatedStrokeAccentColor);
|
|
5207
|
+
var resolvedStrokeTextColor = getColor(animatedStrokeTextColor);
|
|
5208
|
+
var strokePathLength = 1000;
|
|
5209
|
+
var strokeAnimation = {
|
|
5210
|
+
from: {
|
|
5211
|
+
strokeWidth: '8px',
|
|
5212
|
+
strokeDasharray: "0 " + strokePathLength,
|
|
5213
|
+
strokeDashoffset: -Math.round(strokePathLength * 0.63)
|
|
5214
|
+
},
|
|
5215
|
+
to: {
|
|
5216
|
+
strokeWidth: '3px',
|
|
5217
|
+
strokeDasharray: "" + strokePathLength,
|
|
5218
|
+
strokeDashoffset: 0
|
|
5219
|
+
},
|
|
5220
|
+
duration: '0.9s',
|
|
5221
|
+
timingFunction: 'ease-in',
|
|
5222
|
+
fillMode: 'forwards'
|
|
5223
|
+
};
|
|
5224
|
+
var mergedClassName = ['group', views == null || (_views$container = views.container) == null ? void 0 : _views$container.className, props == null ? void 0 : props.className].filter(Boolean).join(' ');
|
|
5225
|
+
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
5226
|
+
as: to ? 'div' : 'button',
|
|
5227
|
+
type: to ? undefined : 'button',
|
|
5228
|
+
disabled: Boolean(!to && (isDisabled || isLoading)),
|
|
5229
|
+
onClick: onClick,
|
|
5230
|
+
position: "relative",
|
|
5231
|
+
display: "inline-flex",
|
|
5232
|
+
alignItems: "center",
|
|
5233
|
+
justifyContent: "center",
|
|
5234
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : undefined,
|
|
5235
|
+
borderRadius: ButtonShapes[shape],
|
|
5236
|
+
boxShadow: shadow,
|
|
5237
|
+
transition: "all 0.2s ease",
|
|
5238
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
5239
|
+
color: resolvedStrokeTextColor,
|
|
5240
|
+
backgroundColor: "transparent",
|
|
5241
|
+
borderWidth: 0
|
|
5242
|
+
}, views == null ? void 0 : views.container, props, {
|
|
5243
|
+
className: mergedClassName
|
|
5244
|
+
}), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
5245
|
+
as: "svg",
|
|
5246
|
+
position: "absolute",
|
|
5247
|
+
top: 0,
|
|
5248
|
+
right: 0,
|
|
5249
|
+
bottom: 0,
|
|
5250
|
+
left: 0,
|
|
5251
|
+
width: "100%",
|
|
5252
|
+
height: "100%",
|
|
5253
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5254
|
+
pointerEvents: "none",
|
|
5255
|
+
zIndex: 1,
|
|
5256
|
+
"aria-hidden": "true"
|
|
5257
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
5258
|
+
as: "rect",
|
|
5259
|
+
x: "0",
|
|
5260
|
+
y: "0",
|
|
5261
|
+
height: "100%",
|
|
5262
|
+
width: "100%",
|
|
5263
|
+
rx: numericBorderRadius,
|
|
5264
|
+
ry: numericBorderRadius,
|
|
5265
|
+
fill: "transparent",
|
|
5266
|
+
stroke: resolvedAccentColor,
|
|
5267
|
+
strokeWidth: "8px",
|
|
5268
|
+
strokeDasharray: "0 " + strokePathLength,
|
|
5269
|
+
strokeDashoffset: -Math.round(strokePathLength * 0.63),
|
|
5270
|
+
pathLength: strokePathLength,
|
|
5271
|
+
on: {
|
|
5272
|
+
groupHover: {
|
|
5273
|
+
animate: strokeAnimation
|
|
5274
|
+
}
|
|
5275
|
+
}
|
|
5276
|
+
})), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
5277
|
+
position: "relative",
|
|
5278
|
+
zIndex: 0
|
|
5279
|
+
}, linkOrContent));
|
|
5280
|
+
}
|
|
5281
|
+
// --- Animation: Border Reveal ---
|
|
5282
|
+
if (animation === 'borderReveal') {
|
|
5283
|
+
var _borderWidth = 3;
|
|
5284
|
+
// Use the first color from gradient colors or fall back to mainTone
|
|
5285
|
+
var activeColor = (borderMovingGradientColors == null ? void 0 : borderMovingGradientColors[0]) || mainTone || '#000000';
|
|
5286
|
+
// Sides duration
|
|
5287
|
+
// The default duration (2s) is too slow for a hover interaction.
|
|
5288
|
+
// We scale it by 0.25 to make it responsive (0.5s total).
|
|
5289
|
+
var effectiveDuration = borderMovingDuration * 0.75;
|
|
5290
|
+
var sideDuration = effectiveDuration / 4;
|
|
5291
|
+
// Gradients for each side (color 50%, transparent 50%)
|
|
5292
|
+
var topGrad = "linear-gradient(90deg, " + activeColor + " 50%, transparent 50%)";
|
|
5293
|
+
var rightGrad = "linear-gradient(180deg, " + activeColor + " 50%, transparent 50%)";
|
|
5294
|
+
var bottomGrad = "linear-gradient(270deg, " + activeColor + " 50%, transparent 50%)";
|
|
5295
|
+
var leftGrad = "linear-gradient(0deg, " + activeColor + " 50%, transparent 50%)";
|
|
5296
|
+
// Coordinates:
|
|
5297
|
+
// Top (L->R): 100% 0 -> 0 0
|
|
5298
|
+
// Right (T->B): 100% 100% -> 100% 0
|
|
5299
|
+
// Bottom (R->L): 0 100% -> 100% 100%
|
|
5300
|
+
// Left (B->T): 0 0 -> 0 100%
|
|
5301
|
+
var bgPosStart = "100% 0, 100% 100%, 0 100%, 0 0";
|
|
5302
|
+
var bgPosEnd = "0 0, 100% 0, 100% 100%, 0 100%";
|
|
5303
|
+
// Delays:
|
|
5304
|
+
// Enter (Forward): Top(0), Right(1), Bottom(2), Left(3)
|
|
5305
|
+
var delayEnter = "0s, " + sideDuration + "s, " + sideDuration * 2 + "s, " + sideDuration * 2 + "s";
|
|
5306
|
+
// Exit (Reverse): Top(3), Right(2), Bottom(1), Left(0)
|
|
5307
|
+
var delayExit = sideDuration * 2 + "s, " + sideDuration * 2 + "s, " + sideDuration + "s, 0s";
|
|
5308
|
+
// Use slightly larger gradient size to overlap with button content (avoid gaps)
|
|
5309
|
+
var gradientSize = _borderWidth + 1;
|
|
5310
|
+
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
5311
|
+
as: "div",
|
|
5312
|
+
position: "relative",
|
|
5313
|
+
display: "inline-flex",
|
|
5314
|
+
alignItems: "center",
|
|
5315
|
+
justifyContent: "center",
|
|
5316
|
+
borderRadius: ButtonShapes[shape],
|
|
5317
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
5318
|
+
onClick: onClick,
|
|
5319
|
+
boxShadow: shadow,
|
|
5320
|
+
padding: _borderWidth,
|
|
5321
|
+
background: "\n " + topGrad + " no-repeat,\n " + rightGrad + " no-repeat,\n " + bottomGrad + " no-repeat,\n " + leftGrad + " no-repeat\n ",
|
|
5322
|
+
backgroundSize: "200% " + gradientSize + "px, " + gradientSize + "px 200%, 200% " + gradientSize + "px, " + gradientSize + "px 200%",
|
|
5323
|
+
// Default State (Hidden)
|
|
5324
|
+
backgroundPosition: bgPosStart,
|
|
5325
|
+
transitionProperty: "background-position",
|
|
5326
|
+
transitionDuration: sideDuration + "s",
|
|
5327
|
+
transitionTimingFunction: "linear",
|
|
5328
|
+
transitionDelay: delayExit,
|
|
5329
|
+
// Hover State (Visible)
|
|
5330
|
+
_hover: {
|
|
5331
|
+
backgroundPosition: bgPosEnd,
|
|
5332
|
+
transitionDelay: delayEnter
|
|
5333
|
+
},
|
|
5334
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : undefined
|
|
5335
|
+
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
5336
|
+
as: to ? 'div' : 'button',
|
|
5337
|
+
disabled: Boolean(isDisabled || isLoading),
|
|
5338
|
+
display: "flex",
|
|
5339
|
+
alignItems: "center",
|
|
5340
|
+
justifyContent: "center",
|
|
5341
|
+
borderRadius: Math.max(0, numericBorderRadius - _borderWidth),
|
|
5342
|
+
width: "100%",
|
|
5343
|
+
height: "100%"
|
|
5344
|
+
}, baseStyles, sizeStyles, iconPad, {
|
|
5345
|
+
backgroundColor: (baseStyles == null ? void 0 : baseStyles.backgroundColor) || mainTone,
|
|
5346
|
+
color: resolvedTextColor,
|
|
5347
|
+
borderWidth: 0,
|
|
5348
|
+
cursor: isDisabled ? 'default' : 'pointer'
|
|
5349
|
+
}), linkOrContent));
|
|
5350
|
+
}
|
|
5351
|
+
// --- Default: Standard Button ---
|
|
5258
5352
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
5259
5353
|
as: variant === 'link' && to ? 'div' : 'button',
|
|
5260
5354
|
type: variant === 'link' && to ? undefined : 'button',
|
|
@@ -5270,19 +5364,12 @@
|
|
|
5270
5364
|
transition: "all 0.2s ease",
|
|
5271
5365
|
cursor: isDisabled ? 'default' : 'pointer',
|
|
5272
5366
|
onClick: onClick
|
|
5273
|
-
}, baseStyles, views == null ? void 0 : views.container, props),
|
|
5274
|
-
to: to,
|
|
5275
|
-
isExternal: isExternal,
|
|
5276
|
-
color: "currentColor",
|
|
5277
|
-
textDecoration: "inherit",
|
|
5278
|
-
_hover: {
|
|
5279
|
-
color: 'currentColor'
|
|
5280
|
-
}
|
|
5281
|
-
}, views == null ? void 0 : views.link), content)) : content);
|
|
5367
|
+
}, baseStyles, views == null ? void 0 : views.container, props), linkOrContent);
|
|
5282
5368
|
};
|
|
5283
5369
|
// --- Main Component ---
|
|
5370
|
+
// --- Main Component ---
|
|
5284
5371
|
var ButtonView = _ref5 => {
|
|
5285
|
-
var _ref6, _base$color;
|
|
5372
|
+
var _ref6, _ref7, _base$color;
|
|
5286
5373
|
var {
|
|
5287
5374
|
/* behaviour */
|
|
5288
5375
|
variant = 'filled',
|
|
@@ -5294,6 +5381,10 @@
|
|
|
5294
5381
|
// primary candidate for main color
|
|
5295
5382
|
color,
|
|
5296
5383
|
// 2nd candidate for main color (NOT text‑color)
|
|
5384
|
+
scheme,
|
|
5385
|
+
// New scheme prop
|
|
5386
|
+
reversed = false,
|
|
5387
|
+
// New reversed prop
|
|
5297
5388
|
isAuto = true,
|
|
5298
5389
|
isFilled,
|
|
5299
5390
|
isDisabled,
|
|
@@ -5309,7 +5400,6 @@
|
|
|
5309
5400
|
shadow,
|
|
5310
5401
|
onClick,
|
|
5311
5402
|
views = {},
|
|
5312
|
-
themeMode: elementMode,
|
|
5313
5403
|
/* effect props */
|
|
5314
5404
|
borderMovingDuration = 2,
|
|
5315
5405
|
borderMovingGradientColors = ['#705CFF', '#FF5C97', '#FFC75C'],
|
|
@@ -5319,20 +5409,22 @@
|
|
|
5319
5409
|
props = _objectWithoutPropertiesLoose(_ref5, _excluded4$3);
|
|
5320
5410
|
/* theme helpers */
|
|
5321
5411
|
var {
|
|
5322
|
-
|
|
5412
|
+
getColorHex,
|
|
5323
5413
|
themeMode
|
|
5324
5414
|
} = appStudio.useTheme();
|
|
5325
|
-
var mode = elementMode != null ? elementMode : themeMode;
|
|
5326
5415
|
/* MAIN COLOR – determines the entire palette */
|
|
5327
|
-
var mainColorKey = (_ref6 = backgroundColor != null ? backgroundColor : color) != null ? _ref6 : 'theme.primary';
|
|
5328
|
-
var mainTone =
|
|
5329
|
-
themeMode: mode
|
|
5330
|
-
});
|
|
5416
|
+
var mainColorKey = (_ref6 = (_ref7 = backgroundColor != null ? backgroundColor : color) != null ? _ref7 : scheme) != null ? _ref6 : 'theme.primary';
|
|
5417
|
+
var mainTone = getColorHex(isDisabled ? 'theme.disabled' : mainColorKey);
|
|
5331
5418
|
var tone = contrast(mainTone);
|
|
5332
5419
|
/* text color with mixBlendMode for maximum visibility */
|
|
5333
|
-
var textColor
|
|
5420
|
+
var textColor;
|
|
5421
|
+
if (tone === 'light') {
|
|
5422
|
+
textColor = '#000000';
|
|
5423
|
+
} else {
|
|
5424
|
+
textColor = '#FFFFFF';
|
|
5425
|
+
}
|
|
5334
5426
|
/* variant palette */
|
|
5335
|
-
var palette = React.useMemo(() => getButtonVariants(mainTone, tone === 'light'), [mainTone, tone,
|
|
5427
|
+
var palette = React.useMemo(() => getButtonVariants(mainTone, tone === 'light', reversed), [mainTone, tone, reversed]);
|
|
5336
5428
|
var base = palette[variant];
|
|
5337
5429
|
var resolvedTextColor = (_base$color = base == null ? void 0 : base.color) != null ? _base$color : textColor;
|
|
5338
5430
|
// Render content logic safely
|
|
@@ -5346,39 +5438,12 @@
|
|
|
5346
5438
|
isIconRounded: isIconRounded,
|
|
5347
5439
|
views: views
|
|
5348
5440
|
}, children);
|
|
5349
|
-
// Dispatch to the correct variant component
|
|
5350
|
-
if (variant === 'borderMoving') {
|
|
5351
|
-
return /*#__PURE__*/React__default.createElement(BorderMovingButton, Object.assign({
|
|
5352
|
-
variant: variant,
|
|
5353
|
-
shape: shape,
|
|
5354
|
-
size: size,
|
|
5355
|
-
isDisabled: isDisabled,
|
|
5356
|
-
onClick: onClick,
|
|
5357
|
-
views: views,
|
|
5358
|
-
mainTone: mainTone,
|
|
5359
|
-
tone: tone,
|
|
5360
|
-
borderMovingGradientColors: borderMovingGradientColors,
|
|
5361
|
-
borderMovingDuration: borderMovingDuration,
|
|
5362
|
-
content: content
|
|
5363
|
-
}, props));
|
|
5364
|
-
}
|
|
5365
|
-
if (variant === 'animatedStroke') {
|
|
5366
|
-
return /*#__PURE__*/React__default.createElement(AnimatedStrokeButton, Object.assign({
|
|
5367
|
-
variant: variant,
|
|
5368
|
-
to: to,
|
|
5369
|
-
onClick: onClick,
|
|
5370
|
-
views: views,
|
|
5371
|
-
size: size,
|
|
5372
|
-
accentColor: animatedStrokeAccentColor,
|
|
5373
|
-
textColor: animatedStrokeTextColor,
|
|
5374
|
-
getColor: getColor
|
|
5375
|
-
}, props), children);
|
|
5376
|
-
}
|
|
5377
5441
|
// Standard variants (filled, outline, ghost, link)
|
|
5378
5442
|
var sizeStyles = ButtonSizes[size];
|
|
5379
5443
|
var iconPad = isIconRounded ? IconSizes$1[size] : {};
|
|
5380
5444
|
return /*#__PURE__*/React__default.createElement(StandardButton, Object.assign({
|
|
5381
5445
|
variant: variant,
|
|
5446
|
+
animation: props.animation,
|
|
5382
5447
|
to: to,
|
|
5383
5448
|
isDisabled: isDisabled,
|
|
5384
5449
|
isLoading: isLoading,
|
|
@@ -5394,7 +5459,14 @@
|
|
|
5394
5459
|
iconPad: iconPad,
|
|
5395
5460
|
resolvedTextColor: resolvedTextColor,
|
|
5396
5461
|
content: content,
|
|
5397
|
-
size: size
|
|
5462
|
+
size: size,
|
|
5463
|
+
mainTone: mainTone,
|
|
5464
|
+
tone: tone,
|
|
5465
|
+
borderMovingDuration: borderMovingDuration,
|
|
5466
|
+
borderMovingGradientColors: borderMovingGradientColors,
|
|
5467
|
+
animatedStrokeAccentColor: animatedStrokeAccentColor,
|
|
5468
|
+
animatedStrokeTextColor: animatedStrokeTextColor,
|
|
5469
|
+
getColor: getColorHex
|
|
5398
5470
|
}, props));
|
|
5399
5471
|
};
|
|
5400
5472
|
|
|
@@ -16585,16 +16657,16 @@
|
|
|
16585
16657
|
} = _ref,
|
|
16586
16658
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$S);
|
|
16587
16659
|
var {
|
|
16588
|
-
|
|
16660
|
+
getColorHex,
|
|
16589
16661
|
themeMode
|
|
16590
16662
|
} = appStudio.useTheme();
|
|
16591
|
-
var themeColor =
|
|
16663
|
+
var themeColor = getColorHex(backgroundColor, {
|
|
16592
16664
|
themeMode: elementMode || themeMode
|
|
16593
16665
|
});
|
|
16594
|
-
var disabledColor =
|
|
16666
|
+
var disabledColor = getColorHex('theme.disabled', {
|
|
16595
16667
|
themeMode: elementMode || themeMode
|
|
16596
16668
|
});
|
|
16597
|
-
var trackColor =
|
|
16669
|
+
var trackColor = getColorHex(SliderVariants[variant].backgroundColor, {
|
|
16598
16670
|
themeMode: elementMode || themeMode
|
|
16599
16671
|
});
|
|
16600
16672
|
var isVertical = orientation === 'vertical';
|
|
@@ -16766,7 +16838,7 @@
|
|
|
16766
16838
|
height: thumbSize + "px",
|
|
16767
16839
|
borderRadius: "50%",
|
|
16768
16840
|
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
16769
|
-
border: "2px solid
|
|
16841
|
+
border: "2px solid color.white",
|
|
16770
16842
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
|
|
16771
16843
|
cursor: isDisabled ? 'not-allowed' : 'grab',
|
|
16772
16844
|
transform: isVertical ? 'translateX(-50%)' : 'translateY(-50%)',
|
|
@@ -16785,8 +16857,8 @@
|
|
|
16785
16857
|
}, views == null ? void 0 : views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
16786
16858
|
position: "absolute",
|
|
16787
16859
|
padding: "4px 8px",
|
|
16788
|
-
backgroundColor:
|
|
16789
|
-
color:
|
|
16860
|
+
backgroundColor: 'color.black',
|
|
16861
|
+
color: 'color.white',
|
|
16790
16862
|
borderRadius: "4px",
|
|
16791
16863
|
whiteSpace: "nowrap",
|
|
16792
16864
|
zIndex: 3
|
|
@@ -19084,20 +19156,16 @@
|
|
|
19084
19156
|
// xl maps to H1 - Largest heading
|
|
19085
19157
|
xl: {
|
|
19086
19158
|
fontWeight: 500,
|
|
19087
|
-
marginBottom: 20,
|
|
19088
19159
|
letterSpacing: 1.25,
|
|
19089
19160
|
media: {
|
|
19090
19161
|
mobile: {
|
|
19091
|
-
fontSize:
|
|
19092
|
-
width: '100%'
|
|
19162
|
+
fontSize: 60
|
|
19093
19163
|
},
|
|
19094
19164
|
tablet: {
|
|
19095
|
-
fontSize:
|
|
19096
|
-
width: '100%'
|
|
19165
|
+
fontSize: 60
|
|
19097
19166
|
},
|
|
19098
19167
|
desktop: {
|
|
19099
|
-
fontSize:
|
|
19100
|
-
minWidth: '60%'
|
|
19168
|
+
fontSize: 96
|
|
19101
19169
|
}
|
|
19102
19170
|
}
|
|
19103
19171
|
},
|
|
@@ -19106,13 +19174,13 @@
|
|
|
19106
19174
|
fontWeight: 500,
|
|
19107
19175
|
media: {
|
|
19108
19176
|
mobile: {
|
|
19109
|
-
fontSize:
|
|
19177
|
+
fontSize: 48
|
|
19110
19178
|
},
|
|
19111
19179
|
tablet: {
|
|
19112
|
-
fontSize:
|
|
19180
|
+
fontSize: 48
|
|
19113
19181
|
},
|
|
19114
19182
|
desktop: {
|
|
19115
|
-
fontSize:
|
|
19183
|
+
fontSize: 70
|
|
19116
19184
|
}
|
|
19117
19185
|
}
|
|
19118
19186
|
},
|
|
@@ -19121,13 +19189,13 @@
|
|
|
19121
19189
|
fontWeight: 500,
|
|
19122
19190
|
media: {
|
|
19123
19191
|
mobile: {
|
|
19124
|
-
fontSize:
|
|
19192
|
+
fontSize: 32
|
|
19125
19193
|
},
|
|
19126
19194
|
tablet: {
|
|
19127
|
-
fontSize:
|
|
19195
|
+
fontSize: 40
|
|
19128
19196
|
},
|
|
19129
19197
|
desktop: {
|
|
19130
|
-
fontSize:
|
|
19198
|
+
fontSize: 56
|
|
19131
19199
|
}
|
|
19132
19200
|
}
|
|
19133
19201
|
},
|
|
@@ -19137,10 +19205,10 @@
|
|
|
19137
19205
|
letterSpacing: -0.2,
|
|
19138
19206
|
media: {
|
|
19139
19207
|
mobile: {
|
|
19140
|
-
fontSize:
|
|
19208
|
+
fontSize: 20
|
|
19141
19209
|
},
|
|
19142
19210
|
tablet: {
|
|
19143
|
-
fontSize:
|
|
19211
|
+
fontSize: 24
|
|
19144
19212
|
},
|
|
19145
19213
|
desktop: {
|
|
19146
19214
|
fontSize: 32
|
|
@@ -19153,13 +19221,13 @@
|
|
|
19153
19221
|
letterSpacing: -0.2,
|
|
19154
19222
|
media: {
|
|
19155
19223
|
mobile: {
|
|
19156
|
-
fontSize:
|
|
19224
|
+
fontSize: 14
|
|
19157
19225
|
},
|
|
19158
19226
|
tablet: {
|
|
19159
19227
|
fontSize: 18
|
|
19160
19228
|
},
|
|
19161
19229
|
desktop: {
|
|
19162
|
-
fontSize:
|
|
19230
|
+
fontSize: 20
|
|
19163
19231
|
}
|
|
19164
19232
|
}
|
|
19165
19233
|
}
|
|
@@ -19201,7 +19269,7 @@
|
|
|
19201
19269
|
})
|
|
19202
19270
|
};
|
|
19203
19271
|
|
|
19204
|
-
var _excluded$Z = ["text", "typingSpeed", "pauseTime", "onComplete", "showCursor", "cursorColor", "textStyle", "as"];
|
|
19272
|
+
var _excluded$Z = ["text", "typingSpeed", "pauseTime", "onComplete", "showCursor", "cursorColor", "textStyle", "textComponent", "as"];
|
|
19205
19273
|
/**
|
|
19206
19274
|
* A component that creates a typewriter effect for text
|
|
19207
19275
|
*/
|
|
@@ -19213,9 +19281,11 @@
|
|
|
19213
19281
|
onComplete,
|
|
19214
19282
|
showCursor = true,
|
|
19215
19283
|
cursorColor = 'currentColor',
|
|
19216
|
-
textStyle
|
|
19284
|
+
textStyle,
|
|
19285
|
+
textComponent
|
|
19217
19286
|
} = _ref,
|
|
19218
19287
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$Z);
|
|
19288
|
+
var TextComponent = textComponent || appStudio.Text;
|
|
19219
19289
|
// Convert text to array if it's a string
|
|
19220
19290
|
var textArray = Array.isArray(text) ? text : [text];
|
|
19221
19291
|
// State for the currently displayed text
|
|
@@ -19268,7 +19338,7 @@
|
|
|
19268
19338
|
}, [textArray, currentTextIndex, charIndex, isComplete, onComplete, pauseTime, typingSpeed]);
|
|
19269
19339
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, displayedText.map((text, index) => (/*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
19270
19340
|
key: index
|
|
19271
|
-
}, text, showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React__default.createElement(
|
|
19341
|
+
}, text, showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
|
|
19272
19342
|
as: "span",
|
|
19273
19343
|
display: "inline-block",
|
|
19274
19344
|
width: "0.1em",
|
|
@@ -19281,7 +19351,7 @@
|
|
|
19281
19351
|
}, textStyle))))))));
|
|
19282
19352
|
};
|
|
19283
19353
|
|
|
19284
|
-
var _excluded$_ = ["text", "duration", "direction", "stagger", "sequential", "textStyle", "as", "wordProps"],
|
|
19354
|
+
var _excluded$_ = ["text", "duration", "direction", "stagger", "sequential", "textStyle", "as", "wordProps", "textComponent"],
|
|
19285
19355
|
_excluded2$g = ["style"];
|
|
19286
19356
|
var SlideEffect = _ref => {
|
|
19287
19357
|
var {
|
|
@@ -19291,12 +19361,14 @@
|
|
|
19291
19361
|
stagger = 50,
|
|
19292
19362
|
sequential = false,
|
|
19293
19363
|
textStyle,
|
|
19294
|
-
wordProps
|
|
19364
|
+
wordProps,
|
|
19365
|
+
textComponent
|
|
19295
19366
|
} = _ref,
|
|
19296
19367
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$_);
|
|
19297
19368
|
var [displayedText, setDisplayedText] = React.useState(text);
|
|
19298
19369
|
var [phase, setPhase] = React.useState('entering');
|
|
19299
19370
|
var [animKey, setAnimKey] = React.useState(0);
|
|
19371
|
+
var TextComponent = textComponent || appStudio.Text;
|
|
19300
19372
|
var pendingTextRef = React.useRef(null);
|
|
19301
19373
|
var timeoutRef = React.useRef(null);
|
|
19302
19374
|
// Handle text changes
|
|
@@ -19450,7 +19522,7 @@
|
|
|
19450
19522
|
transform: phase === 'visible' ? 'translateY(0)' : undefined,
|
|
19451
19523
|
opacity: phase === 'visible' ? 1 : undefined
|
|
19452
19524
|
});
|
|
19453
|
-
return /*#__PURE__*/React__default.createElement(
|
|
19525
|
+
return /*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
|
|
19454
19526
|
key: animKey + "-" + index,
|
|
19455
19527
|
as: "span",
|
|
19456
19528
|
animate: wordAnimation
|
|
@@ -19458,7 +19530,7 @@
|
|
|
19458
19530
|
})));
|
|
19459
19531
|
};
|
|
19460
19532
|
|
|
19461
|
-
var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential", "themeMode"];
|
|
19533
|
+
var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential", "themeMode", "textComponent"];
|
|
19462
19534
|
function escapeRegExp(string) {
|
|
19463
19535
|
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
19464
19536
|
}
|
|
@@ -19482,7 +19554,8 @@
|
|
|
19482
19554
|
highlightSlideDuration = 500,
|
|
19483
19555
|
highlightSlideStagger = 50,
|
|
19484
19556
|
highlightSlideSequential = true,
|
|
19485
|
-
themeMode: elementMode
|
|
19557
|
+
themeMode: elementMode,
|
|
19558
|
+
textComponent
|
|
19486
19559
|
} = _ref,
|
|
19487
19560
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$$);
|
|
19488
19561
|
var {
|
|
@@ -19536,6 +19609,7 @@
|
|
|
19536
19609
|
highlightSlideStagger,
|
|
19537
19610
|
highlightSlideSequential
|
|
19538
19611
|
}, props));
|
|
19612
|
+
var TextComponent = textComponent || appStudio.Text;
|
|
19539
19613
|
// Common style calculations
|
|
19540
19614
|
var useResponsive = responsive && !props.media;
|
|
19541
19615
|
var fontSize = TitleSizes[size];
|
|
@@ -19584,8 +19658,8 @@
|
|
|
19584
19658
|
return /*#__PURE__*/React__default.createElement(TypewriterEffect, Object.assign({
|
|
19585
19659
|
text: content,
|
|
19586
19660
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (content.length * 10)),
|
|
19587
|
-
|
|
19588
|
-
|
|
19661
|
+
cursorColor: "currentColor",
|
|
19662
|
+
textComponent: TextComponent
|
|
19589
19663
|
}, highlightProps));
|
|
19590
19664
|
}
|
|
19591
19665
|
if (highlightSlide) {
|
|
@@ -19597,7 +19671,8 @@
|
|
|
19597
19671
|
direction: "up",
|
|
19598
19672
|
fontSize: useResponsive ? undefined : fontSize,
|
|
19599
19673
|
fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
|
|
19600
|
-
wordProps: highlightProps
|
|
19674
|
+
wordProps: highlightProps,
|
|
19675
|
+
textComponent: TextComponent
|
|
19601
19676
|
});
|
|
19602
19677
|
}
|
|
19603
19678
|
return content;
|
|
@@ -19617,7 +19692,7 @@
|
|
|
19617
19692
|
lastIndex = match.index + match[0].length;
|
|
19618
19693
|
}
|
|
19619
19694
|
if (lastIndex < text.length) parts.push(text.substring(lastIndex));
|
|
19620
|
-
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React__default.createElement(
|
|
19695
|
+
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
|
|
19621
19696
|
key: "highlight-" + idx,
|
|
19622
19697
|
as: "span",
|
|
19623
19698
|
display: "inline",
|
|
@@ -19627,7 +19702,7 @@
|
|
|
19627
19702
|
}
|
|
19628
19703
|
// Case 2: Has highlight style but no highlight target - apply style to entire title
|
|
19629
19704
|
if (highlightStyle && !activeHighlightTarget) {
|
|
19630
|
-
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(
|
|
19705
|
+
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
|
|
19631
19706
|
as: "span",
|
|
19632
19707
|
fontSize: fontSize,
|
|
19633
19708
|
display: "inline",
|
|
@@ -19635,7 +19710,7 @@
|
|
|
19635
19710
|
}, !highlightSlide ? highlightProps : {}, views == null ? void 0 : views.highlight), renderHighlightedContent(text)));
|
|
19636
19711
|
}
|
|
19637
19712
|
// Case 3: Default - no highlighting
|
|
19638
|
-
return /*#__PURE__*/React__default.createElement(
|
|
19713
|
+
return /*#__PURE__*/React__default.createElement(TextComponent, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), text);
|
|
19639
19714
|
};
|
|
19640
19715
|
|
|
19641
19716
|
/**
|