@accelint/design-system 1.1.6 → 1.1.7
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/components/button/button.css.d.ts +24 -24
- package/dist/components/checkbox/checkbox.css.d.ts +23 -23
- package/dist/components/chip/chip.css.d.ts +18 -18
- package/dist/components/combo-box/combo-box.css.d.ts +9 -9
- package/dist/components/date-field/date-field.css.d.ts +17 -17
- package/dist/components/date-input/date-input.css.d.ts +25 -25
- package/dist/components/dialog/dialog.css.d.ts +15 -15
- package/dist/components/drawer/drawer.css.d.ts +16 -16
- package/dist/components/group/group.css.d.ts +7 -7
- package/dist/components/icon/icon.css.d.ts +9 -9
- package/dist/components/input/input.css.d.ts +20 -20
- package/dist/components/menu/menu.css.d.ts +42 -42
- package/dist/components/number-field/number-field.css.d.ts +11 -11
- package/dist/components/options/options.css.d.ts +44 -44
- package/dist/components/picker/picker.css.d.ts +18 -18
- package/dist/components/popover/popover.css.d.ts +12 -12
- package/dist/components/query-builder/query-builder.css.d.ts +53 -53
- package/dist/components/radio/radio.css.d.ts +22 -22
- package/dist/components/search-field/search-field.css.d.ts +9 -9
- package/dist/components/select/select.css.d.ts +12 -12
- package/dist/components/slider/slider.css.d.ts +27 -27
- package/dist/components/switch/switch.css.d.ts +16 -16
- package/dist/components/tabs/tabs.css.d.ts +25 -25
- package/dist/components/text-field/text-field.css.d.ts +8 -8
- package/dist/components/textarea/textarea.css.d.ts +22 -22
- package/dist/components/time-field/time-field.css.d.ts +17 -17
- package/dist/components/tooltip/tooltip.css.d.ts +11 -11
- package/dist/components/tree/tree.css.d.ts +45 -45
- package/dist/styles/theme.css.d.ts +200 -200
- package/dist/test/setup.js +143 -22
- package/dist/test/setup.js.map +1 -1
- package/dist/utils/css/index.d.ts +1 -1
- package/package.json +14 -14
package/dist/test/setup.js
CHANGED
|
@@ -3,8 +3,7 @@ import redent from 'redent.js';
|
|
|
3
3
|
import { parse } from '@adobe/css-tools.js';
|
|
4
4
|
import { computeAccessibleDescription, computeAccessibleName } from 'dom-accessibility-api.js';
|
|
5
5
|
import { roles, elementRoles, roleElements } from 'aria-query.js';
|
|
6
|
-
import
|
|
7
|
-
import isEqualWith from 'lodash/isEqualWith.js';
|
|
6
|
+
import pico from 'picocolors.js';
|
|
8
7
|
import escape from 'css.escape.js';
|
|
9
8
|
import * as React from 'react';
|
|
10
9
|
import * as DeprecatedReactTestUtils from 'react-dom/test-utils';
|
|
@@ -25,9 +24,11 @@ import '@vitest/utils/source-map.js';
|
|
|
25
24
|
import 'expect-type.js';
|
|
26
25
|
import 'pathe.js';
|
|
27
26
|
|
|
28
|
-
// ../node_modules/.pnpm/@testing-library+jest-dom@6.
|
|
27
|
+
// ../node_modules/.pnpm/@testing-library+jest-dom@6.9.1/node_modules/@testing-library/jest-dom/dist/matchers.mjs
|
|
29
28
|
var matchers_exports = {};
|
|
30
29
|
__export(matchers_exports, {
|
|
30
|
+
toAppearAfter: () => toAppearAfter,
|
|
31
|
+
toAppearBefore: () => toAppearBefore,
|
|
31
32
|
toBeChecked: () => toBeChecked,
|
|
32
33
|
toBeDisabled: () => toBeDisabled,
|
|
33
34
|
toBeEmpty: () => toBeEmpty,
|
|
@@ -37,6 +38,8 @@ __export(matchers_exports, {
|
|
|
37
38
|
toBeInTheDocument: () => toBeInTheDocument,
|
|
38
39
|
toBeInvalid: () => toBeInvalid,
|
|
39
40
|
toBePartiallyChecked: () => toBePartiallyChecked,
|
|
41
|
+
toBePartiallyPressed: () => toBePartiallyPressed,
|
|
42
|
+
toBePressed: () => toBePressed,
|
|
40
43
|
toBeRequired: () => toBeRequired,
|
|
41
44
|
toBeValid: () => toBeValid,
|
|
42
45
|
toBeVisible: () => toBeVisible,
|
|
@@ -235,11 +238,11 @@ function toSentence(array2, { wordConnector = ", ", lastWordConnector = " and "
|
|
|
235
238
|
array2.length > 1 ? lastWordConnector : ""
|
|
236
239
|
);
|
|
237
240
|
}
|
|
238
|
-
function
|
|
239
|
-
if (Array.isArray(
|
|
240
|
-
return [...new Set(
|
|
241
|
+
function compareAsSet(val1, val2) {
|
|
242
|
+
if (Array.isArray(val1) && Array.isArray(val2)) {
|
|
243
|
+
return [...new Set(val1)].every((v) => new Set(val2).has(v));
|
|
241
244
|
}
|
|
242
|
-
return
|
|
245
|
+
return val1 === val2;
|
|
243
246
|
}
|
|
244
247
|
function toBeInTheDOM(element, container) {
|
|
245
248
|
deprecate(
|
|
@@ -783,7 +786,7 @@ function expectedDiff(diffFn, expected, computedStyles) {
|
|
|
783
786
|
{}
|
|
784
787
|
);
|
|
785
788
|
const diffOutput = diffFn(printoutStyles(expected), printoutStyles(received));
|
|
786
|
-
return diffOutput.replace(`${
|
|
789
|
+
return diffOutput.replace(`${pico.red("+ Received")}
|
|
787
790
|
`, "");
|
|
788
791
|
}
|
|
789
792
|
function toHaveStyle(htmlElement, css) {
|
|
@@ -881,7 +884,7 @@ function toHaveFormValues(formElement, expectedValues) {
|
|
|
881
884
|
const formValues = getAllFormValues(formElement);
|
|
882
885
|
return {
|
|
883
886
|
pass: Object.entries(expectedValues).every(
|
|
884
|
-
([name, expectedValue]) =>
|
|
887
|
+
([name, expectedValue]) => compareAsSet(formValues[name], expectedValue)
|
|
885
888
|
),
|
|
886
889
|
message: () => {
|
|
887
890
|
const to = this.isNot ? "not to" : "to";
|
|
@@ -1127,7 +1130,7 @@ function toHaveValue(htmlElement, expectedValue) {
|
|
|
1127
1130
|
receivedTypedValue = `${receivedValue} (${typeof receivedValue})`;
|
|
1128
1131
|
}
|
|
1129
1132
|
return {
|
|
1130
|
-
pass: expectsValue ?
|
|
1133
|
+
pass: expectsValue ? compareAsSet(receivedValue, expectedValue) : Boolean(receivedValue),
|
|
1131
1134
|
message: () => {
|
|
1132
1135
|
const to = this.isNot ? "not to" : "to";
|
|
1133
1136
|
const matcher = this.utils.matcherHint(
|
|
@@ -1408,7 +1411,7 @@ function toHaveSelection(htmlElement, expectedSelection) {
|
|
|
1408
1411
|
}
|
|
1409
1412
|
const receivedSelection = getSelection(htmlElement);
|
|
1410
1413
|
return {
|
|
1411
|
-
pass: expectsSelection ?
|
|
1414
|
+
pass: expectsSelection ? compareAsSet(receivedSelection, expectedSelection) : Boolean(receivedSelection),
|
|
1412
1415
|
message: () => {
|
|
1413
1416
|
const to = this.isNot ? "not to" : "to";
|
|
1414
1417
|
const matcher = this.utils.matcherHint(
|
|
@@ -1427,6 +1430,125 @@ function toHaveSelection(htmlElement, expectedSelection) {
|
|
|
1427
1430
|
}
|
|
1428
1431
|
};
|
|
1429
1432
|
}
|
|
1433
|
+
function toBePressed(element) {
|
|
1434
|
+
checkHtmlElement(element, toBePressed, this);
|
|
1435
|
+
const roles3 = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());
|
|
1436
|
+
const isButton = element.tagName.toLowerCase() === "button" || element.tagName.toLowerCase() === "input" && element.type === "button" || roles3.includes("button");
|
|
1437
|
+
const pressedAttribute = element.getAttribute("aria-pressed");
|
|
1438
|
+
const isValidAriaElement = pressedAttribute === "true" || pressedAttribute === "false";
|
|
1439
|
+
if (!isButton || !isValidAriaElement) {
|
|
1440
|
+
return {
|
|
1441
|
+
pass: false,
|
|
1442
|
+
message: () => `Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePressed()`
|
|
1443
|
+
};
|
|
1444
|
+
}
|
|
1445
|
+
const isPressed = pressedAttribute === "true";
|
|
1446
|
+
return {
|
|
1447
|
+
pass: isButton && isPressed,
|
|
1448
|
+
message: () => {
|
|
1449
|
+
const matcher = this.utils.matcherHint(
|
|
1450
|
+
`${this.isNot ? ".not" : ""}.toBePressed`,
|
|
1451
|
+
"element",
|
|
1452
|
+
""
|
|
1453
|
+
);
|
|
1454
|
+
return getMessage(
|
|
1455
|
+
this,
|
|
1456
|
+
matcher,
|
|
1457
|
+
`Expected element to have`,
|
|
1458
|
+
`aria-pressed="${this.isNot ? "false" : "true"}"`,
|
|
1459
|
+
`Received`,
|
|
1460
|
+
`aria-pressed="${pressedAttribute}"`
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
function toBePartiallyPressed(element) {
|
|
1466
|
+
checkHtmlElement(element, toBePartiallyPressed, this);
|
|
1467
|
+
const roles3 = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());
|
|
1468
|
+
const isButton = element.tagName.toLowerCase() === "button" || element.tagName.toLowerCase() === "input" && element.type === "button" || roles3.includes("button");
|
|
1469
|
+
const pressedAttribute = element.getAttribute("aria-pressed");
|
|
1470
|
+
const isValidAriaElement = pressedAttribute === "true" || pressedAttribute === "false" || pressedAttribute === "mixed";
|
|
1471
|
+
if (!isButton || !isValidAriaElement) {
|
|
1472
|
+
return {
|
|
1473
|
+
pass: false,
|
|
1474
|
+
message: () => `Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePartiallyPressed()`
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
const isPartiallyPressed = pressedAttribute === "mixed";
|
|
1478
|
+
return {
|
|
1479
|
+
pass: isButton && isPartiallyPressed,
|
|
1480
|
+
message: () => {
|
|
1481
|
+
const to = this.isNot ? "not to" : "to";
|
|
1482
|
+
const matcher = this.utils.matcherHint(
|
|
1483
|
+
`${this.isNot ? ".not" : ""}.toBePartiallyPressed`,
|
|
1484
|
+
"element",
|
|
1485
|
+
""
|
|
1486
|
+
);
|
|
1487
|
+
return getMessage(
|
|
1488
|
+
this,
|
|
1489
|
+
matcher,
|
|
1490
|
+
`Expected element ${to} have`,
|
|
1491
|
+
`aria-pressed="mixed"`,
|
|
1492
|
+
`Received`,
|
|
1493
|
+
`aria-pressed="${pressedAttribute}"`
|
|
1494
|
+
);
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
var DOCUMENT_POSITION_DISCONNECTED = 1;
|
|
1499
|
+
var DOCUMENT_POSITION_PRECEDING = 2;
|
|
1500
|
+
var DOCUMENT_POSITION_FOLLOWING = 4;
|
|
1501
|
+
var DOCUMENT_POSITION_CONTAINS = 8;
|
|
1502
|
+
var DOCUMENT_POSITION_CONTAINED_BY = 16;
|
|
1503
|
+
var DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
|
|
1504
|
+
var DOCUMENT_POSITIONS_STRINGS = {
|
|
1505
|
+
[DOCUMENT_POSITION_DISCONNECTED]: "Node.DOCUMENT_POSITION_DISCONNECTED",
|
|
1506
|
+
[DOCUMENT_POSITION_PRECEDING]: "Node.DOCUMENT_POSITION_PRECEDING",
|
|
1507
|
+
[DOCUMENT_POSITION_FOLLOWING]: "Node.DOCUMENT_POSITION_FOLLOWING",
|
|
1508
|
+
[DOCUMENT_POSITION_CONTAINS]: "Node.DOCUMENT_POSITION_CONTAINS",
|
|
1509
|
+
[DOCUMENT_POSITION_CONTAINED_BY]: "Node.DOCUMENT_POSITION_CONTAINED_BY",
|
|
1510
|
+
[DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC]: "Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC"
|
|
1511
|
+
};
|
|
1512
|
+
function makeDocumentPositionErrorString(documentPosition) {
|
|
1513
|
+
if (documentPosition in DOCUMENT_POSITIONS_STRINGS) {
|
|
1514
|
+
return `${DOCUMENT_POSITIONS_STRINGS[documentPosition]} (${documentPosition})`;
|
|
1515
|
+
}
|
|
1516
|
+
return `Unknown document position (${documentPosition})`;
|
|
1517
|
+
}
|
|
1518
|
+
function checkToAppear(methodName, targetDocumentPosition) {
|
|
1519
|
+
return function(element, secondElement) {
|
|
1520
|
+
checkHtmlElement(element, toAppearBefore, this);
|
|
1521
|
+
checkHtmlElement(secondElement, toAppearBefore, this);
|
|
1522
|
+
const documentPosition = element.compareDocumentPosition(secondElement);
|
|
1523
|
+
const pass = documentPosition === targetDocumentPosition;
|
|
1524
|
+
return {
|
|
1525
|
+
pass,
|
|
1526
|
+
message: () => {
|
|
1527
|
+
return [
|
|
1528
|
+
this.utils.matcherHint(
|
|
1529
|
+
`${this.isNot ? ".not" : ""}.${methodName}`,
|
|
1530
|
+
"element",
|
|
1531
|
+
"secondElement"
|
|
1532
|
+
),
|
|
1533
|
+
"",
|
|
1534
|
+
`Received: ${makeDocumentPositionErrorString(documentPosition)}`
|
|
1535
|
+
].join("\n");
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
function toAppearBefore(element, secondElement) {
|
|
1541
|
+
return checkToAppear("toAppearBefore", DOCUMENT_POSITION_FOLLOWING).apply(
|
|
1542
|
+
this,
|
|
1543
|
+
[element, secondElement]
|
|
1544
|
+
);
|
|
1545
|
+
}
|
|
1546
|
+
function toAppearAfter(element, secondElement) {
|
|
1547
|
+
return checkToAppear("toAppearAfter", DOCUMENT_POSITION_PRECEDING).apply(
|
|
1548
|
+
this,
|
|
1549
|
+
[element, secondElement]
|
|
1550
|
+
);
|
|
1551
|
+
}
|
|
1430
1552
|
function escapeHTML(str) {
|
|
1431
1553
|
return str.replace(/</g, "<").replace(/>/g, ">");
|
|
1432
1554
|
}
|
|
@@ -1520,14 +1642,14 @@ function createDOMElementFilter(filterNode) {
|
|
|
1520
1642
|
}
|
|
1521
1643
|
};
|
|
1522
1644
|
}
|
|
1523
|
-
var
|
|
1645
|
+
var picocolors = null;
|
|
1524
1646
|
var readFileSync = null;
|
|
1525
1647
|
var codeFrameColumns = null;
|
|
1526
1648
|
try {
|
|
1527
1649
|
const nodeRequire = module && module.require;
|
|
1528
1650
|
readFileSync = nodeRequire.call(module, "fs").readFileSync;
|
|
1529
1651
|
codeFrameColumns = nodeRequire.call(module, "@babel/code-frame").codeFrameColumns;
|
|
1530
|
-
|
|
1652
|
+
picocolors = nodeRequire.call(module, "picocolors");
|
|
1531
1653
|
} catch {
|
|
1532
1654
|
}
|
|
1533
1655
|
function getCodeFrame(frame) {
|
|
@@ -1551,7 +1673,7 @@ function getCodeFrame(frame) {
|
|
|
1551
1673
|
highlightCode: true,
|
|
1552
1674
|
linesBelow: 0
|
|
1553
1675
|
});
|
|
1554
|
-
return
|
|
1676
|
+
return picocolors.dim(frameLocation) + "\n" + codeFrame + "\n";
|
|
1555
1677
|
}
|
|
1556
1678
|
function getUserCodeFrame() {
|
|
1557
1679
|
if (!readFileSync || !codeFrameColumns) {
|
|
@@ -2779,8 +2901,8 @@ var queryAllByRole = function(container, role, _temp) {
|
|
|
2779
2901
|
}
|
|
2780
2902
|
}
|
|
2781
2903
|
if (expanded !== void 0) {
|
|
2782
|
-
var _allRoles$
|
|
2783
|
-
if (((_allRoles$
|
|
2904
|
+
var _allRoles$get0;
|
|
2905
|
+
if (((_allRoles$get0 = roles.get(role)) == null ? void 0 : _allRoles$get0.props["aria-expanded"]) === void 0) {
|
|
2784
2906
|
throw new Error('"aria-expanded" is not supported on role "' + role + '".');
|
|
2785
2907
|
}
|
|
2786
2908
|
}
|
|
@@ -3879,7 +4001,7 @@ typeof document !== "undefined" && document.body ? getQueriesForElement(document
|
|
|
3879
4001
|
return helpers;
|
|
3880
4002
|
}, initialValue);
|
|
3881
4003
|
|
|
3882
|
-
// ../node_modules/.pnpm/@testing-library+react@16.3.
|
|
4004
|
+
// ../node_modules/.pnpm/@testing-library+react@16.3.1_@testing-library+dom@10.4.1_@types+react-dom@19.0.0_@type_e58d195d2fe7d9a4e3d711d7fbfc8046/node_modules/@testing-library/react/dist/@testing-library/react.esm.js
|
|
3883
4005
|
var reactAct = typeof React.act === "function" ? React.act : DeprecatedReactTestUtils.act;
|
|
3884
4006
|
function getGlobalThis() {
|
|
3885
4007
|
if (typeof globalThis !== "undefined") {
|
|
@@ -3988,11 +4110,10 @@ configure({
|
|
|
3988
4110
|
var mountedContainers = /* @__PURE__ */ new Set();
|
|
3989
4111
|
var mountedRootEntries = [];
|
|
3990
4112
|
function cleanup() {
|
|
3991
|
-
mountedRootEntries.forEach((
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
} = _ref3;
|
|
4113
|
+
mountedRootEntries.forEach(({
|
|
4114
|
+
root,
|
|
4115
|
+
container
|
|
4116
|
+
}) => {
|
|
3996
4117
|
act3(() => {
|
|
3997
4118
|
root.unmount();
|
|
3998
4119
|
});
|