@bolttech/atoms-button 0.2.2 → 0.2.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/index.js +69 -31
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var atomsIcon = require('@bolttech/atoms-icon');
|
|
7
|
-
var styled = require('styled-components');
|
|
8
|
-
|
|
9
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '@bolttech/atoms-icon';
|
|
3
|
+
import styled from 'styled-components';
|
|
12
4
|
|
|
13
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
14
6
|
|
|
@@ -1100,10 +1092,21 @@ var SizeVariant;
|
|
|
1100
1092
|
SizeVariant["ghost"] = "ghost";
|
|
1101
1093
|
})(SizeVariant || (SizeVariant = {}));
|
|
1102
1094
|
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1095
|
+
let _ = t => t,
|
|
1096
|
+
_t,
|
|
1097
|
+
_t2,
|
|
1098
|
+
_t3;
|
|
1099
|
+
const Container = styled.div(_t || (_t = _`
|
|
1100
|
+
display: flex;
|
|
1101
|
+
align-items: center;
|
|
1102
|
+
gap: ${0};
|
|
1103
|
+
.left-img-btn,
|
|
1104
|
+
.right-img-btn,
|
|
1105
|
+
svg {
|
|
1106
|
+
width: ${0};
|
|
1107
|
+
height: ${0};
|
|
1108
|
+
}
|
|
1109
|
+
`), ({
|
|
1107
1110
|
theme,
|
|
1108
1111
|
size
|
|
1109
1112
|
}) => theme.components.button[size].generic.gap, ({
|
|
@@ -1113,10 +1116,40 @@ const Container = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
|
1113
1116
|
theme,
|
|
1114
1117
|
size
|
|
1115
1118
|
}) => theme.components.button[size].icon.size);
|
|
1116
|
-
const Button$1 =
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1119
|
+
const Button$1 = styled.button(_t2 || (_t2 = _`
|
|
1120
|
+
background-color: ${0};
|
|
1121
|
+
border-radius: ${0};
|
|
1122
|
+
border: 1px solid
|
|
1123
|
+
${0};
|
|
1124
|
+
box-shadow: ${0};
|
|
1125
|
+
color: ${0};
|
|
1126
|
+
fill: ${0};
|
|
1127
|
+
padding: ${0};
|
|
1128
|
+
|
|
1129
|
+
:active:enabled {
|
|
1130
|
+
background-color: ${0};
|
|
1131
|
+
border: 1px solid
|
|
1132
|
+
${0};
|
|
1133
|
+
color: ${0};
|
|
1134
|
+
fill: ${0};
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
:disabled {
|
|
1138
|
+
background-color: ${0};
|
|
1139
|
+
border: 1px solid
|
|
1140
|
+
${0};
|
|
1141
|
+
color: ${0};
|
|
1142
|
+
fill: ${0};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
:hover:enabled {
|
|
1146
|
+
background-color: ${0};
|
|
1147
|
+
border: 1px solid
|
|
1148
|
+
${0};
|
|
1149
|
+
color: ${0};
|
|
1150
|
+
fill: ${0};
|
|
1151
|
+
}
|
|
1152
|
+
`), ({
|
|
1120
1153
|
theme,
|
|
1121
1154
|
variant
|
|
1122
1155
|
}) => theme.components.button[variant].container.color.default, ({
|
|
@@ -1179,10 +1212,15 @@ const Button$1 = /*#__PURE__*/styled__default["default"].button.withConfig({
|
|
|
1179
1212
|
theme,
|
|
1180
1213
|
variant
|
|
1181
1214
|
}) => theme.components.button[variant].icon.color.hover);
|
|
1182
|
-
const ButtonTitle =
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1215
|
+
const ButtonTitle = styled.label(_t3 || (_t3 = _`
|
|
1216
|
+
font-size: ${0};
|
|
1217
|
+
font-weight: ${0};
|
|
1218
|
+
letter-spacing: ${0};
|
|
1219
|
+
line-height: ${0};
|
|
1220
|
+
text-decoration: ${0};
|
|
1221
|
+
text-indent: ${0};
|
|
1222
|
+
text-transform: ${0};
|
|
1223
|
+
`), ({
|
|
1186
1224
|
theme,
|
|
1187
1225
|
size,
|
|
1188
1226
|
sizeVariant
|
|
@@ -1222,7 +1260,7 @@ function Button({
|
|
|
1222
1260
|
iconLeft,
|
|
1223
1261
|
onClick
|
|
1224
1262
|
}) {
|
|
1225
|
-
return
|
|
1263
|
+
return jsx(Button$1, Object.assign({
|
|
1226
1264
|
"data-testid": dataTestId,
|
|
1227
1265
|
variant: variant,
|
|
1228
1266
|
size: size,
|
|
@@ -1231,27 +1269,27 @@ function Button({
|
|
|
1231
1269
|
disabled: disabled,
|
|
1232
1270
|
onClick: () => !disabled && onClick()
|
|
1233
1271
|
}, {
|
|
1234
|
-
children:
|
|
1272
|
+
children: jsxs(Container, Object.assign({
|
|
1235
1273
|
size: size
|
|
1236
1274
|
}, {
|
|
1237
|
-
children: [iconLeft &&
|
|
1275
|
+
children: [iconLeft && jsx("div", Object.assign({
|
|
1238
1276
|
className: "left-img-btn",
|
|
1239
1277
|
"data-testid": `left-img-btn-${iconLeft}`
|
|
1240
1278
|
}, {
|
|
1241
|
-
children:
|
|
1279
|
+
children: jsx(Icon, {
|
|
1242
1280
|
dataTestId: `buttonIcon-${iconLeft}`,
|
|
1243
1281
|
icon: iconLeft
|
|
1244
1282
|
})
|
|
1245
|
-
})), title &&
|
|
1283
|
+
})), title && jsx(ButtonTitle, Object.assign({
|
|
1246
1284
|
size: size,
|
|
1247
1285
|
sizeVariant: SizeVariant[variant]
|
|
1248
1286
|
}, {
|
|
1249
1287
|
children: title
|
|
1250
|
-
})), iconRight &&
|
|
1288
|
+
})), iconRight && jsx("div", Object.assign({
|
|
1251
1289
|
className: "right-img-btn",
|
|
1252
1290
|
"data-testid": `left-img-btn-${iconRight}`
|
|
1253
1291
|
}, {
|
|
1254
|
-
children:
|
|
1292
|
+
children: jsx(Icon, {
|
|
1255
1293
|
dataTestId: `buttonIcon-${iconRight}`,
|
|
1256
1294
|
icon: iconRight
|
|
1257
1295
|
})
|
|
@@ -1260,4 +1298,4 @@ function Button({
|
|
|
1260
1298
|
}));
|
|
1261
1299
|
}
|
|
1262
1300
|
|
|
1263
|
-
|
|
1301
|
+
export { Button };
|