@app-studio/web 0.9.77 → 0.9.79

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.
@@ -1,12 +1,12 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('lucide-react/dynamic'), require('core-js/modules/es.array-buffer.constructor.js'), require('core-js/modules/es.array-buffer.slice.js'), require('core-js/modules/es.typed-array.uint8-array.js'), require('core-js/modules/es.typed-array.fill.js'), require('core-js/modules/es.typed-array.set.js'), require('core-js/modules/es.typed-array.sort.js'), require('core-js/modules/es.typed-array.to-locale-string.js'), require('core-js/modules/es.string.starts-with.js'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('core-js/modules/es.parse-int.js'), require('react-router-dom'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/es.string.ends-with.js'), require('contrast'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.number.to-fixed.js'), require('date-fns/format'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/es.regexp.constructor.js'), require('core-js/modules/es.regexp.exec.js'), require('formik'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.string.split.js'), require('core-js/modules/es.promise.finally.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.unscopables.flat-map.js')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'lucide-react/dynamic', 'core-js/modules/es.array-buffer.constructor.js', 'core-js/modules/es.array-buffer.slice.js', 'core-js/modules/es.typed-array.uint8-array.js', 'core-js/modules/es.typed-array.fill.js', 'core-js/modules/es.typed-array.set.js', 'core-js/modules/es.typed-array.sort.js', 'core-js/modules/es.typed-array.to-locale-string.js', 'core-js/modules/es.string.starts-with.js', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'core-js/modules/es.parse-int.js', 'react-router-dom', 'core-js/modules/es.parse-float.js', 'core-js/modules/es.string.ends-with.js', 'contrast', 'core-js/modules/es.promise.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.number.to-fixed.js', 'date-fns/format', 'core-js/modules/es.string.trim.js', 'core-js/modules/es.regexp.constructor.js', 'core-js/modules/es.regexp.exec.js', 'formik', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.string.split.js', 'core-js/modules/es.promise.finally.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.unscopables.flat-map.js'], factory) :
4
- (global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, null, null, null, null, global.appStudio, null, global.dynamic, null, null, null, null, null, null, null, null, null, null, null, global.zustand, null, global.reactRouterDom, null, null, global.contrast, null, null, null, global.format, null, null, null, global.formik));
5
- }(this, (function (exports, es_object_assign_js, React, es_array_includes_js, es_array_iterator_js, es_string_includes_js, web_domCollections_iterator_js, es_regexp_toString_js, appStudio, es_symbol_description_js, dynamic, es_arrayBuffer_constructor_js, es_arrayBuffer_slice_js, es_typedArray_uint8Array_js, es_typedArray_fill_js, es_typedArray_set_js, es_typedArray_sort_js, es_typedArray_toLocaleString_js, es_string_startsWith_js, web_url_js, web_url_toJson_js, web_urlSearchParams_js, zustand, es_parseInt_js, reactRouterDom, es_parseFloat_js, es_string_endsWith_js, contrast, es_promise_js, es_array_reduce_js, es_number_toFixed_js, format, es_string_trim_js, es_regexp_constructor_js, es_regexp_exec_js, formik) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('lucide-react/dynamic'), require('core-js/modules/es.array-buffer.constructor.js'), require('core-js/modules/es.array-buffer.slice.js'), require('core-js/modules/es.typed-array.uint8-array.js'), require('core-js/modules/es.typed-array.fill.js'), require('core-js/modules/es.typed-array.set.js'), require('core-js/modules/es.typed-array.sort.js'), require('core-js/modules/es.typed-array.to-locale-string.js'), require('core-js/modules/es.string.starts-with.js'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('core-js/modules/es.parse-int.js'), require('react-router-dom'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/es.string.ends-with.js'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.number.to-fixed.js'), require('date-fns/format'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/es.regexp.constructor.js'), require('core-js/modules/es.regexp.exec.js'), require('formik'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.string.split.js'), require('contrast'), require('core-js/modules/es.promise.finally.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.unscopables.flat-map.js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'lucide-react/dynamic', 'core-js/modules/es.array-buffer.constructor.js', 'core-js/modules/es.array-buffer.slice.js', 'core-js/modules/es.typed-array.uint8-array.js', 'core-js/modules/es.typed-array.fill.js', 'core-js/modules/es.typed-array.set.js', 'core-js/modules/es.typed-array.sort.js', 'core-js/modules/es.typed-array.to-locale-string.js', 'core-js/modules/es.string.starts-with.js', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'core-js/modules/es.parse-int.js', 'react-router-dom', 'core-js/modules/es.parse-float.js', 'core-js/modules/es.string.ends-with.js', 'core-js/modules/es.promise.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.number.to-fixed.js', 'date-fns/format', 'core-js/modules/es.string.trim.js', 'core-js/modules/es.regexp.constructor.js', 'core-js/modules/es.regexp.exec.js', 'formik', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.string.split.js', 'contrast', 'core-js/modules/es.promise.finally.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.unscopables.flat-map.js'], factory) :
4
+ (global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, null, null, null, null, global.appStudio, null, global.dynamic, null, null, null, null, null, null, null, null, null, null, null, global.zustand, null, global.reactRouterDom, null, null, null, null, null, global.format, null, null, null, global.formik, null, null, global.contrast));
5
+ }(this, (function (exports, es_object_assign_js, React, es_array_includes_js, es_array_iterator_js, es_string_includes_js, web_domCollections_iterator_js, es_regexp_toString_js, appStudio, es_symbol_description_js, dynamic, es_arrayBuffer_constructor_js, es_arrayBuffer_slice_js, es_typedArray_uint8Array_js, es_typedArray_fill_js, es_typedArray_set_js, es_typedArray_sort_js, es_typedArray_toLocaleString_js, es_string_startsWith_js, web_url_js, web_url_toJson_js, web_urlSearchParams_js, zustand, es_parseInt_js, reactRouterDom, es_parseFloat_js, es_string_endsWith_js, es_promise_js, es_array_reduce_js, es_number_toFixed_js, format, es_string_trim_js, es_regexp_constructor_js, es_regexp_exec_js, formik, es_string_replace_js, es_string_split_js, contrast) { 'use strict';
6
6
 
7
7
  var React__default = 'default' in React ? React['default'] : React;
8
- contrast = contrast && Object.prototype.hasOwnProperty.call(contrast, 'default') ? contrast['default'] : contrast;
9
8
  format = format && Object.prototype.hasOwnProperty.call(format, 'default') ? format['default'] : format;
9
+ contrast = contrast && Object.prototype.hasOwnProperty.call(contrast, 'default') ? contrast['default'] : contrast;
10
10
 
11
11
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
12
12
  try {
@@ -2745,11 +2745,10 @@
2745
2745
  padding: 14
2746
2746
  }
2747
2747
  };
2748
- var getButtonVariants = function getButtonVariants(color, isLight, reversed) {
2748
+ var getButtonVariants = function getButtonVariants(color, textColor, reversed) {
2749
2749
  if (reversed === void 0) {
2750
2750
  reversed = false;
2751
2751
  }
2752
- var textColor = isLight ? '#000000' : '#FFFFFF';
2753
2752
  // Determine effective colors based on reversed state
2754
2753
  var effectiveBg = reversed ? textColor : color;
2755
2754
  var effectiveContent = reversed ? color : textColor;
@@ -2876,8 +2875,8 @@
2876
2875
 
2877
2876
  var _excluded$d = ["asComponent", "isDisabled", "isLoading", "isWrapped", "borderRadius", "width", "height", "baseStyles", "sizeStyles", "iconPad", "mainTone", "resolvedTextColor", "children", "borderWidth"],
2878
2877
  _excluded2$3 = ["shape", "isDisabled", "onClick", "shadow", "borderWidth", "isAuto", "isFilled", "views", "children"],
2879
- _excluded3$2 = ["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"],
2880
- _excluded4$2 = ["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"];
2878
+ _excluded3$2 = ["variant", "animation", "to", "isDisabled", "isLoading", "isAuto", "isFilled", "isExternal", "shape", "shadow", "onClick", "views", "baseStyles", "sizeStyles", "iconPad", "resolvedTextColor", "content", "size", "mainTone", "borderMovingDuration", "borderMovingGradientColors", "animatedStrokeAccentColor", "animatedStrokeTextColor", "getColor"],
2879
+ _excluded4$2 = ["variant", "size", "shape", "iconPosition", "loaderPosition", "backgroundColor", "color", "textColor", "reversed", "isAuto", "isFilled", "isDisabled", "isLoading", "isIconRounded", "icon", "children", "to", "isExternal", "shadow", "onClick", "views", "borderMovingDuration", "borderMovingGradientColors", "animatedStrokeAccentColor", "animatedStrokeTextColor"];
2881
2880
  // --- Helper: Button Content ---
2882
2881
  // Renders the inner content: Loader, Icon, and Children.
2883
2882
  var ButtonContent = _ref => {
@@ -3237,7 +3236,7 @@
3237
3236
  // --- Main Component ---
3238
3237
  // --- Main Component ---
3239
3238
  var ButtonView = _ref5 => {
3240
- var _ref6, _ref7, _base$color;
3239
+ var _ref6, _base$color;
3241
3240
  var {
3242
3241
  /* behaviour */
3243
3242
  variant = 'filled',
@@ -3246,13 +3245,13 @@
3246
3245
  iconPosition = 'left',
3247
3246
  loaderPosition = 'left',
3248
3247
  backgroundColor,
3249
- // primary candidate for main color
3248
+ // Primary override for main color
3250
3249
  color,
3251
- // 2nd candidate for main color (NOT text‑color)
3252
- scheme,
3253
- // New scheme prop
3250
+ // Main button color (theme tokens or color palette)
3251
+ textColor,
3252
+ // Explicit text color
3254
3253
  reversed = false,
3255
- // New reversed prop
3254
+ // Reverse colors for dark backgrounds
3256
3255
  isAuto = true,
3257
3256
  isFilled,
3258
3257
  isDisabled,
@@ -3277,24 +3276,18 @@
3277
3276
  props = _objectWithoutPropertiesLoose(_ref5, _excluded4$2);
3278
3277
  /* theme helpers */
3279
3278
  var {
3280
- getColorHex,
3281
- themeMode
3279
+ getColorHex
3282
3280
  } = appStudio.useTheme();
3283
3281
  /* MAIN COLOR – determines the entire palette */
3284
- var mainColorKey = (_ref6 = (_ref7 = backgroundColor != null ? backgroundColor : color) != null ? _ref7 : scheme) != null ? _ref6 : 'theme.primary';
3282
+ var mainColorKey = (_ref6 = backgroundColor != null ? backgroundColor : color) != null ? _ref6 : 'theme.primary';
3285
3283
  var mainTone = getColorHex(isDisabled ? 'theme.disabled' : mainColorKey);
3286
- var tone = contrast(mainTone);
3287
- /* text color with mixBlendMode for maximum visibility */
3288
- var textColor;
3289
- if (tone === 'light') {
3290
- textColor = '#000000';
3291
- } else {
3292
- textColor = '#FFFFFF';
3293
- }
3284
+ /* text color - explicitly provided or default to white */
3285
+ var resolvedTextColorKey = textColor != null ? textColor : 'color.white';
3286
+ var resolvedTextColor = getColorHex(resolvedTextColorKey);
3294
3287
  /* variant palette */
3295
- var palette = React.useMemo(() => getButtonVariants(mainTone, tone === 'light', reversed), [mainTone, tone, reversed]);
3288
+ var palette = React.useMemo(() => getButtonVariants(mainTone, resolvedTextColor, reversed), [mainTone, resolvedTextColor, reversed]);
3296
3289
  var base = palette[variant];
3297
- var resolvedTextColor = (_base$color = base == null ? void 0 : base.color) != null ? _base$color : textColor;
3290
+ var finalContentColor = (_base$color = base == null ? void 0 : base.color) != null ? _base$color : resolvedTextColor;
3298
3291
  // Render content logic safely
3299
3292
  var content = /*#__PURE__*/React__default.createElement(ButtonContent, {
3300
3293
  icon: icon,
@@ -3302,7 +3295,7 @@
3302
3295
  iconPosition: iconPosition,
3303
3296
  loaderPosition: loaderPosition,
3304
3297
  size: size,
3305
- resolvedTextColor: resolvedTextColor,
3298
+ resolvedTextColor: finalContentColor,
3306
3299
  isIconRounded: isIconRounded,
3307
3300
  views: views
3308
3301
  }, children);
@@ -3325,11 +3318,10 @@
3325
3318
  baseStyles: base,
3326
3319
  sizeStyles: sizeStyles,
3327
3320
  iconPad: iconPad,
3328
- resolvedTextColor: resolvedTextColor,
3321
+ resolvedTextColor: finalContentColor,
3329
3322
  content: content,
3330
3323
  size: size,
3331
3324
  mainTone: mainTone,
3332
- tone: tone,
3333
3325
  borderMovingDuration: borderMovingDuration,
3334
3326
  borderMovingGradientColors: borderMovingGradientColors,
3335
3327
  animatedStrokeAccentColor: animatedStrokeAccentColor,
@@ -25593,7 +25585,7 @@
25593
25585
  _excluded7 = ["children", "src", "backgroundSize", "backgroundPosition", "backgroundRepeat", "backgroundAttachment", "imageOpacity", "overlay", "blendMode", "views", "themeMode"],
25594
25586
  _excluded8 = ["children", "src", "autoPlay", "loop", "muted", "playsInline", "overlay", "blendMode", "views", "themeMode"],
25595
25587
  _excluded9 = ["children"],
25596
- _excluded10 = ["contentPosition"],
25588
+ _excluded10 = ["contentPosition", "backgroundColor"],
25597
25589
  _excluded11 = ["children", "views"],
25598
25590
  _excluded12 = ["children", "designProps", "shape", "decorationRotation", "decorationScale", "decorationOpacity", "views"];
25599
25591
  // Background Context
@@ -26048,23 +26040,34 @@
26048
26040
  */
26049
26041
  var BackgroundOverlay = _ref10 => {
26050
26042
  var {
26051
- contentPosition
26043
+ contentPosition,
26044
+ backgroundColor = 'color.black.900'
26052
26045
  } = _ref10,
26053
26046
  props = _objectWithoutPropertiesLoose(_ref10, _excluded10);
26054
26047
  var getDefaultOverlay = () => {
26048
+ var ligthBackground = backgroundColor + ".100";
26049
+ var darkBackground = backgroundColor + ".900";
26050
+ var midBackground = backgroundColor + ".600";
26051
+ var midDarkBackground = backgroundColor + ".400";
26052
+ if (backgroundColor.indexOf('.') === -1) {
26053
+ ligthBackground = "color-mix(in srgb, " + backgroundColor + " 10%, transparent)";
26054
+ darkBackground = "color-mix(in srgb, " + backgroundColor + " 90%, transparent)";
26055
+ midBackground = "color-mix(in srgb, " + backgroundColor + " 70%, transparent)";
26056
+ midDarkBackground = "color-mix(in srgb, " + backgroundColor + " 50%, transparent)";
26057
+ }
26055
26058
  switch (contentPosition) {
26056
26059
  case 'left':
26057
- return 'radial-gradient(circle at 80% 50%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.2) 100%)';
26060
+ return "radial-gradient(circle at 70% 50%, " + ligthBackground + " 0%, " + ligthBackground + " 100%), linear-gradient(to right, " + darkBackground + " 0%, " + midBackground + " 65%, " + ligthBackground + " 100%)";
26058
26061
  case 'right':
26059
- return 'radial-gradient(circle at 20% 50%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.2) 100%)';
26062
+ return "radial-gradient(circle at 30% 50%, " + ligthBackground + " 0%, " + ligthBackground + " 100%), linear-gradient(to left, " + darkBackground + " 0%, " + midBackground + " 65%, " + ligthBackground + " 100%)";
26060
26063
  case 'top':
26061
- return 'radial-gradient(circle at 50% 80%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.1) 100%)';
26064
+ return "radial-gradient(circle at 50% 40%, " + ligthBackground + " 0%, " + ligthBackground + " 100%), linear-gradient(to bottom, " + darkBackground + " 0%, " + midBackground + " 60%, " + ligthBackground + " 100%)";
26062
26065
  case 'bottom':
26063
- return 'radial-gradient(circle at 50% 80%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.1) 100%)';
26066
+ return "radial-gradient(circle at 50% 60%, " + ligthBackground + " 0%, " + ligthBackground + " 100%), linear-gradient(to top, " + darkBackground + " 0%, " + midBackground + " 60%, " + ligthBackground + " 100%)";
26064
26067
  case 'center':
26065
- return 'radial-gradient(circle at 50% 70%, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%)';
26068
+ return "radial-gradient(circle at 50% 70%, " + darkBackground + " 0%, " + ligthBackground + " 100%)";
26066
26069
  default:
26067
- return 'rgba(0,0,0,0.5)';
26070
+ return midDarkBackground;
26068
26071
  }
26069
26072
  };
26070
26073
  var background = getDefaultOverlay();