@dcl/playground-assets 7.1.2 → 7.1.3-4440802627.commit-29bc3e6

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/alpha.d.ts CHANGED
@@ -4986,6 +4986,10 @@ export declare interface UiButtonProps extends UiLabelProps, EntityPropTypes {
4986
4986
  * Use any of the available button style types to create a styled button.
4987
4987
  */
4988
4988
  variant?: 'primary' | 'secondary';
4989
+ /**
4990
+ * Enable or disable the pointer events on the button
4991
+ */
4992
+ disabled?: boolean;
4989
4993
  }
4990
4994
 
4991
4995
  /**
package/dist/beta.d.ts CHANGED
@@ -4982,6 +4982,10 @@ export declare interface UiButtonProps extends UiLabelProps, EntityPropTypes {
4982
4982
  * Use any of the available button style types to create a styled button.
4983
4983
  */
4984
4984
  variant?: 'primary' | 'secondary';
4985
+ /**
4986
+ * Enable or disable the pointer events on the button
4987
+ */
4988
+ disabled?: boolean;
4985
4989
  }
4986
4990
 
4987
4991
  /**
@@ -4982,6 +4982,10 @@ export declare interface UiButtonProps extends UiLabelProps, EntityPropTypes {
4982
4982
  * Use any of the available button style types to create a styled button.
4983
4983
  */
4984
4984
  variant?: 'primary' | 'secondary';
4985
+ /**
4986
+ * Enable or disable the pointer events on the button
4987
+ */
4988
+ disabled?: boolean;
4985
4989
  }
4986
4990
 
4987
4991
  /**
package/dist/index.js CHANGED
@@ -42206,19 +42206,17 @@
42206
42206
  }
42207
42207
 
42208
42208
  function getButtonProps(props) {
42209
- if (props.variant === 'primary') {
42210
- return {
42211
- uiBackground: { color: { r: 0.98, g: 0.17, b: 0.33, a: 1 } },
42212
- uiText: { color: { r: 1, g: 1, b: 1, a: 1 } }
42213
- };
42214
- }
42215
42209
  if (props.variant === 'secondary') {
42216
42210
  return {
42217
42211
  uiBackground: { color: { r: 1, g: 1, b: 1, a: 1 } },
42218
42212
  uiText: { color: { r: 0.98, g: 0.17, b: 0.33, a: 1 } }
42219
42213
  };
42220
42214
  }
42221
- return {};
42215
+ // 'primary' variant by default
42216
+ return {
42217
+ uiBackground: { color: { r: 0.98, g: 0.17, b: 0.33, a: 1 } },
42218
+ uiText: { color: { r: 1, g: 1, b: 1, a: 1 } }
42219
+ };
42222
42220
  }
42223
42221
  /**
42224
42222
  *
@@ -42251,7 +42249,13 @@
42251
42249
  height: 36,
42252
42250
  ...uiTransform
42253
42251
  });
42254
- return (ReactEcs$1.createElement("entity", { onMouseDown: onMouseDown, onMouseUp: onMouseUp, uiTransform: uiTransformProps, uiText: textProps, uiBackground: uiBackgroundProps }));
42252
+ if (!!props.disabled) {
42253
+ if (textProps.color)
42254
+ textProps.color.a /= 2;
42255
+ if (uiBackgroundProps && uiBackgroundProps.color)
42256
+ uiBackgroundProps.color.a /= 2;
42257
+ }
42258
+ return (ReactEcs$1.createElement("entity", { onMouseDown: !!props.disabled ? undefined : onMouseDown, onMouseUp: !!props.disabled ? undefined : onMouseUp, uiTransform: uiTransformProps, uiText: textProps, uiBackground: uiBackgroundProps }));
42255
42259
  }
42256
42260
 
42257
42261
  /**