@hexure/ui 1.13.68 → 1.13.69

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/esm/index.js CHANGED
@@ -2801,7 +2801,19 @@ const StyledButton = styled.button `
2801
2801
  return '0px';
2802
2802
  }};
2803
2803
  outline: none;
2804
- background: ${props => props.$bg_color || props.theme.PRIMARY_COLOR.Hex};
2804
+ background: ${props => {
2805
+ if (props.$disabled) {
2806
+ if (props.$format === 'secondary') {
2807
+ return '#66666626';
2808
+ }
2809
+ else {
2810
+ return '#e7e6e6';
2811
+ }
2812
+ }
2813
+ else {
2814
+ return props.$bg_color || props.theme.PRIMARY_COLOR.Hex;
2815
+ }
2816
+ }};
2805
2817
  width: ${props => {
2806
2818
  if (props.$hasChildren) {
2807
2819
  return 'auto';
@@ -2820,7 +2832,19 @@ const StyledButton = styled.button `
2820
2832
  opacity: ${props => (props.$disabled ? 0.6 : 0.9)};
2821
2833
  border-width: 1px;
2822
2834
  border-style: solid;
2823
- border-color: ${props => props.$border_color || props.theme.PRIMARY_COLOR.Hex};
2835
+ border-color: ${props => {
2836
+ if (props.$disabled) {
2837
+ if (props.$format === 'secondary') {
2838
+ return '#66666680';
2839
+ }
2840
+ else {
2841
+ return '#e7e6e6';
2842
+ }
2843
+ }
2844
+ else {
2845
+ return props.$border_color || props.theme.PRIMARY_COLOR.Hex;
2846
+ }
2847
+ }};
2824
2848
  box-sizing: border-box;
2825
2849
 
2826
2850
  &:active,
@@ -2896,10 +2920,15 @@ const Button = (_a) => {
2896
2920
  };
2897
2921
  const format_styles = button_type_mapping[format];
2898
2922
  const baseId = dataItemid || 'button';
2899
- const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$hasChildren": !!has_children, "$iconPosition": iconPosition, "$margin": margin, "$small": small, disabled: disabled || loading, onClick: disabled || loading ? undefined : onClick, title: title, type: type || (isForm ? 'submit' : undefined) }, accessibleProps, { "data-itemid": `${baseId}-styled-button` }),
2900
- children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small, "data-itemid": `${baseId}-label` }, children)) : null,
2923
+ const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$format": format, "$hasChildren": !!has_children, "$iconPosition": iconPosition, "$margin": margin, "$small": small, disabled: disabled || loading, onClick: disabled || loading ? undefined : onClick, title: title, type: type || (isForm ? 'submit' : undefined) }, accessibleProps, { "data-itemid": `${baseId}-styled-button` }),
2924
+ children ? (React.createElement(Label$5, { "$content_color": disabled || loading ? '#666666' : format_styles.content_color, "$small": small, "data-itemid": `${baseId}-label` }, children)) : null,
2901
2925
  icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children, "data-itemid": `${baseId}-icon` },
2902
- React.createElement(Icon, { color: format ? format_styles === null || format_styles === void 0 ? void 0 : format_styles.content_color : '#fff', "data-itemid": `${baseId}-icon-svg`, path: loading ? mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
2926
+ React.createElement(Icon, { color: (() => {
2927
+ if (disabled || loading) {
2928
+ return '#666666';
2929
+ }
2930
+ return format ? format_styles.content_color : '#fff';
2931
+ })(), "data-itemid": `${baseId}-icon-svg`, path: loading ? mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
2903
2932
  badge && !icon ? (React.createElement(Badge$1, { "$bg_color": format_styles.badge_bg_color, "$content_color": format_styles.badge_content_color, "$small": small, "data-itemid": `${baseId}-badge` }, badge)) : null));
2904
2933
  if (toolTip && Object.keys(toolTip).length) {
2905
2934
  return (React.createElement(Tooltip, Object.assign({}, toolTip, { trigger: (toolTip === null || toolTip === void 0 ? void 0 : toolTip.trigger) || button_view }), toolTip === null || toolTip === void 0 ? void 0 : toolTip.children));