@uniformdev/context-ui 20.35.0 → 20.35.1-alpha.58

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/index.mjs CHANGED
@@ -320,6 +320,7 @@ function CriteriaOperatorMenu({ onChange, value, rhsType, ...props }) {
320
320
  InputComboBox,
321
321
  {
322
322
  ...props,
323
+ isDisabled: props.disabled,
323
324
  value: {
324
325
  label: (_b = (_a = operators.find((e) => e.value === value)) == null ? void 0 : _a.name) != null ? _b : value,
325
326
  value
@@ -695,32 +696,38 @@ var DimensionOption = (props) => {
695
696
  };
696
697
 
697
698
  // src/components/DimensionMenu/DimensionValue.tsx
698
- import { Icon as Icon2 } from "@uniformdev/design-system";
699
+ import { css as css4 } from "@emotion/react";
700
+ import { Icon as Icon2, Tooltip } from "@uniformdev/design-system";
699
701
  import { jsx as jsx11, jsxs as jsxs4 } from "@emotion/react/jsx-runtime";
702
+ var styles = {
703
+ dimensionValueWrapper: css4`
704
+ white-space: normal;
705
+ overflow: hidden;
706
+ `,
707
+ dimensionName: css4`
708
+ color: var(--gray-500);
709
+ display: flex;
710
+ align-items: center;
711
+ gap: var(--spacing-xs);
712
+ `,
713
+ dimensionValue: css4`
714
+ color: var(--gray-700);
715
+ text-overflow: ellipsis;
716
+ overflow: hidden;
717
+ white-space: nowrap;
718
+ `
719
+ };
700
720
  function DimensionValue({ displayName }) {
721
+ var _a;
701
722
  const { type, name } = dimensionDisplayName(displayName);
702
- return /* @__PURE__ */ jsxs4(
703
- "div",
704
- {
705
- css: {
706
- whiteSpace: "normal",
707
- overflow: "hidden"
708
- },
709
- children: [
710
- type ? /* @__PURE__ */ jsxs4(
711
- "small",
712
- {
713
- css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
714
- children: [
715
- type ? /* @__PURE__ */ jsx11(Icon2, { icon: dimensionIcon(type), iconColor: "currentColor", size: 16 }) : null,
716
- /* @__PURE__ */ jsx11("span", { "data-testid": "dimension-name", children: type })
717
- ]
718
- }
719
- ) : null,
720
- /* @__PURE__ */ jsx11("div", { css: { color: "var(--gray-700)" }, "data-testid": "dimension-value", children: name != null ? name : type })
721
- ]
722
- }
723
- );
723
+ const tooltip = (_a = name != null ? name : type) != null ? _a : "";
724
+ return /* @__PURE__ */ jsxs4("div", { css: styles.dimensionValueWrapper, children: [
725
+ type ? /* @__PURE__ */ jsxs4("small", { css: styles.dimensionName, children: [
726
+ type ? /* @__PURE__ */ jsx11(Icon2, { icon: dimensionIcon(type), iconColor: "currentColor", size: 16 }) : null,
727
+ /* @__PURE__ */ jsx11("span", { "data-testid": "dimension-name", children: type })
728
+ ] }) : null,
729
+ /* @__PURE__ */ jsx11(Tooltip, { title: tooltip, children: /* @__PURE__ */ jsx11("div", { css: styles.dimensionValue, "data-testid": "dimension-value", children: name != null ? name : type }) })
730
+ ] });
724
731
  }
725
732
 
726
733
  // src/components/DimensionMenu/DimensionSingleValue.tsx
@@ -760,6 +767,7 @@ function CriteriaMatchMenu({
760
767
  InputComboBox3,
761
768
  {
762
769
  ...props,
770
+ isDisabled: props.disabled,
763
771
  inputValue,
764
772
  menuShouldScrollIntoView: true,
765
773
  value: {
@@ -867,6 +875,7 @@ function DimensionMenu({
867
875
  InputComboBox4,
868
876
  {
869
877
  ...props,
878
+ isDisabled: props.disabled,
870
879
  value: valueAsMenuOption,
871
880
  options: groupedDimensions,
872
881
  getOptionValue: (option) => option.label,
@@ -905,8 +914,8 @@ import { CgChevronRight } from "@react-icons/all-files/cg/CgChevronRight";
905
914
  import { Icon as Icon3 } from "@uniformdev/design-system";
906
915
 
907
916
  // src/components/EditLink/EditLink.styles.ts
908
- import { css as css4 } from "@emotion/react";
909
- var editLink = css4`
917
+ import { css as css5 } from "@emotion/react";
918
+ var editLink = css5`
910
919
  display: flex;
911
920
  align-items: center;
912
921
  font-weight: var(--fw-bold);
@@ -939,7 +948,7 @@ var EditLink = ({ linkTo, name, linkText = `Edit ${name} Component` }) => {
939
948
  };
940
949
 
941
950
  // src/components/EnrichmentTag/EnrichmentTag.tsx
942
- import { css as css5 } from "@emotion/react";
951
+ import { css as css6 } from "@emotion/react";
943
952
  import { CgCloseO } from "@react-icons/all-files/cg/CgCloseO";
944
953
  import { CgMathMinus } from "@react-icons/all-files/cg/CgMathMinus";
945
954
  import { CgMathPlus } from "@react-icons/all-files/cg/CgMathPlus";
@@ -956,7 +965,7 @@ import {
956
965
  import { produce } from "immer";
957
966
  import { useMemo as useMemo2, useState as useState6 } from "react";
958
967
  import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs8 } from "@emotion/react/jsx-runtime";
959
- var addEnrichmentLink = css5`
968
+ var addEnrichmentLink = css6`
960
969
  flex: 2;
961
970
  display: flex;
962
971
  width: 50%;
@@ -1145,7 +1154,7 @@ var NoEnrichmentsView = ({ contextConfig }) => /* @__PURE__ */ jsx16(Callout2, {
1145
1154
  var getCappedValue = (value, maxCap = 100, minCap = 0) => {
1146
1155
  return Math.max(Math.min(value, maxCap), minCap);
1147
1156
  };
1148
- var scoreCounterMinusButtonStyles = css5`
1157
+ var scoreCounterMinusButtonStyles = css6`
1149
1158
  position: absolute;
1150
1159
  bottom: 0.875rem;
1151
1160
  left: var(--spacing-sm);
@@ -1158,7 +1167,7 @@ var scoreCounterMinusButtonStyles = css5`
1158
1167
  border: 1px solid var(--gray-300);
1159
1168
  border-radius: var(--rounded-full);
1160
1169
  `;
1161
- var scoreCounterPlusButtonStyles = css5`
1170
+ var scoreCounterPlusButtonStyles = css6`
1162
1171
  ${scoreCounterMinusButtonStyles}
1163
1172
  left: auto;
1164
1173
  right: var(--spacing-sm);
@@ -1322,7 +1331,7 @@ function opHasRhs(op) {
1322
1331
  }
1323
1332
 
1324
1333
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.tsx
1325
- import { css as css7 } from "@emotion/react";
1334
+ import { css as css8 } from "@emotion/react";
1326
1335
  import { CgCloseO as CgCloseO2 } from "@react-icons/all-files/cg/CgCloseO";
1327
1336
  import {
1328
1337
  AddListButton as AddListButton3,
@@ -1332,19 +1341,20 @@ import {
1332
1341
  Input as Input2,
1333
1342
  InputInlineSelect,
1334
1343
  InputSelect as InputSelect2,
1335
- Paragraph
1344
+ Paragraph,
1345
+ VerticalRhythm
1336
1346
  } from "@uniformdev/design-system";
1337
1347
  import { produce as produce2 } from "immer";
1338
1348
 
1339
1349
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.styles.ts
1340
- import { css as css6 } from "@emotion/react";
1350
+ import { css as css7 } from "@emotion/react";
1341
1351
  var spaceBetweenCriteriaItems = "6rem";
1342
- var criteriaItem = css6`
1352
+ var criteriaItem = css7`
1343
1353
  position: relative;
1344
1354
  padding: var(--spacing-md) var(--spacing-base);
1345
1355
  border: 1px solid var(--gray-300);
1346
- box-shadow: var(--shadow-base);
1347
- background-color: white;
1356
+ box-shadow: var(--elevation-200);
1357
+ background-color: var(--white);
1348
1358
  border-radius: var(--rounded-base);
1349
1359
  margin-top: ${spaceBetweenCriteriaItems};
1350
1360
  display: flex;
@@ -1361,13 +1371,13 @@ var criteriaItem = css6`
1361
1371
  }
1362
1372
 
1363
1373
  &:first-of-type {
1364
- margin-top: var(--spacing-md);
1374
+ margin-top: 0;
1365
1375
  &:before {
1366
1376
  display: none;
1367
1377
  }
1368
1378
  }
1369
1379
  `;
1370
- var criteriaItemInner = css6`
1380
+ var criteriaItemInner = css7`
1371
1381
  display: flex;
1372
1382
  row-gap: var(--spacing-base);
1373
1383
  column-gap: var(--spacing-xs);
@@ -1375,23 +1385,23 @@ var criteriaItemInner = css6`
1375
1385
  flex-wrap: wrap;
1376
1386
  margin-right: var(--spacing-base);
1377
1387
  `;
1378
- var criteriaWrapper = css6`
1388
+ var criteriaWrapper = css7`
1379
1389
  width: 100%;
1380
1390
  display: flex;
1381
1391
  align-items: stretch;
1382
1392
  position: relative;
1383
1393
  `;
1384
- var criteriaOperandWrapper = css6`
1394
+ var criteriaOperandWrapper = css7`
1385
1395
  flex: 2;
1386
1396
  height: 52px;
1387
1397
  min-width: 200px;
1388
1398
  `;
1389
- var criteriaOperatorWrapper = css6`
1399
+ var criteriaOperatorWrapper = css7`
1390
1400
  flex: 1;
1391
1401
  flex-wrap: nowrap;
1392
1402
  min-width: 80px;
1393
1403
  `;
1394
- var expand = css6`
1404
+ var expand = css7`
1395
1405
  height: 100%;
1396
1406
  width: 100%;
1397
1407
  `;
@@ -1409,7 +1419,8 @@ var PersonalizationCriteriaStatic = ({
1409
1419
  onRemoveCriteria,
1410
1420
  displayTitle = true,
1411
1421
  components,
1412
- errors = {}
1422
+ errors = {},
1423
+ readOnly
1413
1424
  }) => {
1414
1425
  var _a;
1415
1426
  const currentValue = { crit: [], ...value };
@@ -1455,195 +1466,204 @@ var PersonalizationCriteriaStatic = ({
1455
1466
  children: /* @__PURE__ */ jsx17(Heading2, { level: 5, withMarginBottom: false, children: "Personalization Variation" })
1456
1467
  }
1457
1468
  ) : null,
1458
- (components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ jsx17(components.CustomVariantName, {}) : null,
1459
- (components == null ? void 0 : components.ControlPercentage) ? /* @__PURE__ */ jsx17(components.ControlPercentage, {}) : null,
1460
- !currentValue.crit.length ? /* @__PURE__ */ jsx17(Callout3, { title: "Default variant", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ jsx17(Paragraph, { children: 'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.' }) }) : /* @__PURE__ */ jsx17("div", { children: currentValue.crit.map((currentCriteria, index) => {
1461
- var _a2, _b, _c, _d, _e, _f, _g, _h;
1462
- const critHasLhs = ((_a2 = currentCriteria.l) == null ? void 0 : _a2.length) > 0;
1463
- const critHasRhs = opHasRhs(currentCriteria.op);
1464
- const selectedValueIsQuirk = "t" in currentCriteria && currentCriteria.t === "q";
1465
- const currentDimension = selectedValueIsQuirk ? void 0 : dimensions.dimIndex[currentCriteria.l];
1466
- const currentQuirk = selectedValueIsQuirk ? quirks == null ? void 0 : quirks.find((q) => q.id === currentCriteria.l) : void 0;
1467
- return /* @__PURE__ */ jsxs9("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
1468
- /* @__PURE__ */ jsxs9("div", { css: criteriaItemInner, className: "criteriaItemInner", children: [
1469
+ /* @__PURE__ */ jsxs9(VerticalRhythm, { children: [
1470
+ (components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ jsx17(components.CustomVariantName, {}) : null,
1471
+ (components == null ? void 0 : components.ControlPercentage) ? /* @__PURE__ */ jsx17(components.ControlPercentage, {}) : null,
1472
+ !currentValue.crit.length ? /* @__PURE__ */ jsx17(Callout3, { title: "Default variant", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ jsx17(Paragraph, { children: 'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.' }) }) : /* @__PURE__ */ jsx17("div", { children: currentValue.crit.map((currentCriteria, index) => {
1473
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
1474
+ const critHasLhs = ((_a2 = currentCriteria.l) == null ? void 0 : _a2.length) > 0;
1475
+ const critHasRhs = opHasRhs(currentCriteria.op);
1476
+ const selectedValueIsQuirk = "t" in currentCriteria && currentCriteria.t === "q";
1477
+ const currentDimension = selectedValueIsQuirk ? void 0 : dimensions.dimIndex[currentCriteria.l];
1478
+ const currentQuirk = selectedValueIsQuirk ? quirks == null ? void 0 : quirks.find((q) => q.id === currentCriteria.l) : void 0;
1479
+ return /* @__PURE__ */ jsxs9("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
1480
+ /* @__PURE__ */ jsxs9("div", { css: criteriaItemInner, className: "criteriaItemInner", children: [
1481
+ /* @__PURE__ */ jsx17(
1482
+ "div",
1483
+ {
1484
+ css: [criteriaWrapper, criteriaOperandWrapper],
1485
+ className: "criteria-wrapper",
1486
+ "data-testid": "select-criteria",
1487
+ children: /* @__PURE__ */ jsx17(
1488
+ DimensionMenu,
1489
+ {
1490
+ errorMessage: (_b = errors.lhs) == null ? void 0 : _b[index],
1491
+ css: expand,
1492
+ styles: { control: (base) => ({ ...base, height: "100%" }) },
1493
+ dimensions: dimensions.dimensions,
1494
+ quirks,
1495
+ onChange: (selection) => {
1496
+ if (!selection) {
1497
+ return;
1498
+ }
1499
+ if ("dim" in selection) {
1500
+ const validOperators = getValidCriteriaOperatorsFor(selection.category);
1501
+ const existingOpRemainsValid = !("t" in currentCriteria && currentCriteria.t === "q") && validOperators.some((op) => op.value === currentCriteria.op);
1502
+ const newCriteria = {
1503
+ ...currentCriteria,
1504
+ l: selection.dim,
1505
+ t: void 0,
1506
+ op: existingOpRemainsValid ? currentCriteria.op : ">",
1507
+ r: existingOpRemainsValid ? currentCriteria.r : 0,
1508
+ rDim: existingOpRemainsValid ? currentCriteria.rDim : void 0
1509
+ };
1510
+ update(newCriteria, index);
1511
+ } else {
1512
+ update({ ...currentCriteria, l: selection.id, t: "q", op: "=", r: "" }, index);
1513
+ }
1514
+ },
1515
+ value: currentDimension != null ? currentDimension : currentQuirk,
1516
+ onMenuOpen,
1517
+ onMenuClose,
1518
+ disabled: readOnly
1519
+ }
1520
+ )
1521
+ }
1522
+ ),
1523
+ /* @__PURE__ */ jsx17(
1524
+ "div",
1525
+ {
1526
+ css: [criteriaWrapper, criteriaOperatorWrapper],
1527
+ className: "criteria-wrapper",
1528
+ "data-testid": "select-operator",
1529
+ children: /* @__PURE__ */ jsx17(
1530
+ CriteriaOperatorMenu,
1531
+ {
1532
+ name: `op-${index}`,
1533
+ css: expand,
1534
+ styles: { control: (base) => ({ ...base, height: "100%" }) },
1535
+ value: currentCriteria.op,
1536
+ rhsType: currentQuirk ? "QUIRK" : currentDimension == null ? void 0 : currentDimension.category,
1537
+ onChange: (op) => {
1538
+ if (op === "+" || op === "-") {
1539
+ update({ ...currentCriteria, op, r: void 0, rDim: void 0 }, index);
1540
+ } else {
1541
+ update({ ...currentCriteria, op }, index);
1542
+ }
1543
+ },
1544
+ onMenuOpen,
1545
+ onMenuClose,
1546
+ disabled: readOnly
1547
+ }
1548
+ )
1549
+ }
1550
+ ),
1551
+ critHasRhs ? /* @__PURE__ */ jsx17(
1552
+ "div",
1553
+ {
1554
+ css: [criteriaWrapper, criteriaOperandWrapper],
1555
+ className: "criteria-wrapper",
1556
+ "data-testid": "select-match-criteria",
1557
+ children: currentQuirk ? /* @__PURE__ */ jsx17(
1558
+ "div",
1559
+ {
1560
+ css: css8`
1561
+ width: 100%;
1562
+ // InputSelect wrapper is unstylable so need a descendant selector
1563
+ // to full-width it
1564
+ & > * {
1565
+ width: 100%;
1566
+ }
1567
+ `,
1568
+ children: currentQuirk.options ? /* @__PURE__ */ jsx17(
1569
+ InputSelect2,
1570
+ {
1571
+ label: "quirk match value",
1572
+ showLabel: false,
1573
+ value: (_c = currentCriteria.r) != null ? _c : "",
1574
+ errorMessage: (_d = errors.rhs) == null ? void 0 : _d[index],
1575
+ onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
1576
+ options: [
1577
+ { label: "Select\u2026", value: "" },
1578
+ ...currentQuirk.options.map((o) => ({ label: o.name, value: o.value }))
1579
+ ],
1580
+ disabled: readOnly
1581
+ }
1582
+ ) : /* @__PURE__ */ jsx17(
1583
+ Input2,
1584
+ {
1585
+ type: "text",
1586
+ label: "quirk match value",
1587
+ showLabel: false,
1588
+ value: (_e = currentCriteria.r) != null ? _e : "",
1589
+ errorMessage: (_f = errors.rhs) == null ? void 0 : _f[index],
1590
+ onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
1591
+ placeholder: "Enter a value",
1592
+ disabled: readOnly
1593
+ }
1594
+ )
1595
+ }
1596
+ ) : /* @__PURE__ */ jsx17(
1597
+ CriteriaMatchMenu,
1598
+ {
1599
+ errorMessage: (_g = errors.rhs) == null ? void 0 : _g[index],
1600
+ css: expand,
1601
+ styles: { control: (base) => ({ ...base, height: "100%" }) },
1602
+ criteriaMatch: currentCriteria,
1603
+ onChange: (match) => {
1604
+ update(match, index);
1605
+ },
1606
+ isDisabled: !critHasLhs,
1607
+ dimensions,
1608
+ onMenuOpen,
1609
+ onMenuClose,
1610
+ disabled: readOnly
1611
+ }
1612
+ )
1613
+ }
1614
+ ) : null
1615
+ ] }),
1469
1616
  /* @__PURE__ */ jsx17(
1470
- "div",
1617
+ "button",
1471
1618
  {
1472
- css: [criteriaWrapper, criteriaOperandWrapper],
1473
- className: "criteria-wrapper",
1474
- "data-testid": "select-criteria",
1475
- children: /* @__PURE__ */ jsx17(
1476
- DimensionMenu,
1477
- {
1478
- errorMessage: (_b = errors.lhs) == null ? void 0 : _b[index],
1479
- css: expand,
1480
- styles: { control: (base) => ({ ...base, height: "100%" }) },
1481
- dimensions: dimensions.dimensions,
1482
- quirks,
1483
- onChange: (selection) => {
1484
- if (!selection) {
1485
- return;
1486
- }
1487
- if ("dim" in selection) {
1488
- const validOperators = getValidCriteriaOperatorsFor(selection.category);
1489
- const existingOpRemainsValid = !("t" in currentCriteria && currentCriteria.t === "q") && validOperators.some((op) => op.value === currentCriteria.op);
1490
- const newCriteria = {
1491
- ...currentCriteria,
1492
- l: selection.dim,
1493
- t: void 0,
1494
- op: existingOpRemainsValid ? currentCriteria.op : ">",
1495
- r: existingOpRemainsValid ? currentCriteria.r : 0,
1496
- rDim: existingOpRemainsValid ? currentCriteria.rDim : void 0
1497
- };
1498
- update(newCriteria, index);
1499
- } else {
1500
- update({ ...currentCriteria, l: selection.id, t: "q", op: "=", r: "" }, index);
1501
- }
1502
- },
1503
- value: currentDimension != null ? currentDimension : currentQuirk,
1504
- onMenuOpen,
1505
- onMenuClose
1506
- }
1507
- )
1619
+ type: "button",
1620
+ onClick: () => removeFromList(index),
1621
+ title: `Delete Personalization`,
1622
+ css: { backgroundColor: "transparent", backgroundImage: "none", borderWidth: 0 },
1623
+ "data-testid": "button-delete",
1624
+ disabled: readOnly,
1625
+ children: /* @__PURE__ */ jsx17(Icon5, { icon: CgCloseO2, iconColor: "red", size: "1.5rem" })
1508
1626
  }
1509
1627
  ),
1510
- /* @__PURE__ */ jsx17(
1628
+ index > 0 ? /* @__PURE__ */ jsx17(
1511
1629
  "div",
1512
1630
  {
1513
- css: [criteriaWrapper, criteriaOperatorWrapper],
1514
- className: "criteria-wrapper",
1515
- "data-testid": "select-operator",
1631
+ className: "criteria-group-operation",
1632
+ css: {
1633
+ position: "absolute",
1634
+ top: "-4rem",
1635
+ transform: "translateX(calc(1.5rem - 50%))"
1636
+ },
1516
1637
  children: /* @__PURE__ */ jsx17(
1517
- CriteriaOperatorMenu,
1518
- {
1519
- name: `op-${index}`,
1520
- css: expand,
1521
- styles: { control: (base) => ({ ...base, height: "100%" }) },
1522
- value: currentCriteria.op,
1523
- rhsType: currentQuirk ? "QUIRK" : currentDimension == null ? void 0 : currentDimension.category,
1524
- onChange: (op) => {
1525
- if (op === "+" || op === "-") {
1526
- update({ ...currentCriteria, op, r: void 0, rDim: void 0 }, index);
1527
- } else {
1528
- update({ ...currentCriteria, op }, index);
1529
- }
1530
- },
1531
- onMenuOpen,
1532
- onMenuClose
1533
- }
1534
- )
1535
- }
1536
- ),
1537
- critHasRhs ? /* @__PURE__ */ jsx17(
1538
- "div",
1539
- {
1540
- css: [criteriaWrapper, criteriaOperandWrapper],
1541
- className: "criteria-wrapper",
1542
- "data-testid": "select-match-criteria",
1543
- children: currentQuirk ? /* @__PURE__ */ jsx17(
1544
- "div",
1545
- {
1546
- css: css7`
1547
- width: 100%;
1548
- // InputSelect wrapper is unstylable so need a descendant selector
1549
- // to full-width it
1550
- & > * {
1551
- width: 100%;
1552
- }
1553
- `,
1554
- children: currentQuirk.options ? /* @__PURE__ */ jsx17(
1555
- InputSelect2,
1556
- {
1557
- label: "quirk match value",
1558
- showLabel: false,
1559
- value: (_c = currentCriteria.r) != null ? _c : "",
1560
- errorMessage: (_d = errors.rhs) == null ? void 0 : _d[index],
1561
- onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
1562
- options: [
1563
- { label: "Select\u2026", value: "" },
1564
- ...currentQuirk.options.map((o) => ({ label: o.name, value: o.value }))
1565
- ]
1566
- }
1567
- ) : /* @__PURE__ */ jsx17(
1568
- Input2,
1569
- {
1570
- type: "text",
1571
- label: "quirk match value",
1572
- showLabel: false,
1573
- value: (_e = currentCriteria.r) != null ? _e : "",
1574
- errorMessage: (_f = errors.rhs) == null ? void 0 : _f[index],
1575
- onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
1576
- placeholder: "Enter a value"
1577
- }
1578
- )
1579
- }
1580
- ) : /* @__PURE__ */ jsx17(
1581
- CriteriaMatchMenu,
1638
+ InputInlineSelect,
1582
1639
  {
1583
- errorMessage: (_g = errors.rhs) == null ? void 0 : _g[index],
1584
- css: expand,
1585
- styles: { control: (base) => ({ ...base, height: "100%" }) },
1586
- criteriaMatch: currentCriteria,
1587
- onChange: (match) => {
1588
- update(match, index);
1589
- },
1590
- isDisabled: !critHasLhs,
1591
- dimensions,
1592
- onMenuOpen,
1593
- onMenuClose
1640
+ "data-testid": "dropdown-button-combine",
1641
+ disabled: index > 1 || readOnly,
1642
+ value: (_h = currentValue.op) != null ? _h : "&",
1643
+ options: [
1644
+ { label: "AND", value: "&" },
1645
+ { label: "OR", value: "|" }
1646
+ ],
1647
+ onChange: (v) => {
1648
+ setOp(v.value);
1649
+ }
1594
1650
  }
1595
1651
  )
1596
1652
  }
1597
1653
  ) : null
1598
- ] }),
1599
- /* @__PURE__ */ jsx17(
1600
- "button",
1601
- {
1602
- type: "button",
1603
- onClick: () => removeFromList(index),
1604
- title: `Delete Personalization`,
1605
- css: { backgroundColor: "transparent", backgroundImage: "none", borderWidth: 0 },
1606
- "data-testid": "button-delete",
1607
- children: /* @__PURE__ */ jsx17(Icon5, { icon: CgCloseO2, iconColor: "red", size: "1.5rem" })
1608
- }
1609
- ),
1610
- index > 0 ? /* @__PURE__ */ jsx17(
1611
- "div",
1612
- {
1613
- className: "criteria-group-operation",
1614
- css: {
1615
- position: "absolute",
1616
- top: "-4rem",
1617
- transform: "translateX(calc(1.5rem - 50%))"
1618
- },
1619
- children: /* @__PURE__ */ jsx17(
1620
- InputInlineSelect,
1621
- {
1622
- "data-testid": "dropdown-button-combine",
1623
- disabled: index > 1,
1624
- value: (_h = currentValue.op) != null ? _h : "&",
1625
- options: [
1626
- { label: "AND", value: "&" },
1627
- { label: "OR", value: "|" }
1628
- ],
1629
- onChange: (v) => {
1630
- setOp(v.value);
1631
- }
1632
- }
1633
- )
1634
- }
1635
- ) : null
1636
- ] }, index);
1637
- }) }),
1638
- dimensions.dimensions.length === 0 && !(quirks == null ? void 0 : quirks.length) ? (components == null ? void 0 : components.NoDimensionsDefined) ? /* @__PURE__ */ jsx17(components.NoDimensionsDefined, {}) : /* @__PURE__ */ jsx17(Callout3, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ jsx17("p", { children: "You do not have any dimensions configured." }) }) : /* @__PURE__ */ jsx17(
1639
- AddListButton3,
1640
- {
1641
- "data-testid": "button-add-criteria",
1642
- className: "add-more",
1643
- buttonText: "Add Criteria",
1644
- onButtonClick: addToList
1645
- }
1646
- )
1654
+ ] }, index);
1655
+ }) }),
1656
+ dimensions.dimensions.length === 0 && !(quirks == null ? void 0 : quirks.length) ? (components == null ? void 0 : components.NoDimensionsDefined) ? /* @__PURE__ */ jsx17(components.NoDimensionsDefined, {}) : /* @__PURE__ */ jsx17(Callout3, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ jsx17("p", { children: "You do not have any dimensions configured." }) }) : /* @__PURE__ */ jsx17(
1657
+ AddListButton3,
1658
+ {
1659
+ "data-testid": "button-add-criteria",
1660
+ className: "add-more",
1661
+ buttonText: "Add Criteria",
1662
+ onButtonClick: addToList,
1663
+ disabled: readOnly
1664
+ }
1665
+ )
1666
+ ] })
1647
1667
  ] });
1648
1668
  };
1649
1669
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context-ui",
3
- "version": "20.35.0",
3
+ "version": "20.35.1-alpha.58+f229d40de4",
4
4
  "description": "React-based functionality and components for Uniform Context",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -29,8 +29,8 @@
29
29
  "dependencies": {
30
30
  "@emotion/react": "11.13.5",
31
31
  "@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.5.0/react-icons-all-files-5.5.0.tgz",
32
- "@uniformdev/context": "20.35.0",
33
- "@uniformdev/design-system": "20.35.0",
32
+ "@uniformdev/context": "20.35.1-alpha.58+f229d40de4",
33
+ "@uniformdev/design-system": "20.35.1-alpha.58+f229d40de4",
34
34
  "immer": "10.1.1",
35
35
  "react-beautiful-dnd": "13.1.1",
36
36
  "react-select": "5.10.0",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "f228361828ef49a596ca3841e5b79768c64418cf"
67
+ "gitHead": "f229d40de49a1a7e2bba9d2e0a36d4aae6251c81"
68
68
  }