@hexure/ui 1.13.68 → 1.13.70

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/cjs/index.js CHANGED
@@ -2803,7 +2803,19 @@ const StyledButton = styled.button `
2803
2803
  return '0px';
2804
2804
  }};
2805
2805
  outline: none;
2806
- background: ${props => props.$bg_color || props.theme.PRIMARY_COLOR.Hex};
2806
+ background: ${props => {
2807
+ if (props.$disabled) {
2808
+ if (props.$format === 'secondary') {
2809
+ return '#66666626';
2810
+ }
2811
+ else {
2812
+ return '#e7e6e6';
2813
+ }
2814
+ }
2815
+ else {
2816
+ return props.$bg_color || props.theme.PRIMARY_COLOR.Hex;
2817
+ }
2818
+ }};
2807
2819
  width: ${props => {
2808
2820
  if (props.$hasChildren) {
2809
2821
  return 'auto';
@@ -2822,7 +2834,19 @@ const StyledButton = styled.button `
2822
2834
  opacity: ${props => (props.$disabled ? 0.6 : 0.9)};
2823
2835
  border-width: 1px;
2824
2836
  border-style: solid;
2825
- border-color: ${props => props.$border_color || props.theme.PRIMARY_COLOR.Hex};
2837
+ border-color: ${props => {
2838
+ if (props.$disabled) {
2839
+ if (props.$format === 'secondary') {
2840
+ return '#66666680';
2841
+ }
2842
+ else {
2843
+ return '#e7e6e6';
2844
+ }
2845
+ }
2846
+ else {
2847
+ return props.$border_color || props.theme.PRIMARY_COLOR.Hex;
2848
+ }
2849
+ }};
2826
2850
  box-sizing: border-box;
2827
2851
 
2828
2852
  &:active,
@@ -2898,10 +2922,15 @@ const Button = (_a) => {
2898
2922
  };
2899
2923
  const format_styles = button_type_mapping[format];
2900
2924
  const baseId = dataItemid || 'button';
2901
- 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` }),
2902
- children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small, "data-itemid": `${baseId}-label` }, children)) : null,
2925
+ 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` }),
2926
+ children ? (React.createElement(Label$5, { "$content_color": disabled || loading ? '#666666' : format_styles.content_color, "$small": small, "data-itemid": `${baseId}-label` }, children)) : null,
2903
2927
  icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children, "data-itemid": `${baseId}-icon` },
2904
- 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 ? js.mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
2928
+ React.createElement(Icon, { color: (() => {
2929
+ if (disabled || loading) {
2930
+ return '#666666';
2931
+ }
2932
+ return format ? format_styles.content_color : '#fff';
2933
+ })(), "data-itemid": `${baseId}-icon-svg`, path: loading ? js.mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
2905
2934
  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));
2906
2935
  if (toolTip && Object.keys(toolTip).length) {
2907
2936
  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));
@@ -3539,7 +3568,7 @@ const Input$2 = styled.input `
3539
3568
  width: 0;
3540
3569
  &:checked + span {
3541
3570
  background-color: ${Colors.PRIMARY.Hex};
3542
- border-color: ${Colors.PRIMARY.Hex};
3571
+ border-color: ${props => (props.$invalid ? Colors.RED.Hex : Colors.PRIMARY.Hex)};
3543
3572
  }
3544
3573
  &:checked:disabled + span {
3545
3574
  background-color: ${Colors.MEDIUM_GRAY.Hex};
@@ -3615,7 +3644,7 @@ const Checkbox = (_a) => {
3615
3644
  var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError"]);
3616
3645
  const baseId = dataItemid || 'checkbox';
3617
3646
  return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3618
- React.createElement(Input$2, { checked: checked, "data-itemid": `${baseId}-input`, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
3647
+ React.createElement(Input$2, { "$invalid": invalid, checked: checked, "data-itemid": `${baseId}-input`, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
3619
3648
  React.createElement(Check$1, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
3620
3649
  children ? (React.createElement(Label$3, { color: color, "data-itemid": `${baseId}-label` },
3621
3650
  children,
@@ -5924,7 +5953,7 @@ const Input = styled.input `
5924
5953
  height: 0;
5925
5954
  width: 0;
5926
5955
  &:checked + span {
5927
- border-color: ${Colors.PRIMARY.Hex};
5956
+ border-color: ${props => (props.$invalid ? Colors.RED.Hex : Colors.PRIMARY.Hex)};
5928
5957
  }
5929
5958
  &:checked + span:after {
5930
5959
  background-color: ${Colors.PRIMARY.Hex};
@@ -5998,7 +6027,7 @@ const Radio = (_a) => {
5998
6027
  var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError"]);
5999
6028
  const baseId = dataItemid || 'radio';
6000
6029
  return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
6001
- React.createElement(Input, { checked: checked, "data-itemid": `${baseId}-input`, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'radio', value: value }),
6030
+ React.createElement(Input, { "$invalid": invalid, checked: checked, "data-itemid": `${baseId}-input`, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'radio', value: value }),
6002
6031
  React.createElement(Check, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
6003
6032
  React.createElement(Label, { "data-itemid": `${baseId}-label` },
6004
6033
  children,