@blotoutio/providers-evo-search-sdk 1.43.0 → 1.45.0
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.cjs.js +640 -352
- package/index.js +675 -387
- package/index.mjs +640 -352
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -1040,6 +1040,15 @@ const ArrowLeft = [
|
|
|
1040
1040
|
["path", { d: "M19 12H5" }]
|
|
1041
1041
|
];
|
|
1042
1042
|
|
|
1043
|
+
/**
|
|
1044
|
+
* @license lucide v0.511.0 - ISC
|
|
1045
|
+
*
|
|
1046
|
+
* This source code is licensed under the ISC license.
|
|
1047
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1048
|
+
*/
|
|
1049
|
+
|
|
1050
|
+
const Check = [["path", { d: "M20 6 9 17l-5-5" }]];
|
|
1051
|
+
|
|
1043
1052
|
/**
|
|
1044
1053
|
* @license lucide v0.511.0 - ISC
|
|
1045
1054
|
*
|
|
@@ -1058,6 +1067,19 @@ const ChevronLeft = [["path", { d: "m15 18-6-6 6-6" }]];
|
|
|
1058
1067
|
|
|
1059
1068
|
const ChevronRight = [["path", { d: "m9 18 6-6-6-6" }]];
|
|
1060
1069
|
|
|
1070
|
+
/**
|
|
1071
|
+
* @license lucide v0.511.0 - ISC
|
|
1072
|
+
*
|
|
1073
|
+
* This source code is licensed under the ISC license.
|
|
1074
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1075
|
+
*/
|
|
1076
|
+
|
|
1077
|
+
const CircleX = [
|
|
1078
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
1079
|
+
["path", { d: "m15 9-6 6" }],
|
|
1080
|
+
["path", { d: "m9 9 6 6" }]
|
|
1081
|
+
];
|
|
1082
|
+
|
|
1061
1083
|
/**
|
|
1062
1084
|
* @license lucide v0.511.0 - ISC
|
|
1063
1085
|
*
|
|
@@ -1067,6 +1089,51 @@ const ChevronRight = [["path", { d: "m9 18 6-6-6-6" }]];
|
|
|
1067
1089
|
|
|
1068
1090
|
const Circle = [["circle", { cx: "12", cy: "12", r: "10" }]];
|
|
1069
1091
|
|
|
1092
|
+
/**
|
|
1093
|
+
* @license lucide v0.511.0 - ISC
|
|
1094
|
+
*
|
|
1095
|
+
* This source code is licensed under the ISC license.
|
|
1096
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1097
|
+
*/
|
|
1098
|
+
|
|
1099
|
+
const Cookie = [
|
|
1100
|
+
["path", { d: "M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5" }],
|
|
1101
|
+
["path", { d: "M8.5 8.5v.01" }],
|
|
1102
|
+
["path", { d: "M16 15.5v.01" }],
|
|
1103
|
+
["path", { d: "M12 12v.01" }],
|
|
1104
|
+
["path", { d: "M11 17v.01" }],
|
|
1105
|
+
["path", { d: "M7 14v.01" }]
|
|
1106
|
+
];
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* @license lucide v0.511.0 - ISC
|
|
1110
|
+
*
|
|
1111
|
+
* This source code is licensed under the ISC license.
|
|
1112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1113
|
+
*/
|
|
1114
|
+
|
|
1115
|
+
const FileImage = [
|
|
1116
|
+
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }],
|
|
1117
|
+
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }],
|
|
1118
|
+
["circle", { cx: "10", cy: "12", r: "2" }],
|
|
1119
|
+
["path", { d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22" }]
|
|
1120
|
+
];
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* @license lucide v0.511.0 - ISC
|
|
1124
|
+
*
|
|
1125
|
+
* This source code is licensed under the ISC license.
|
|
1126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1127
|
+
*/
|
|
1128
|
+
|
|
1129
|
+
const FileText = [
|
|
1130
|
+
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }],
|
|
1131
|
+
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }],
|
|
1132
|
+
["path", { d: "M10 9H8" }],
|
|
1133
|
+
["path", { d: "M16 13H8" }],
|
|
1134
|
+
["path", { d: "M16 17H8" }]
|
|
1135
|
+
];
|
|
1136
|
+
|
|
1070
1137
|
/**
|
|
1071
1138
|
* @license lucide v0.511.0 - ISC
|
|
1072
1139
|
*
|
|
@@ -1121,6 +1188,28 @@ const History = [
|
|
|
1121
1188
|
["path", { d: "M12 7v5l4 2" }]
|
|
1122
1189
|
];
|
|
1123
1190
|
|
|
1191
|
+
/**
|
|
1192
|
+
* @license lucide v0.511.0 - ISC
|
|
1193
|
+
*
|
|
1194
|
+
* This source code is licensed under the ISC license.
|
|
1195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1196
|
+
*/
|
|
1197
|
+
|
|
1198
|
+
const Info = [
|
|
1199
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
1200
|
+
["path", { d: "M12 16v-4" }],
|
|
1201
|
+
["path", { d: "M12 8h.01" }]
|
|
1202
|
+
];
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* @license lucide v0.511.0 - ISC
|
|
1206
|
+
*
|
|
1207
|
+
* This source code is licensed under the ISC license.
|
|
1208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1209
|
+
*/
|
|
1210
|
+
|
|
1211
|
+
const LoaderCircle = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }]];
|
|
1212
|
+
|
|
1124
1213
|
/**
|
|
1125
1214
|
* @license lucide v0.511.0 - ISC
|
|
1126
1215
|
*
|
|
@@ -1161,6 +1250,41 @@ const MessageCircleQuestion = [
|
|
|
1161
1250
|
|
|
1162
1251
|
const MessageCircle = [["path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }]];
|
|
1163
1252
|
|
|
1253
|
+
/**
|
|
1254
|
+
* @license lucide v0.511.0 - ISC
|
|
1255
|
+
*
|
|
1256
|
+
* This source code is licensed under the ISC license.
|
|
1257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1258
|
+
*/
|
|
1259
|
+
|
|
1260
|
+
const Minus = [["path", { d: "M5 12h14" }]];
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* @license lucide v0.511.0 - ISC
|
|
1264
|
+
*
|
|
1265
|
+
* This source code is licensed under the ISC license.
|
|
1266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1267
|
+
*/
|
|
1268
|
+
|
|
1269
|
+
const PanelLeftClose = [
|
|
1270
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
|
|
1271
|
+
["path", { d: "M9 3v18" }],
|
|
1272
|
+
["path", { d: "m16 15-3-3 3-3" }]
|
|
1273
|
+
];
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* @license lucide v0.511.0 - ISC
|
|
1277
|
+
*
|
|
1278
|
+
* This source code is licensed under the ISC license.
|
|
1279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1280
|
+
*/
|
|
1281
|
+
|
|
1282
|
+
const PanelLeftOpen = [
|
|
1283
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
|
|
1284
|
+
["path", { d: "M9 3v18" }],
|
|
1285
|
+
["path", { d: "m14 9 3 3-3 3" }]
|
|
1286
|
+
];
|
|
1287
|
+
|
|
1164
1288
|
/**
|
|
1165
1289
|
* @license lucide v0.511.0 - ISC
|
|
1166
1290
|
*
|
|
@@ -1191,6 +1315,18 @@ const Percent = [
|
|
|
1191
1315
|
["circle", { cx: "17.5", cy: "17.5", r: "2.5" }]
|
|
1192
1316
|
];
|
|
1193
1317
|
|
|
1318
|
+
/**
|
|
1319
|
+
* @license lucide v0.511.0 - ISC
|
|
1320
|
+
*
|
|
1321
|
+
* This source code is licensed under the ISC license.
|
|
1322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1323
|
+
*/
|
|
1324
|
+
|
|
1325
|
+
const Plus = [
|
|
1326
|
+
["path", { d: "M5 12h14" }],
|
|
1327
|
+
["path", { d: "M12 5v14" }]
|
|
1328
|
+
];
|
|
1329
|
+
|
|
1194
1330
|
/**
|
|
1195
1331
|
* @license lucide v0.511.0 - ISC
|
|
1196
1332
|
*
|
|
@@ -1220,6 +1356,22 @@ const SendHorizontal = [
|
|
|
1220
1356
|
["path", { d: "M6 12h16" }]
|
|
1221
1357
|
];
|
|
1222
1358
|
|
|
1359
|
+
/**
|
|
1360
|
+
* @license lucide v0.511.0 - ISC
|
|
1361
|
+
*
|
|
1362
|
+
* This source code is licensed under the ISC license.
|
|
1363
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1364
|
+
*/
|
|
1365
|
+
|
|
1366
|
+
const ShoppingCart = [
|
|
1367
|
+
["circle", { cx: "8", cy: "21", r: "1" }],
|
|
1368
|
+
["circle", { cx: "19", cy: "21", r: "1" }],
|
|
1369
|
+
[
|
|
1370
|
+
"path",
|
|
1371
|
+
{ d: "M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12" }
|
|
1372
|
+
]
|
|
1373
|
+
];
|
|
1374
|
+
|
|
1223
1375
|
/**
|
|
1224
1376
|
* @license lucide v0.511.0 - ISC
|
|
1225
1377
|
*
|
|
@@ -1232,6 +1384,18 @@ const TrendingUp = [
|
|
|
1232
1384
|
["path", { d: "m22 7-8.5 8.5-5-5L2 17" }]
|
|
1233
1385
|
];
|
|
1234
1386
|
|
|
1387
|
+
/**
|
|
1388
|
+
* @license lucide v0.511.0 - ISC
|
|
1389
|
+
*
|
|
1390
|
+
* This source code is licensed under the ISC license.
|
|
1391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1392
|
+
*/
|
|
1393
|
+
|
|
1394
|
+
const Video = [
|
|
1395
|
+
["path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }],
|
|
1396
|
+
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
|
|
1397
|
+
];
|
|
1398
|
+
|
|
1235
1399
|
/**
|
|
1236
1400
|
* @license lucide v0.511.0 - ISC
|
|
1237
1401
|
*
|
|
@@ -1244,6 +1408,15 @@ const X = [
|
|
|
1244
1408
|
["path", { d: "m6 6 12 12" }]
|
|
1245
1409
|
];
|
|
1246
1410
|
|
|
1411
|
+
/**
|
|
1412
|
+
* Mapping of icon name keys to their component implementations.
|
|
1413
|
+
* Keys correspond to {@link IconNames}; values are Lucide icon components.
|
|
1414
|
+
* @readonly
|
|
1415
|
+
* @example
|
|
1416
|
+
* import { icons, IconNames } from '@libs/lit-ui-kit';
|
|
1417
|
+
* const SearchIcon = icons['search'];
|
|
1418
|
+
* const name: IconNames = 'search';
|
|
1419
|
+
*/
|
|
1247
1420
|
const icons = {
|
|
1248
1421
|
search: Search,
|
|
1249
1422
|
headset: Headset,
|
|
@@ -1261,350 +1434,77 @@ const icons = {
|
|
|
1261
1434
|
sendHorizontal: SendHorizontal,
|
|
1262
1435
|
trendingUp: TrendingUp,
|
|
1263
1436
|
paperClip: Paperclip,
|
|
1437
|
+
shoppingCart: ShoppingCart,
|
|
1438
|
+
loaderCircle: LoaderCircle,
|
|
1439
|
+
check: Check,
|
|
1440
|
+
circleX: CircleX,
|
|
1441
|
+
minus: Minus,
|
|
1442
|
+
plus: Plus,
|
|
1443
|
+
fileText: FileText,
|
|
1444
|
+
video: Video,
|
|
1445
|
+
fileImage: FileImage,
|
|
1446
|
+
info: Info,
|
|
1447
|
+
panelLeftOpen: PanelLeftOpen,
|
|
1448
|
+
panelLeftClose: PanelLeftClose,
|
|
1449
|
+
cookie: Cookie,
|
|
1264
1450
|
};
|
|
1265
1451
|
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
}
|
|
1281
|
-
const icon = icons[this.name];
|
|
1282
|
-
const iconElement = createElement(icon, {
|
|
1283
|
-
width: this.width,
|
|
1284
|
-
height: this.height,
|
|
1285
|
-
stroke: this.stroke,
|
|
1286
|
-
fill: this.fill,
|
|
1287
|
-
'stroke-width': this.strokeWidth,
|
|
1288
|
-
'stroke-linecap': this.strokeLinecap,
|
|
1289
|
-
'stroke-linejoin': this.strokeLinejoin,
|
|
1290
|
-
});
|
|
1291
|
-
return b `<div class="icon-wrapper">${iconElement}</div>`;
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
BTLucideIcon.styles = [
|
|
1295
|
-
i$3 `
|
|
1296
|
-
:host {
|
|
1297
|
-
margin: 0;
|
|
1298
|
-
font-size: 0;
|
|
1299
|
-
line-height: 0;
|
|
1300
|
-
display: inline-block;
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
.icon-wrapper {
|
|
1304
|
-
width: 100%;
|
|
1305
|
-
height: 100%;
|
|
1306
|
-
display: flex;
|
|
1307
|
-
align-items: center;
|
|
1308
|
-
justify-content: center;
|
|
1452
|
+
/**
|
|
1453
|
+
* Concatenates two arrays faster than the array spread operator.
|
|
1454
|
+
*/
|
|
1455
|
+
const concatArrays = (array1, array2) => {
|
|
1456
|
+
// Pre-allocate for better V8 optimization
|
|
1457
|
+
const combinedArray = new Array(array1.length + array2.length);
|
|
1458
|
+
for (let i = 0; i < array1.length; i++) {
|
|
1459
|
+
combinedArray[i] = array1[i];
|
|
1460
|
+
}
|
|
1461
|
+
for (let i = 0; i < array2.length; i++) {
|
|
1462
|
+
combinedArray[array1.length + i] = array2[i];
|
|
1463
|
+
}
|
|
1464
|
+
return combinedArray;
|
|
1465
|
+
};
|
|
1309
1466
|
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1467
|
+
// Factory function ensures consistent object shapes
|
|
1468
|
+
const createClassValidatorObject = (classGroupId, validator) => ({
|
|
1469
|
+
classGroupId,
|
|
1470
|
+
validator
|
|
1471
|
+
});
|
|
1472
|
+
// Factory ensures consistent ClassPartObject shape
|
|
1473
|
+
const createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({
|
|
1474
|
+
nextPart,
|
|
1475
|
+
validators,
|
|
1476
|
+
classGroupId
|
|
1477
|
+
});
|
|
1478
|
+
const CLASS_PART_SEPARATOR = '-';
|
|
1479
|
+
const EMPTY_CONFLICTS = [];
|
|
1480
|
+
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
1481
|
+
const ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';
|
|
1482
|
+
const createClassGroupUtils = config => {
|
|
1483
|
+
const classMap = createClassMap(config);
|
|
1484
|
+
const {
|
|
1485
|
+
conflictingClassGroups,
|
|
1486
|
+
conflictingClassGroupModifiers
|
|
1487
|
+
} = config;
|
|
1488
|
+
const getClassGroupId = className => {
|
|
1489
|
+
if (className.startsWith('[') && className.endsWith(']')) {
|
|
1490
|
+
return getGroupIdForArbitraryProperty(className);
|
|
1491
|
+
}
|
|
1492
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
1493
|
+
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and skip it.
|
|
1494
|
+
const startIndex = classParts[0] === '' && classParts.length > 1 ? 1 : 0;
|
|
1495
|
+
return getGroupRecursive(classParts, startIndex, classMap);
|
|
1496
|
+
};
|
|
1497
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
1498
|
+
if (hasPostfixModifier) {
|
|
1499
|
+
const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
|
|
1500
|
+
const baseConflicts = conflictingClassGroups[classGroupId];
|
|
1501
|
+
if (modifierConflicts) {
|
|
1502
|
+
if (baseConflicts) {
|
|
1503
|
+
// Merge base conflicts with modifier conflicts
|
|
1504
|
+
return concatArrays(baseConflicts, modifierConflicts);
|
|
1313
1505
|
}
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
];
|
|
1317
|
-
__decorate([
|
|
1318
|
-
n$1({ type: String }),
|
|
1319
|
-
__metadata("design:type", Object)
|
|
1320
|
-
], BTLucideIcon.prototype, "name", void 0);
|
|
1321
|
-
__decorate([
|
|
1322
|
-
n$1(),
|
|
1323
|
-
__metadata("design:type", Object)
|
|
1324
|
-
], BTLucideIcon.prototype, "width", void 0);
|
|
1325
|
-
__decorate([
|
|
1326
|
-
n$1(),
|
|
1327
|
-
__metadata("design:type", Object)
|
|
1328
|
-
], BTLucideIcon.prototype, "height", void 0);
|
|
1329
|
-
__decorate([
|
|
1330
|
-
n$1({ type: String }),
|
|
1331
|
-
__metadata("design:type", Object)
|
|
1332
|
-
], BTLucideIcon.prototype, "stroke", void 0);
|
|
1333
|
-
__decorate([
|
|
1334
|
-
n$1({ type: String }),
|
|
1335
|
-
__metadata("design:type", Object)
|
|
1336
|
-
], BTLucideIcon.prototype, "fill", void 0);
|
|
1337
|
-
__decorate([
|
|
1338
|
-
n$1({ type: Number }),
|
|
1339
|
-
__metadata("design:type", Object)
|
|
1340
|
-
], BTLucideIcon.prototype, "strokeWidth", void 0);
|
|
1341
|
-
__decorate([
|
|
1342
|
-
n$1({ type: String }),
|
|
1343
|
-
__metadata("design:type", Object)
|
|
1344
|
-
], BTLucideIcon.prototype, "strokeLinecap", void 0);
|
|
1345
|
-
__decorate([
|
|
1346
|
-
n$1({ type: String }),
|
|
1347
|
-
__metadata("design:type", Object)
|
|
1348
|
-
], BTLucideIcon.prototype, "strokeLinejoin", void 0);
|
|
1349
|
-
if (!customElements.get('bt-lucide-icon')) {
|
|
1350
|
-
customElements.define('bt-lucide-icon', BTLucideIcon);
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
const TwLitElement$6 = TW(i);
|
|
1354
|
-
const carouselSizeVariants = cva('relative', {
|
|
1355
|
-
variants: {
|
|
1356
|
-
size: {
|
|
1357
|
-
sm: 'max-w-xs',
|
|
1358
|
-
md: 'max-w-md',
|
|
1359
|
-
lg: 'max-w-lg',
|
|
1360
|
-
xl: 'max-w-xl',
|
|
1361
|
-
},
|
|
1362
|
-
},
|
|
1363
|
-
});
|
|
1364
|
-
const carouselContentClasses = 'flex gap-2 overflow-x-auto whitespace-nowrap [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden snap-x snap-mandatory [-webkit-overflow-scrolling:touch]';
|
|
1365
|
-
const navButtonClasses = 'absolute top-1/2 -translate-y-1/2 z-10 w-8 h-8 rounded-full cursor-pointer flex items-center justify-center text-black bg-neutral-20 border border-neutral-40 opacity-0 transition-opacity duration-200 ease-in-out';
|
|
1366
|
-
const navButtonLeftClasses = 'left-2';
|
|
1367
|
-
const navButtonRightClasses = 'right-2';
|
|
1368
|
-
class BTCarousel extends TwLitElement$6 {
|
|
1369
|
-
constructor() {
|
|
1370
|
-
super(...arguments);
|
|
1371
|
-
this.selectable = false;
|
|
1372
|
-
this.selected = -1;
|
|
1373
|
-
this.disableButtons = false;
|
|
1374
|
-
this.canScrollLeft = false;
|
|
1375
|
-
this.canScrollRight = true;
|
|
1376
|
-
this.abortController = new AbortController();
|
|
1377
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
1378
|
-
this.updateScrollState();
|
|
1379
|
-
});
|
|
1380
|
-
}
|
|
1381
|
-
async handleSlotChange(e) {
|
|
1382
|
-
this.abortController.abort();
|
|
1383
|
-
this.abortController = new AbortController();
|
|
1384
|
-
const slot = e.target;
|
|
1385
|
-
const elements = slot.assignedElements();
|
|
1386
|
-
elements.forEach((element, index) => {
|
|
1387
|
-
element.addEventListener('click', (clickEvent) => this.handleItemClick(clickEvent, index), {
|
|
1388
|
-
capture: true,
|
|
1389
|
-
signal: this.abortController.signal,
|
|
1390
|
-
});
|
|
1391
|
-
});
|
|
1392
|
-
await this.updateComplete;
|
|
1393
|
-
this.updateScrollState();
|
|
1394
|
-
}
|
|
1395
|
-
firstUpdated() {
|
|
1396
|
-
if (this.scrollContainer) {
|
|
1397
|
-
this.resizeObserver.observe(this.scrollContainer);
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
handleItemClick(e, index) {
|
|
1401
|
-
var _a, _b, _c;
|
|
1402
|
-
e.preventDefault();
|
|
1403
|
-
e.stopPropagation();
|
|
1404
|
-
const elements = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot')) === null || _b === void 0 ? void 0 : _b.assignedElements();
|
|
1405
|
-
const clickedElement = elements === null || elements === void 0 ? void 0 : elements[index];
|
|
1406
|
-
if (!clickedElement) {
|
|
1407
|
-
return;
|
|
1408
|
-
}
|
|
1409
|
-
clickedElement.scrollIntoView({
|
|
1410
|
-
behavior: 'smooth',
|
|
1411
|
-
block: 'nearest',
|
|
1412
|
-
inline: 'center',
|
|
1413
|
-
});
|
|
1414
|
-
if (this.selectable) {
|
|
1415
|
-
this.selected = index;
|
|
1416
|
-
const itemData = {
|
|
1417
|
-
index,
|
|
1418
|
-
element: clickedElement,
|
|
1419
|
-
text: ((_c = clickedElement.textContent) === null || _c === void 0 ? void 0 : _c.trim()) || '',
|
|
1420
|
-
value: clickedElement.getAttribute('value') ||
|
|
1421
|
-
clickedElement.getAttribute('data-value') ||
|
|
1422
|
-
'',
|
|
1423
|
-
id: clickedElement.id || '',
|
|
1424
|
-
dataset: { ...clickedElement.dataset },
|
|
1425
|
-
};
|
|
1426
|
-
const selectEvent = new CustomEvent('select', {
|
|
1427
|
-
detail: itemData,
|
|
1428
|
-
bubbles: true,
|
|
1429
|
-
composed: true,
|
|
1430
|
-
});
|
|
1431
|
-
this.dispatchEvent(selectEvent);
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
updateScrollState() {
|
|
1435
|
-
if (!this.scrollContainer) {
|
|
1436
|
-
return;
|
|
1437
|
-
}
|
|
1438
|
-
const { scrollLeft, scrollWidth, clientWidth } = this.scrollContainer;
|
|
1439
|
-
this.canScrollLeft = scrollLeft > 0;
|
|
1440
|
-
this.canScrollRight = scrollLeft < scrollWidth - clientWidth - 1;
|
|
1441
|
-
}
|
|
1442
|
-
handleScrollLeft() {
|
|
1443
|
-
if (this.scrollContainer) {
|
|
1444
|
-
const scrollAmount = this.scrollContainer.clientWidth * 0.6;
|
|
1445
|
-
this.scrollContainer.scrollBy({
|
|
1446
|
-
left: -scrollAmount,
|
|
1447
|
-
behavior: 'smooth',
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
handleScrollRight() {
|
|
1452
|
-
if (this.scrollContainer) {
|
|
1453
|
-
const scrollAmount = this.scrollContainer.clientWidth * 0.6;
|
|
1454
|
-
this.scrollContainer.scrollBy({
|
|
1455
|
-
left: scrollAmount,
|
|
1456
|
-
behavior: 'smooth',
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
render() {
|
|
1461
|
-
return b `
|
|
1462
|
-
<div
|
|
1463
|
-
class=${`carousel-wrapper ${carouselSizeVariants({ size: this.size })}`}
|
|
1464
|
-
>
|
|
1465
|
-
<div
|
|
1466
|
-
class=${`carousel-content ${carouselContentClasses}`}
|
|
1467
|
-
@scroll=${this.updateScrollState}
|
|
1468
|
-
>
|
|
1469
|
-
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
1470
|
-
</div>
|
|
1471
|
-
|
|
1472
|
-
${n(!this.disableButtons, () => b `
|
|
1473
|
-
${n(this.canScrollLeft, () => b `
|
|
1474
|
-
<button
|
|
1475
|
-
class=${`nav-button ${navButtonClasses} ${navButtonLeftClasses}`}
|
|
1476
|
-
@click=${this.handleScrollLeft}
|
|
1477
|
-
>
|
|
1478
|
-
<bt-lucide-icon
|
|
1479
|
-
name="left"
|
|
1480
|
-
width="16"
|
|
1481
|
-
height="16"
|
|
1482
|
-
></bt-lucide-icon>
|
|
1483
|
-
</button>
|
|
1484
|
-
`)}
|
|
1485
|
-
${n(this.canScrollRight, () => b `
|
|
1486
|
-
<button
|
|
1487
|
-
class=${`nav-button ${navButtonClasses} ${navButtonRightClasses}`}
|
|
1488
|
-
@click=${this.handleScrollRight}
|
|
1489
|
-
>
|
|
1490
|
-
<bt-lucide-icon
|
|
1491
|
-
name="right"
|
|
1492
|
-
width="16"
|
|
1493
|
-
height="16"
|
|
1494
|
-
></bt-lucide-icon>
|
|
1495
|
-
</button>
|
|
1496
|
-
`)}
|
|
1497
|
-
`)}
|
|
1498
|
-
</div>
|
|
1499
|
-
`;
|
|
1500
|
-
}
|
|
1501
|
-
disconnectedCallback() {
|
|
1502
|
-
super.disconnectedCallback();
|
|
1503
|
-
this.abortController.abort();
|
|
1504
|
-
this.resizeObserver.disconnect();
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
BTCarousel.styles = i$3 `
|
|
1508
|
-
:host {
|
|
1509
|
-
display: block;
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
.carousel-wrapper:hover .nav-button {
|
|
1513
|
-
opacity: 1;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
::slotted(*) {
|
|
1517
|
-
scroll-snap-align: center;
|
|
1518
|
-
}
|
|
1519
|
-
`;
|
|
1520
|
-
__decorate([
|
|
1521
|
-
n$1({ type: Boolean }),
|
|
1522
|
-
__metadata("design:type", Object)
|
|
1523
|
-
], BTCarousel.prototype, "selectable", void 0);
|
|
1524
|
-
__decorate([
|
|
1525
|
-
n$1({ type: Number }),
|
|
1526
|
-
__metadata("design:type", Object)
|
|
1527
|
-
], BTCarousel.prototype, "selected", void 0);
|
|
1528
|
-
__decorate([
|
|
1529
|
-
n$1({ type: String }),
|
|
1530
|
-
__metadata("design:type", Object)
|
|
1531
|
-
], BTCarousel.prototype, "size", void 0);
|
|
1532
|
-
__decorate([
|
|
1533
|
-
n$1({ type: Boolean }),
|
|
1534
|
-
__metadata("design:type", Object)
|
|
1535
|
-
], BTCarousel.prototype, "disableButtons", void 0);
|
|
1536
|
-
__decorate([
|
|
1537
|
-
e('.carousel-content'),
|
|
1538
|
-
__metadata("design:type", HTMLElement)
|
|
1539
|
-
], BTCarousel.prototype, "scrollContainer", void 0);
|
|
1540
|
-
__decorate([
|
|
1541
|
-
r$1(),
|
|
1542
|
-
__metadata("design:type", Object)
|
|
1543
|
-
], BTCarousel.prototype, "canScrollLeft", void 0);
|
|
1544
|
-
__decorate([
|
|
1545
|
-
r$1(),
|
|
1546
|
-
__metadata("design:type", Object)
|
|
1547
|
-
], BTCarousel.prototype, "canScrollRight", void 0);
|
|
1548
|
-
if (!customElements.get('bt-carousel')) {
|
|
1549
|
-
customElements.define('bt-carousel', BTCarousel);
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
* Concatenates two arrays faster than the array spread operator.
|
|
1554
|
-
*/
|
|
1555
|
-
const concatArrays = (array1, array2) => {
|
|
1556
|
-
// Pre-allocate for better V8 optimization
|
|
1557
|
-
const combinedArray = new Array(array1.length + array2.length);
|
|
1558
|
-
for (let i = 0; i < array1.length; i++) {
|
|
1559
|
-
combinedArray[i] = array1[i];
|
|
1560
|
-
}
|
|
1561
|
-
for (let i = 0; i < array2.length; i++) {
|
|
1562
|
-
combinedArray[array1.length + i] = array2[i];
|
|
1563
|
-
}
|
|
1564
|
-
return combinedArray;
|
|
1565
|
-
};
|
|
1566
|
-
|
|
1567
|
-
// Factory function ensures consistent object shapes
|
|
1568
|
-
const createClassValidatorObject = (classGroupId, validator) => ({
|
|
1569
|
-
classGroupId,
|
|
1570
|
-
validator
|
|
1571
|
-
});
|
|
1572
|
-
// Factory ensures consistent ClassPartObject shape
|
|
1573
|
-
const createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({
|
|
1574
|
-
nextPart,
|
|
1575
|
-
validators,
|
|
1576
|
-
classGroupId
|
|
1577
|
-
});
|
|
1578
|
-
const CLASS_PART_SEPARATOR = '-';
|
|
1579
|
-
const EMPTY_CONFLICTS = [];
|
|
1580
|
-
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
1581
|
-
const ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';
|
|
1582
|
-
const createClassGroupUtils = config => {
|
|
1583
|
-
const classMap = createClassMap(config);
|
|
1584
|
-
const {
|
|
1585
|
-
conflictingClassGroups,
|
|
1586
|
-
conflictingClassGroupModifiers
|
|
1587
|
-
} = config;
|
|
1588
|
-
const getClassGroupId = className => {
|
|
1589
|
-
if (className.startsWith('[') && className.endsWith(']')) {
|
|
1590
|
-
return getGroupIdForArbitraryProperty(className);
|
|
1591
|
-
}
|
|
1592
|
-
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
1593
|
-
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and skip it.
|
|
1594
|
-
const startIndex = classParts[0] === '' && classParts.length > 1 ? 1 : 0;
|
|
1595
|
-
return getGroupRecursive(classParts, startIndex, classMap);
|
|
1596
|
-
};
|
|
1597
|
-
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
1598
|
-
if (hasPostfixModifier) {
|
|
1599
|
-
const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
|
|
1600
|
-
const baseConflicts = conflictingClassGroups[classGroupId];
|
|
1601
|
-
if (modifierConflicts) {
|
|
1602
|
-
if (baseConflicts) {
|
|
1603
|
-
// Merge base conflicts with modifier conflicts
|
|
1604
|
-
return concatArrays(baseConflicts, modifierConflicts);
|
|
1605
|
-
}
|
|
1606
|
-
// Only modifier conflicts
|
|
1607
|
-
return modifierConflicts;
|
|
1506
|
+
// Only modifier conflicts
|
|
1507
|
+
return modifierConflicts;
|
|
1608
1508
|
}
|
|
1609
1509
|
// Fall back to without postfix if no modifier conflicts
|
|
1610
1510
|
return baseConflicts || EMPTY_CONFLICTS;
|
|
@@ -4583,7 +4483,304 @@ const getDefaultConfig = () => {
|
|
|
4583
4483
|
};
|
|
4584
4484
|
const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
|
|
4585
4485
|
|
|
4586
|
-
|
|
4486
|
+
class BTLucideIcon extends i {
|
|
4487
|
+
constructor() {
|
|
4488
|
+
super(...arguments);
|
|
4489
|
+
this.width = 24;
|
|
4490
|
+
this.height = 24;
|
|
4491
|
+
this.stroke = 'currentColor';
|
|
4492
|
+
this.fill = 'none';
|
|
4493
|
+
this.strokeWidth = 2;
|
|
4494
|
+
this.strokeLinecap = 'round';
|
|
4495
|
+
this.strokeLinejoin = 'round';
|
|
4496
|
+
/**
|
|
4497
|
+
* CSS class applied to the icon wrapper div. Maps to the attribute 'icon-wrapper-class'.
|
|
4498
|
+
* Default is empty string. Use to add custom styling (e.g. margin, padding) around the icon.
|
|
4499
|
+
*/
|
|
4500
|
+
this.iconWrapperClass = '';
|
|
4501
|
+
}
|
|
4502
|
+
render() {
|
|
4503
|
+
if (!this.name) {
|
|
4504
|
+
return;
|
|
4505
|
+
}
|
|
4506
|
+
const icon = icons[this.name];
|
|
4507
|
+
const iconElement = createElement(icon, {
|
|
4508
|
+
width: this.width,
|
|
4509
|
+
height: this.height,
|
|
4510
|
+
stroke: this.stroke,
|
|
4511
|
+
fill: this.fill,
|
|
4512
|
+
'stroke-width': this.strokeWidth,
|
|
4513
|
+
'stroke-linecap': this.strokeLinecap,
|
|
4514
|
+
'stroke-linejoin': this.strokeLinejoin,
|
|
4515
|
+
});
|
|
4516
|
+
return b `<div class=${twMerge('icon-wrapper', this.iconWrapperClass)}>
|
|
4517
|
+
${iconElement}
|
|
4518
|
+
</div>`;
|
|
4519
|
+
}
|
|
4520
|
+
}
|
|
4521
|
+
BTLucideIcon.styles = [
|
|
4522
|
+
i$3 `
|
|
4523
|
+
:host {
|
|
4524
|
+
margin: 0;
|
|
4525
|
+
font-size: 0;
|
|
4526
|
+
line-height: 0;
|
|
4527
|
+
display: inline-block;
|
|
4528
|
+
}
|
|
4529
|
+
|
|
4530
|
+
.icon-wrapper {
|
|
4531
|
+
width: 100%;
|
|
4532
|
+
height: 100%;
|
|
4533
|
+
display: flex;
|
|
4534
|
+
align-items: center;
|
|
4535
|
+
justify-content: center;
|
|
4536
|
+
|
|
4537
|
+
svg {
|
|
4538
|
+
width: 100%;
|
|
4539
|
+
height: 100%;
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
`,
|
|
4543
|
+
];
|
|
4544
|
+
__decorate([
|
|
4545
|
+
n$1({ type: String }),
|
|
4546
|
+
__metadata("design:type", Object)
|
|
4547
|
+
], BTLucideIcon.prototype, "name", void 0);
|
|
4548
|
+
__decorate([
|
|
4549
|
+
n$1(),
|
|
4550
|
+
__metadata("design:type", Object)
|
|
4551
|
+
], BTLucideIcon.prototype, "width", void 0);
|
|
4552
|
+
__decorate([
|
|
4553
|
+
n$1(),
|
|
4554
|
+
__metadata("design:type", Object)
|
|
4555
|
+
], BTLucideIcon.prototype, "height", void 0);
|
|
4556
|
+
__decorate([
|
|
4557
|
+
n$1({ type: String }),
|
|
4558
|
+
__metadata("design:type", Object)
|
|
4559
|
+
], BTLucideIcon.prototype, "stroke", void 0);
|
|
4560
|
+
__decorate([
|
|
4561
|
+
n$1({ type: String }),
|
|
4562
|
+
__metadata("design:type", Object)
|
|
4563
|
+
], BTLucideIcon.prototype, "fill", void 0);
|
|
4564
|
+
__decorate([
|
|
4565
|
+
n$1({ type: Number }),
|
|
4566
|
+
__metadata("design:type", Object)
|
|
4567
|
+
], BTLucideIcon.prototype, "strokeWidth", void 0);
|
|
4568
|
+
__decorate([
|
|
4569
|
+
n$1({ type: String }),
|
|
4570
|
+
__metadata("design:type", Object)
|
|
4571
|
+
], BTLucideIcon.prototype, "strokeLinecap", void 0);
|
|
4572
|
+
__decorate([
|
|
4573
|
+
n$1({ type: String }),
|
|
4574
|
+
__metadata("design:type", Object)
|
|
4575
|
+
], BTLucideIcon.prototype, "strokeLinejoin", void 0);
|
|
4576
|
+
__decorate([
|
|
4577
|
+
n$1({ type: String, attribute: 'icon-wrapper-class' }),
|
|
4578
|
+
__metadata("design:type", Object)
|
|
4579
|
+
], BTLucideIcon.prototype, "iconWrapperClass", void 0);
|
|
4580
|
+
if (!customElements.get('bt-lucide-icon')) {
|
|
4581
|
+
customElements.define('bt-lucide-icon', BTLucideIcon);
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4584
|
+
const TwLitElement$7 = TW(i);
|
|
4585
|
+
const carouselSizeVariants = cva('relative', {
|
|
4586
|
+
variants: {
|
|
4587
|
+
size: {
|
|
4588
|
+
sm: 'max-w-xs',
|
|
4589
|
+
md: 'max-w-md',
|
|
4590
|
+
lg: 'max-w-lg',
|
|
4591
|
+
xl: 'max-w-xl',
|
|
4592
|
+
},
|
|
4593
|
+
},
|
|
4594
|
+
});
|
|
4595
|
+
const carouselContentClasses = 'flex gap-2 overflow-x-auto whitespace-nowrap [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden snap-x snap-mandatory [-webkit-overflow-scrolling:touch]';
|
|
4596
|
+
const navButtonClasses = 'absolute top-1/2 -translate-y-1/2 z-10 w-8 h-8 rounded-full cursor-pointer flex items-center justify-center text-black bg-neutral-20 border border-neutral-40 opacity-0 transition-opacity duration-200 ease-in-out';
|
|
4597
|
+
const navButtonLeftClasses = 'left-2';
|
|
4598
|
+
const navButtonRightClasses = 'right-2';
|
|
4599
|
+
class BTCarousel extends TwLitElement$7 {
|
|
4600
|
+
constructor() {
|
|
4601
|
+
super(...arguments);
|
|
4602
|
+
this.selectable = false;
|
|
4603
|
+
this.selected = -1;
|
|
4604
|
+
this.disableButtons = false;
|
|
4605
|
+
this.canScrollLeft = false;
|
|
4606
|
+
this.canScrollRight = true;
|
|
4607
|
+
this.abortController = new AbortController();
|
|
4608
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
4609
|
+
this.updateScrollState();
|
|
4610
|
+
});
|
|
4611
|
+
}
|
|
4612
|
+
async handleSlotChange(e) {
|
|
4613
|
+
this.abortController.abort();
|
|
4614
|
+
this.abortController = new AbortController();
|
|
4615
|
+
const slot = e.target;
|
|
4616
|
+
const elements = slot.assignedElements();
|
|
4617
|
+
elements.forEach((element, index) => {
|
|
4618
|
+
element.addEventListener('click', (clickEvent) => this.handleItemClick(clickEvent, index), {
|
|
4619
|
+
capture: true,
|
|
4620
|
+
signal: this.abortController.signal,
|
|
4621
|
+
});
|
|
4622
|
+
});
|
|
4623
|
+
await this.updateComplete;
|
|
4624
|
+
this.updateScrollState();
|
|
4625
|
+
}
|
|
4626
|
+
firstUpdated() {
|
|
4627
|
+
if (this.scrollContainer) {
|
|
4628
|
+
this.resizeObserver.observe(this.scrollContainer);
|
|
4629
|
+
}
|
|
4630
|
+
}
|
|
4631
|
+
handleItemClick(e, index) {
|
|
4632
|
+
var _a, _b, _c;
|
|
4633
|
+
e.preventDefault();
|
|
4634
|
+
e.stopPropagation();
|
|
4635
|
+
const elements = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot')) === null || _b === void 0 ? void 0 : _b.assignedElements();
|
|
4636
|
+
const clickedElement = elements === null || elements === void 0 ? void 0 : elements[index];
|
|
4637
|
+
if (!clickedElement) {
|
|
4638
|
+
return;
|
|
4639
|
+
}
|
|
4640
|
+
clickedElement.scrollIntoView({
|
|
4641
|
+
behavior: 'smooth',
|
|
4642
|
+
block: 'nearest',
|
|
4643
|
+
inline: 'center',
|
|
4644
|
+
});
|
|
4645
|
+
if (this.selectable) {
|
|
4646
|
+
this.selected = index;
|
|
4647
|
+
const itemData = {
|
|
4648
|
+
index,
|
|
4649
|
+
element: clickedElement,
|
|
4650
|
+
text: ((_c = clickedElement.textContent) === null || _c === void 0 ? void 0 : _c.trim()) || '',
|
|
4651
|
+
value: clickedElement.getAttribute('value') ||
|
|
4652
|
+
clickedElement.getAttribute('data-value') ||
|
|
4653
|
+
'',
|
|
4654
|
+
id: clickedElement.id || '',
|
|
4655
|
+
dataset: { ...clickedElement.dataset },
|
|
4656
|
+
};
|
|
4657
|
+
const selectEvent = new CustomEvent('select', {
|
|
4658
|
+
detail: itemData,
|
|
4659
|
+
bubbles: true,
|
|
4660
|
+
composed: true,
|
|
4661
|
+
});
|
|
4662
|
+
this.dispatchEvent(selectEvent);
|
|
4663
|
+
}
|
|
4664
|
+
}
|
|
4665
|
+
updateScrollState() {
|
|
4666
|
+
if (!this.scrollContainer) {
|
|
4667
|
+
return;
|
|
4668
|
+
}
|
|
4669
|
+
const { scrollLeft, scrollWidth, clientWidth } = this.scrollContainer;
|
|
4670
|
+
this.canScrollLeft = scrollLeft > 0;
|
|
4671
|
+
this.canScrollRight = scrollLeft < scrollWidth - clientWidth - 1;
|
|
4672
|
+
}
|
|
4673
|
+
handleScrollLeft() {
|
|
4674
|
+
if (this.scrollContainer) {
|
|
4675
|
+
const scrollAmount = this.scrollContainer.clientWidth * 0.6;
|
|
4676
|
+
this.scrollContainer.scrollBy({
|
|
4677
|
+
left: -scrollAmount,
|
|
4678
|
+
behavior: 'smooth',
|
|
4679
|
+
});
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
handleScrollRight() {
|
|
4683
|
+
if (this.scrollContainer) {
|
|
4684
|
+
const scrollAmount = this.scrollContainer.clientWidth * 0.6;
|
|
4685
|
+
this.scrollContainer.scrollBy({
|
|
4686
|
+
left: scrollAmount,
|
|
4687
|
+
behavior: 'smooth',
|
|
4688
|
+
});
|
|
4689
|
+
}
|
|
4690
|
+
}
|
|
4691
|
+
render() {
|
|
4692
|
+
return b `
|
|
4693
|
+
<div
|
|
4694
|
+
class=${`carousel-wrapper ${carouselSizeVariants({ size: this.size })}`}
|
|
4695
|
+
>
|
|
4696
|
+
<div
|
|
4697
|
+
class=${`carousel-content ${carouselContentClasses}`}
|
|
4698
|
+
@scroll=${this.updateScrollState}
|
|
4699
|
+
>
|
|
4700
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
4701
|
+
</div>
|
|
4702
|
+
|
|
4703
|
+
${n(!this.disableButtons, () => b `
|
|
4704
|
+
${n(this.canScrollLeft, () => b `
|
|
4705
|
+
<button
|
|
4706
|
+
class=${`nav-button ${navButtonClasses} ${navButtonLeftClasses}`}
|
|
4707
|
+
@click=${this.handleScrollLeft}
|
|
4708
|
+
>
|
|
4709
|
+
<bt-lucide-icon
|
|
4710
|
+
name="left"
|
|
4711
|
+
width="16"
|
|
4712
|
+
height="16"
|
|
4713
|
+
></bt-lucide-icon>
|
|
4714
|
+
</button>
|
|
4715
|
+
`)}
|
|
4716
|
+
${n(this.canScrollRight, () => b `
|
|
4717
|
+
<button
|
|
4718
|
+
class=${`nav-button ${navButtonClasses} ${navButtonRightClasses}`}
|
|
4719
|
+
@click=${this.handleScrollRight}
|
|
4720
|
+
>
|
|
4721
|
+
<bt-lucide-icon
|
|
4722
|
+
name="right"
|
|
4723
|
+
width="16"
|
|
4724
|
+
height="16"
|
|
4725
|
+
></bt-lucide-icon>
|
|
4726
|
+
</button>
|
|
4727
|
+
`)}
|
|
4728
|
+
`)}
|
|
4729
|
+
</div>
|
|
4730
|
+
`;
|
|
4731
|
+
}
|
|
4732
|
+
disconnectedCallback() {
|
|
4733
|
+
super.disconnectedCallback();
|
|
4734
|
+
this.abortController.abort();
|
|
4735
|
+
this.resizeObserver.disconnect();
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4738
|
+
BTCarousel.styles = i$3 `
|
|
4739
|
+
:host {
|
|
4740
|
+
display: block;
|
|
4741
|
+
}
|
|
4742
|
+
|
|
4743
|
+
.carousel-wrapper:hover .nav-button {
|
|
4744
|
+
opacity: 1;
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4747
|
+
::slotted(*) {
|
|
4748
|
+
scroll-snap-align: center;
|
|
4749
|
+
}
|
|
4750
|
+
`;
|
|
4751
|
+
__decorate([
|
|
4752
|
+
n$1({ type: Boolean }),
|
|
4753
|
+
__metadata("design:type", Object)
|
|
4754
|
+
], BTCarousel.prototype, "selectable", void 0);
|
|
4755
|
+
__decorate([
|
|
4756
|
+
n$1({ type: Number }),
|
|
4757
|
+
__metadata("design:type", Object)
|
|
4758
|
+
], BTCarousel.prototype, "selected", void 0);
|
|
4759
|
+
__decorate([
|
|
4760
|
+
n$1({ type: String }),
|
|
4761
|
+
__metadata("design:type", Object)
|
|
4762
|
+
], BTCarousel.prototype, "size", void 0);
|
|
4763
|
+
__decorate([
|
|
4764
|
+
n$1({ type: Boolean }),
|
|
4765
|
+
__metadata("design:type", Object)
|
|
4766
|
+
], BTCarousel.prototype, "disableButtons", void 0);
|
|
4767
|
+
__decorate([
|
|
4768
|
+
e('.carousel-content'),
|
|
4769
|
+
__metadata("design:type", HTMLElement)
|
|
4770
|
+
], BTCarousel.prototype, "scrollContainer", void 0);
|
|
4771
|
+
__decorate([
|
|
4772
|
+
r$1(),
|
|
4773
|
+
__metadata("design:type", Object)
|
|
4774
|
+
], BTCarousel.prototype, "canScrollLeft", void 0);
|
|
4775
|
+
__decorate([
|
|
4776
|
+
r$1(),
|
|
4777
|
+
__metadata("design:type", Object)
|
|
4778
|
+
], BTCarousel.prototype, "canScrollRight", void 0);
|
|
4779
|
+
if (!customElements.get('bt-carousel')) {
|
|
4780
|
+
customElements.define('bt-carousel', BTCarousel);
|
|
4781
|
+
}
|
|
4782
|
+
|
|
4783
|
+
const TwLitElement$6 = TW(i);
|
|
4587
4784
|
const pillVariants = cva('inline-flex items-center justify-center bg-white rounded-full border cursor-pointer select-none min-w-0 shrink-0 font-normal', {
|
|
4588
4785
|
variants: {
|
|
4589
4786
|
variant: {
|
|
@@ -4601,7 +4798,7 @@ const pillVariants = cva('inline-flex items-center justify-center bg-white round
|
|
|
4601
4798
|
size: 'md',
|
|
4602
4799
|
},
|
|
4603
4800
|
});
|
|
4604
|
-
class BTPill extends TwLitElement$
|
|
4801
|
+
class BTPill extends TwLitElement$6 {
|
|
4605
4802
|
constructor() {
|
|
4606
4803
|
super(...arguments);
|
|
4607
4804
|
this.selected = false;
|
|
@@ -4642,7 +4839,7 @@ if (!customElements.get('bt-pill')) {
|
|
|
4642
4839
|
customElements.define('bt-pill', BTPill);
|
|
4643
4840
|
}
|
|
4644
4841
|
|
|
4645
|
-
const TwLitElement$
|
|
4842
|
+
const TwLitElement$5 = TW(i);
|
|
4646
4843
|
const buttonVariants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer', {
|
|
4647
4844
|
variants: {
|
|
4648
4845
|
variant: {
|
|
@@ -4665,7 +4862,7 @@ const buttonVariants = cva('inline-flex items-center justify-center gap-2 whites
|
|
|
4665
4862
|
size: 'default',
|
|
4666
4863
|
},
|
|
4667
4864
|
});
|
|
4668
|
-
class BTButton extends TwLitElement$
|
|
4865
|
+
class BTButton extends TwLitElement$5 {
|
|
4669
4866
|
constructor() {
|
|
4670
4867
|
super(...arguments);
|
|
4671
4868
|
this.buttonClass = '';
|
|
@@ -4703,8 +4900,8 @@ if (!customElements.get('bt-button')) {
|
|
|
4703
4900
|
customElements.define('bt-button', BTButton);
|
|
4704
4901
|
}
|
|
4705
4902
|
|
|
4706
|
-
const TwLitElement$
|
|
4707
|
-
class BTHelperText extends TwLitElement$
|
|
4903
|
+
const TwLitElement$4 = TW(i);
|
|
4904
|
+
class BTHelperText extends TwLitElement$4 {
|
|
4708
4905
|
render() {
|
|
4709
4906
|
return b `<div class="text-[0.8rem] text-muted-foreground">
|
|
4710
4907
|
<slot></slot>
|
|
@@ -4715,9 +4912,9 @@ if (!customElements.get('bt-helper-text')) {
|
|
|
4715
4912
|
customElements.define('bt-helper-text', BTHelperText);
|
|
4716
4913
|
}
|
|
4717
4914
|
|
|
4718
|
-
const TwLitElement$
|
|
4915
|
+
const TwLitElement$3 = TW(i);
|
|
4719
4916
|
const inputVariants = cva('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm');
|
|
4720
|
-
class BTInput extends TwLitElement$
|
|
4917
|
+
class BTInput extends TwLitElement$3 {
|
|
4721
4918
|
constructor() {
|
|
4722
4919
|
super(...arguments);
|
|
4723
4920
|
this.inputClass = '';
|
|
@@ -4774,8 +4971,8 @@ if (!customElements.get('bt-input')) {
|
|
|
4774
4971
|
customElements.define('bt-input', BTInput);
|
|
4775
4972
|
}
|
|
4776
4973
|
|
|
4777
|
-
const TwLitElement$
|
|
4778
|
-
class BTLabel extends TwLitElement$
|
|
4974
|
+
const TwLitElement$2 = TW(i);
|
|
4975
|
+
class BTLabel extends TwLitElement$2 {
|
|
4779
4976
|
render() {
|
|
4780
4977
|
return b `<label
|
|
4781
4978
|
class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
@@ -4788,8 +4985,8 @@ if (!customElements.get('bt-label')) {
|
|
|
4788
4985
|
customElements.define('bt-label', BTLabel);
|
|
4789
4986
|
}
|
|
4790
4987
|
|
|
4791
|
-
const TwLitElement = TW(i);
|
|
4792
|
-
class BTCardWrapper extends TwLitElement {
|
|
4988
|
+
const TwLitElement$1 = TW(i);
|
|
4989
|
+
class BTCardWrapper extends TwLitElement$1 {
|
|
4793
4990
|
constructor() {
|
|
4794
4991
|
super(...arguments);
|
|
4795
4992
|
this.cardWrapperClass = '';
|
|
@@ -4810,6 +5007,97 @@ if (!customElements.get('bt-card-wrapper')) {
|
|
|
4810
5007
|
customElements.define('bt-card-wrapper', BTCardWrapper);
|
|
4811
5008
|
}
|
|
4812
5009
|
|
|
5010
|
+
const TwLitElement = TW(i);
|
|
5011
|
+
/**
|
|
5012
|
+
* A toggle switch component that allows users to switch between checked and unchecked states.
|
|
5013
|
+
*
|
|
5014
|
+
* `@fires` change - Emitted when the switch state changes, with detail { checked: boolean }
|
|
5015
|
+
*
|
|
5016
|
+
* `@example`
|
|
5017
|
+
* ```html
|
|
5018
|
+
* <bt-switch checked></bt-switch>
|
|
5019
|
+
* <bt-switch size="sm" disabled></bt-switch>
|
|
5020
|
+
* ```
|
|
5021
|
+
*/
|
|
5022
|
+
class BTSwitch extends TwLitElement {
|
|
5023
|
+
constructor() {
|
|
5024
|
+
super(...arguments);
|
|
5025
|
+
this.checked = false;
|
|
5026
|
+
this.disabled = false;
|
|
5027
|
+
this.size = 'default';
|
|
5028
|
+
this.toggle = () => {
|
|
5029
|
+
if (this.disabled)
|
|
5030
|
+
return;
|
|
5031
|
+
this.checked = !this.checked;
|
|
5032
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
5033
|
+
detail: { checked: this.checked },
|
|
5034
|
+
bubbles: true,
|
|
5035
|
+
composed: true,
|
|
5036
|
+
}));
|
|
5037
|
+
};
|
|
5038
|
+
this.onClick = (e) => {
|
|
5039
|
+
e.preventDefault();
|
|
5040
|
+
this.toggle();
|
|
5041
|
+
};
|
|
5042
|
+
this.onKeyDown = (e) => {
|
|
5043
|
+
if (this.disabled)
|
|
5044
|
+
return;
|
|
5045
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
5046
|
+
e.preventDefault();
|
|
5047
|
+
this.toggle();
|
|
5048
|
+
}
|
|
5049
|
+
};
|
|
5050
|
+
}
|
|
5051
|
+
render() {
|
|
5052
|
+
const state = this.checked ? 'checked' : 'unchecked';
|
|
5053
|
+
return b `
|
|
5054
|
+
<button
|
|
5055
|
+
type="button"
|
|
5056
|
+
data-slot="switch"
|
|
5057
|
+
data-size=${this.size}
|
|
5058
|
+
?disabled=${this.disabled}
|
|
5059
|
+
role="switch"
|
|
5060
|
+
aria-checked=${this.checked ? 'true' : 'false'}
|
|
5061
|
+
data-state=${state}
|
|
5062
|
+
data-disabled=${this.disabled ? 'true' : 'false'}
|
|
5063
|
+
class="data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-[state=unchecked]:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 cursor-pointer"
|
|
5064
|
+
@click=${this.onClick}
|
|
5065
|
+
@keydown=${this.onKeyDown}
|
|
5066
|
+
>
|
|
5067
|
+
<span
|
|
5068
|
+
data-slot="switch-thumb"
|
|
5069
|
+
aria-checked=${this.checked ? 'true' : 'false'}
|
|
5070
|
+
data-state=${state}
|
|
5071
|
+
data-disabled=${this.disabled ? 'true' : 'false'}
|
|
5072
|
+
data-size=${this.size}
|
|
5073
|
+
class="bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-[state=checked]:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-[state=checked]:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-[state=unchecked]:translate-x-0 group-data-[size=sm]/switch:data-[state=unchecked]:translate-x-0 pointer-events-none block ring-0 transition-transform"
|
|
5074
|
+
></span>
|
|
5075
|
+
</button>
|
|
5076
|
+
`;
|
|
5077
|
+
}
|
|
5078
|
+
}
|
|
5079
|
+
__decorate([
|
|
5080
|
+
n$1({ type: Boolean, reflect: true }),
|
|
5081
|
+
__metadata("design:type", Object)
|
|
5082
|
+
], BTSwitch.prototype, "checked", void 0);
|
|
5083
|
+
__decorate([
|
|
5084
|
+
n$1({ type: Boolean, reflect: true }),
|
|
5085
|
+
__metadata("design:type", Object)
|
|
5086
|
+
], BTSwitch.prototype, "disabled", void 0);
|
|
5087
|
+
__decorate([
|
|
5088
|
+
n$1({
|
|
5089
|
+
type: String,
|
|
5090
|
+
reflect: true,
|
|
5091
|
+
converter: {
|
|
5092
|
+
fromAttribute: (value) => value === 'sm' ? 'sm' : 'default',
|
|
5093
|
+
},
|
|
5094
|
+
}),
|
|
5095
|
+
__metadata("design:type", String)
|
|
5096
|
+
], BTSwitch.prototype, "size", void 0);
|
|
5097
|
+
if (!customElements.get('bt-switch')) {
|
|
5098
|
+
customElements.define('bt-switch', BTSwitch);
|
|
5099
|
+
}
|
|
5100
|
+
|
|
4813
5101
|
var _ElementWithStylesheet_sheet;
|
|
4814
5102
|
const TWLitElement = TW(i);
|
|
4815
5103
|
/**
|