@bigbinary/neeto-rules-frontend 2.7.8 → 2.7.10

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.
@@ -107,6 +107,17 @@ var ScrollToErrorField = function ScrollToErrorField(_ref) {
107
107
  return null;
108
108
  };
109
109
 
110
+ var DEFAULT_LONG_TEXT_ROWS = 8;
111
+
112
+ // Atoms puts leading-none on option labels, which suits short options but
113
+ // leaves panel options — full sentences that regularly wrap — with no leading
114
+ // at all on their second line.
115
+ var PANEL_OPTION_LABEL_CLASSES = "[&_label]:leading-normal";
116
+
117
+ // A vertical RadioGroup also defaults to an 8px gap, too tight to scan once the
118
+ // options wrap. Checkbox lists space themselves and only need the label fix.
119
+ var PANEL_RADIO_GROUP_CLASSES = "data-[orientation=vertical]:gap-3 ".concat(PANEL_OPTION_LABEL_CLASSES);
120
+
110
121
  var Body = function Body(_ref) {
111
122
  var children = _ref.children,
112
123
  className = _ref.className;
@@ -437,8 +448,9 @@ var ActionPanel = function ActionPanel() {
437
448
  variant: "h5",
438
449
  children: [label, "..."]
439
450
  }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
451
+ color: "muted",
440
452
  "data-testid": "action-description",
441
- variant: "body1",
453
+ variant: "body3",
442
454
  children: t("neetoRules.form.addActionDescription")
443
455
  })]
444
456
  })
@@ -464,6 +476,7 @@ var ActionPanel = function ActionPanel() {
464
476
  })]
465
477
  }), neetoCist.isNotEmpty(searchedOptions) ? /*#__PURE__*/jsxRuntime.jsx(formik$1.RadioGroup, {
466
478
  ref: ref,
479
+ className: PANEL_RADIO_GROUP_CLASSES,
467
480
  name: "".concat(name, ".name"),
468
481
  orientation: "vertical",
469
482
  value: selectedField === null || selectedField === void 0 ? void 0 : selectedField.value,
@@ -493,8 +506,6 @@ var ActionPanel = function ActionPanel() {
493
506
  });
494
507
  };
495
508
 
496
- var DEFAULT_LONG_TEXT_ROWS = 8;
497
-
498
509
  var Target$k = function Target(_ref) {
499
510
  var _errors$actions, _touched$actions, _selectedField$separa;
500
511
  var index = _ref.index,
@@ -2074,7 +2085,7 @@ var MultiSelectCheckbox$1 = function MultiSelectCheckbox(_ref2) {
2074
2085
  };
2075
2086
  var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || t("neetoRules.labels.selectValues");
2076
2087
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
2077
- className: "space-y-3",
2088
+ className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
2078
2089
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Label, {
2079
2090
  required: required,
2080
2091
  children: defaultLabel
@@ -3136,8 +3147,9 @@ var ActionSubItemPanel = function ActionSubItemPanel() {
3136
3147
  children: header
3137
3148
  })]
3138
3149
  }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
3150
+ color: "muted",
3139
3151
  "data-testid": "action-sub-item-description",
3140
- variant: "body1",
3152
+ variant: "body3",
3141
3153
  children: t("neetoRules.form.addActionSubItemDescription")
3142
3154
  })]
3143
3155
  })
@@ -3520,7 +3532,7 @@ var MultiSelectCheckbox = function MultiSelectCheckbox(_ref2) {
3520
3532
  };
3521
3533
  var defaultLabel = t("neetoRules.labels.selectValues");
3522
3534
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
3523
- className: "space-y-3",
3535
+ className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
3524
3536
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Label, {
3525
3537
  required: required,
3526
3538
  children: defaultLabel
@@ -3777,6 +3789,7 @@ var RadioField = function RadioField(_ref2) {
3777
3789
  }), neetoCist.isNotEmpty(searchedOptions) ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.RadioGroup, _objectSpread$4(_objectSpread$4({
3778
3790
  ref: ref,
3779
3791
  required: required,
3792
+ className: PANEL_RADIO_GROUP_CLASSES,
3780
3793
  label: showLabel && t("neetoRules.labels.selectValue"),
3781
3794
  orientation: "vertical",
3782
3795
  value: selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value,
@@ -4034,8 +4047,9 @@ var FieldPanel = function FieldPanel() {
4034
4047
  variant: "h5",
4035
4048
  children: [index ? logicalOperatorLabel : conditionLabel, "..."]
4036
4049
  }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
4050
+ color: "muted",
4037
4051
  "data-testid": "condition-description",
4038
- variant: "body1",
4052
+ variant: "body3",
4039
4053
  children: t("neetoRules.form.addConditionDescription")
4040
4054
  })]
4041
4055
  })
@@ -4278,8 +4292,9 @@ var VerbAndValuePanel = function VerbAndValuePanel() {
4278
4292
  children: [index ? logicalOperatorLabel : conditionLabel, " ", fieldLabel, "..."]
4279
4293
  })]
4280
4294
  }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
4295
+ color: "muted",
4281
4296
  "data-testid": "condition-verb-and-value-description",
4282
- variant: "body1",
4297
+ variant: "body3",
4283
4298
  children: t("neetoRules.form.addConditionVerbAndValueDescription")
4284
4299
  })]
4285
4300
  })
@@ -4365,7 +4380,8 @@ var DelayPanel = function DelayPanel() {
4365
4380
  variant: "h5",
4366
4381
  children: t("neetoRules.common.addDelay")
4367
4382
  }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
4368
- variant: "body1",
4383
+ color: "muted",
4384
+ variant: "body3",
4369
4385
  children: t("neetoRules.helpText.addDelay")
4370
4386
  })]
4371
4387
  })
@@ -4382,16 +4398,14 @@ var DelayPanel = function DelayPanel() {
4382
4398
  type: "number",
4383
4399
  onFocus: setValueFieldActive
4384
4400
  }), /*#__PURE__*/jsxRuntime.jsx(formik$1.Select, {
4385
- defaultValue: neetoCist.findBy({
4386
- value: value.unit
4387
- }, DELAY_UNIT_OPTIONS),
4388
- innerRef: unitRef,
4401
+ defaultValue: value.unit,
4389
4402
  name: "".concat(name, ".value.unit"),
4390
4403
  options: DELAY_UNIT_OPTIONS,
4391
4404
  placeholder: t("neetoRules.placeholders.selectOption"),
4392
- onChange: function onChange(option) {
4405
+ ref: unitRef,
4406
+ onChange: function onChange(unit) {
4393
4407
  return setValue(_objectSpread$3(_objectSpread$3({}, value), {}, {
4394
- unit: option.value
4408
+ unit: unit
4395
4409
  }));
4396
4410
  },
4397
4411
  onFocus: setUnitFieldActive
@@ -4620,8 +4634,9 @@ var EventsPanel = function EventsPanel() {
4620
4634
  variant: "h5",
4621
4635
  children: [t("neetoRules.common.when"), "..."]
4622
4636
  }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
4637
+ color: "muted",
4623
4638
  "data-testid": "event-description",
4624
- variant: "body1",
4639
+ variant: "body3",
4625
4640
  children: t("neetoRules.form.addEventDescription")
4626
4641
  })]
4627
4642
  })
@@ -4643,8 +4658,9 @@ var EventsPanel = function EventsPanel() {
4643
4658
  }
4644
4659
  })
4645
4660
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
4646
- className: "space-y-3",
4661
+ className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
4647
4662
  children: [neetoCist.isNotEmpty(searchedOptions) ? singleSelect ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.RadioGroup, {
4663
+ className: PANEL_RADIO_GROUP_CLASSES,
4648
4664
  orientation: "vertical",
4649
4665
  value: (eventNames === null || eventNames === void 0 ? void 0 : eventNames[0]) || "",
4650
4666
  onValueChange: handleRadioChange,
@@ -4779,14 +4795,16 @@ var PerformerPanel = function PerformerPanel() {
4779
4795
  children: [t("neetoRules.form.actionTriggeredBy"), "..."]
4780
4796
  })]
4781
4797
  }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
4798
+ color: "muted",
4782
4799
  "data-testid": "performer-description",
4783
- variant: "body1",
4800
+ variant: "body3",
4784
4801
  children: t("neetoRules.form.addPerformerDescription")
4785
4802
  })]
4786
4803
  })
4787
4804
  }), /*#__PURE__*/jsxRuntime.jsx(Panel.Body, {
4788
4805
  children: /*#__PURE__*/jsxRuntime.jsx(formik$1.RadioGroup, {
4789
4806
  ref: ref,
4807
+ className: PANEL_RADIO_GROUP_CLASSES,
4790
4808
  disabled: isMenuDisabled,
4791
4809
  name: "".concat(performerName, ".value"),
4792
4810
  orientation: "vertical",
@@ -5385,4 +5403,4 @@ exports.getSlackChannelErrors = getSlackChannelErrors;
5385
5403
  exports.getValidationSchema = getValidationSchema;
5386
5404
  exports.getVerbOptions = getVerbOptions;
5387
5405
  exports.usePollRuleName = usePollRuleName;
5388
- //# sourceMappingURL=index-BL9TdE9q.js.map
5406
+ //# sourceMappingURL=index-jjFVJckW.js.map