@galaxy-io/dls 1.4.2 → 1.4.3
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/buttons/Button.js +4 -8
- package/package.json +1 -1
package/dist/buttons/Button.js
CHANGED
|
@@ -110,14 +110,12 @@ var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMo
|
|
|
110
110
|
]);
|
|
111
111
|
const renderIcon = useCallback(() => {
|
|
112
112
|
if (!icon) return null;
|
|
113
|
-
let iconVariant = getIconVariant(variant, activeTheme);
|
|
114
|
-
if (isDisabled) iconVariant = IconVariant.TERTIARY;
|
|
115
113
|
return /* @__PURE__ */ jsx(FlexItem, {
|
|
116
114
|
shrink: 0,
|
|
117
115
|
grow: 0,
|
|
118
116
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
119
117
|
component: icon,
|
|
120
|
-
variant:
|
|
118
|
+
variant: getIconVariant(variant, activeTheme),
|
|
121
119
|
size: BUTTON_SIZE_TO_ICON_SIZE_MAP[size]
|
|
122
120
|
})
|
|
123
121
|
});
|
|
@@ -125,20 +123,17 @@ var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMo
|
|
|
125
123
|
icon,
|
|
126
124
|
variant,
|
|
127
125
|
size,
|
|
128
|
-
isDisabled,
|
|
129
126
|
activeTheme
|
|
130
127
|
]);
|
|
131
128
|
const renderLabel = useCallback(() => {
|
|
132
129
|
if (!label) return null;
|
|
133
|
-
let textVariant = getTextVariant(variant, activeTheme);
|
|
134
|
-
if (isDisabled) textVariant = TextVariant.TERTIARY_ALT;
|
|
135
130
|
return /* @__PURE__ */ jsx(LabelWrapper, {
|
|
136
131
|
$isEllipsis: isEllipsis,
|
|
137
132
|
children: /* @__PURE__ */ jsx(Text, {
|
|
138
|
-
variant:
|
|
133
|
+
variant: getTextVariant(variant, activeTheme),
|
|
139
134
|
weight: TextWeight.MEDIUM,
|
|
140
135
|
size: BUTTON_SIZE_TO_TEXT_SIZE_MAP[size],
|
|
141
|
-
cursor: isDisabled ? "not-allowed" : cursor,
|
|
136
|
+
cursor: isDisabled || isLoading ? "not-allowed" : cursor,
|
|
142
137
|
isEllipsis,
|
|
143
138
|
children: label
|
|
144
139
|
})
|
|
@@ -148,6 +143,7 @@ var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMo
|
|
|
148
143
|
variant,
|
|
149
144
|
size,
|
|
150
145
|
isDisabled,
|
|
146
|
+
isLoading,
|
|
151
147
|
isEllipsis,
|
|
152
148
|
cursor,
|
|
153
149
|
activeTheme
|