@bitforgehq/ui 0.5.0-next.3 → 0.5.0-next.4
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/CHANGELOG.md +47 -0
- package/README.md +3 -3
- package/ai/MANIFEST.index.json +9 -0
- package/ai/MANIFEST.json +265 -5
- package/ai/REFERENCE.index.json +28 -0
- package/ai/REFERENCE.json +172 -3
- package/ai/UI_GUIDE.md +14 -5
- package/ai/components/badge.md +41 -1
- package/ai/components/image-tile.md +452 -0
- package/ai/components/menu-button.md +65 -9
- package/ai/components/pagination.md +59 -11
- package/ai/reference/bf-image-tile-aspect.md +28 -0
- package/ai/reference/bf-image-tile-caption-placement.md +27 -0
- package/ai/reference/bf-image-tile-harness.md +70 -0
- package/ai/reference/bf-labels.md +3 -1
- package/ai/reference/bf-pagination-position-label.md +22 -0
- package/ai/reference/provide-bf-labels.md +2 -1
- package/fesm2022/bitforgehq-ui-overlay.mjs +26 -3
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +59 -1
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +576 -55
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +779 -9
- package/llms.txt +5 -0
- package/package.json +1 -1
- package/types/bitforgehq-ui-overlay.d.ts +11 -0
- package/types/bitforgehq-ui-testing.d.ts +83 -0
- package/types/bitforgehq-ui.d.ts +239 -12
|
@@ -1307,6 +1307,64 @@ var BfMediaCardHarness = class BfMediaCardHarness extends ComponentHarness {
|
|
|
1307
1307
|
return image;
|
|
1308
1308
|
}
|
|
1309
1309
|
};
|
|
1310
|
+
var BfImageTileHarness = class BfImageTileHarness extends ComponentHarness {
|
|
1311
|
+
static hostSelector = "bf-image-tile";
|
|
1312
|
+
tile = this.locatorFor("bf-image-tile > div");
|
|
1313
|
+
media = this.locatorFor("[data-media]");
|
|
1314
|
+
image = this.locatorForOptional("[data-media] img");
|
|
1315
|
+
title = this.locatorFor("[data-title]");
|
|
1316
|
+
meta = this.locatorFor("[data-meta]");
|
|
1317
|
+
placeholder = this.locatorForOptional("[data-placeholder]");
|
|
1318
|
+
failed = this.locatorForOptional("[data-failed]");
|
|
1319
|
+
action = this.locatorForOptional("[data-title] [data-bf-action]");
|
|
1320
|
+
static with(filters = {}) {
|
|
1321
|
+
return new HarnessPredicate(BfImageTileHarness, filters).addOption("label", filters.label, async (harness, label) => HarnessPredicate.stringMatches(harness.getTitle(), label));
|
|
1322
|
+
}
|
|
1323
|
+
async getTitle() {
|
|
1324
|
+
return (await (await this.title()).text()).trim();
|
|
1325
|
+
}
|
|
1326
|
+
async getMeta() {
|
|
1327
|
+
return (await (await this.meta()).text()).trim();
|
|
1328
|
+
}
|
|
1329
|
+
async getState() {
|
|
1330
|
+
const state = await (await this.media()).getAttribute("data-state");
|
|
1331
|
+
return state === "loading" || state === "loaded" || state === "failed" ? state : "empty";
|
|
1332
|
+
}
|
|
1333
|
+
async getSrc() {
|
|
1334
|
+
return await (await this.image())?.getAttribute("src") ?? "";
|
|
1335
|
+
}
|
|
1336
|
+
async getAlt() {
|
|
1337
|
+
return await (await this.image())?.getAttribute("alt") ?? "";
|
|
1338
|
+
}
|
|
1339
|
+
async getPlaceholderText() {
|
|
1340
|
+
return (await (await this.placeholder())?.text())?.trim() ?? "";
|
|
1341
|
+
}
|
|
1342
|
+
async getFailedMessage() {
|
|
1343
|
+
return (await (await this.failed())?.text())?.trim() ?? "";
|
|
1344
|
+
}
|
|
1345
|
+
async isSelected() {
|
|
1346
|
+
return await (await this.tile()).getAttribute("data-selected") !== null;
|
|
1347
|
+
}
|
|
1348
|
+
async isClickable() {
|
|
1349
|
+
return await this.action() !== null;
|
|
1350
|
+
}
|
|
1351
|
+
async click() {
|
|
1352
|
+
const action = await this.action();
|
|
1353
|
+
if (!action) throw new Error("BfImageTileHarness: the tile has no bfAction link or button");
|
|
1354
|
+
await action.click();
|
|
1355
|
+
}
|
|
1356
|
+
async loadImage() {
|
|
1357
|
+
await (await this.requireImage()).dispatchEvent("load");
|
|
1358
|
+
}
|
|
1359
|
+
async failImage() {
|
|
1360
|
+
await (await this.requireImage()).dispatchEvent("error");
|
|
1361
|
+
}
|
|
1362
|
+
async requireImage() {
|
|
1363
|
+
const image = await this.image();
|
|
1364
|
+
if (!image) throw new Error("BfImageTileHarness: the tile shows no picture (no src, or it failed)");
|
|
1365
|
+
return image;
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1310
1368
|
var BfImageViewerHarness = class BfImageViewerHarness extends ComponentHarness {
|
|
1311
1369
|
static hostSelector = "bf-image-viewer";
|
|
1312
1370
|
image = this.locatorForOptional("img[data-image]");
|
|
@@ -1429,6 +1487,6 @@ var BfChatComposerHarness = class BfChatComposerHarness extends ComponentHarness
|
|
|
1429
1487
|
return (await (await this.button()).text()).trim();
|
|
1430
1488
|
}
|
|
1431
1489
|
};
|
|
1432
|
-
export { BfCalendarHarness, BfChartHarness, BfChatComposerHarness, BfComboboxHarness, BfDateInputHarness, BfDateTimeInputHarness, BfDesktopToastHarness, BfDialogHarness, BfFileInputHarness, BfImageInputHarness, BfImageViewerHarness, BfMediaCardHarness, BfMenuButtonHarness, BfMenuHarness, BfMenuItemHarness, BfPaginationHarness, BfPopoverHarness, BfRadioGroupHarness, BfSegmentedHarness, BfSelectHarness, BfSidePanelHarness, BfSidebarToggleHarness, BfTabGroupHarness, BfTableHarness, BfTimeInputHarness, BfToggleHarness, BfTooltipHarness, installBfJsdomShims, provideBfTesting };
|
|
1490
|
+
export { BfCalendarHarness, BfChartHarness, BfChatComposerHarness, BfComboboxHarness, BfDateInputHarness, BfDateTimeInputHarness, BfDesktopToastHarness, BfDialogHarness, BfFileInputHarness, BfImageInputHarness, BfImageTileHarness, BfImageViewerHarness, BfMediaCardHarness, BfMenuButtonHarness, BfMenuHarness, BfMenuItemHarness, BfPaginationHarness, BfPopoverHarness, BfRadioGroupHarness, BfSegmentedHarness, BfSelectHarness, BfSidePanelHarness, BfSidebarToggleHarness, BfTabGroupHarness, BfTableHarness, BfTimeInputHarness, BfToggleHarness, BfTooltipHarness, installBfJsdomShims, provideBfTesting };
|
|
1433
1491
|
|
|
1434
1492
|
//# sourceMappingURL=bitforgehq-ui-testing.mjs.map
|