@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 +38 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +38 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +82 -82
- package/package.json +1 -1
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 =>
|
|
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 =>
|
|
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:
|
|
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));
|
|
@@ -3537,7 +3566,7 @@ const Input$2 = styled.input `
|
|
|
3537
3566
|
width: 0;
|
|
3538
3567
|
&:checked + span {
|
|
3539
3568
|
background-color: ${Colors.PRIMARY.Hex};
|
|
3540
|
-
border-color: ${Colors.PRIMARY.Hex};
|
|
3569
|
+
border-color: ${props => (props.$invalid ? Colors.RED.Hex : Colors.PRIMARY.Hex)};
|
|
3541
3570
|
}
|
|
3542
3571
|
&:checked:disabled + span {
|
|
3543
3572
|
background-color: ${Colors.MEDIUM_GRAY.Hex};
|
|
@@ -3613,7 +3642,7 @@ const Checkbox = (_a) => {
|
|
|
3613
3642
|
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"]);
|
|
3614
3643
|
const baseId = dataItemid || 'checkbox';
|
|
3615
3644
|
return (React.createElement(Wrapper$b, Object.assign({ "$disabled": disabled }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
3616
|
-
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' }),
|
|
3645
|
+
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' }),
|
|
3617
3646
|
React.createElement(Check$1, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
|
|
3618
3647
|
children ? (React.createElement(Label$3, { color: color, "data-itemid": `${baseId}-label` },
|
|
3619
3648
|
children,
|
|
@@ -5922,7 +5951,7 @@ const Input = styled.input `
|
|
|
5922
5951
|
height: 0;
|
|
5923
5952
|
width: 0;
|
|
5924
5953
|
&:checked + span {
|
|
5925
|
-
border-color: ${Colors.PRIMARY.Hex};
|
|
5954
|
+
border-color: ${props => (props.$invalid ? Colors.RED.Hex : Colors.PRIMARY.Hex)};
|
|
5926
5955
|
}
|
|
5927
5956
|
&:checked + span:after {
|
|
5928
5957
|
background-color: ${Colors.PRIMARY.Hex};
|
|
@@ -5996,7 +6025,7 @@ const Radio = (_a) => {
|
|
|
5996
6025
|
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"]);
|
|
5997
6026
|
const baseId = dataItemid || 'radio';
|
|
5998
6027
|
return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
5999
|
-
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 }),
|
|
6028
|
+
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 }),
|
|
6000
6029
|
React.createElement(Check, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
|
|
6001
6030
|
React.createElement(Label, { "data-itemid": `${baseId}-label` },
|
|
6002
6031
|
children,
|