@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.
@@ -86,6 +86,17 @@ var ScrollToErrorField = function ScrollToErrorField(_ref) {
86
86
  return null;
87
87
  };
88
88
 
89
+ var DEFAULT_LONG_TEXT_ROWS = 8;
90
+
91
+ // Atoms puts leading-none on option labels, which suits short options but
92
+ // leaves panel options — full sentences that regularly wrap — with no leading
93
+ // at all on their second line.
94
+ var PANEL_OPTION_LABEL_CLASSES = "[&_label]:leading-normal";
95
+
96
+ // A vertical RadioGroup also defaults to an 8px gap, too tight to scan once the
97
+ // options wrap. Checkbox lists space themselves and only need the label fix.
98
+ var PANEL_RADIO_GROUP_CLASSES = "data-[orientation=vertical]:gap-3 ".concat(PANEL_OPTION_LABEL_CLASSES);
99
+
89
100
  var Body = function Body(_ref) {
90
101
  var children = _ref.children,
91
102
  className = _ref.className;
@@ -416,8 +427,9 @@ var ActionPanel = function ActionPanel() {
416
427
  variant: "h5",
417
428
  children: [label, "..."]
418
429
  }), /*#__PURE__*/jsx(Typography, {
430
+ color: "muted",
419
431
  "data-testid": "action-description",
420
- variant: "body1",
432
+ variant: "body3",
421
433
  children: t("neetoRules.form.addActionDescription")
422
434
  })]
423
435
  })
@@ -443,6 +455,7 @@ var ActionPanel = function ActionPanel() {
443
455
  })]
444
456
  }), isNotEmpty(searchedOptions) ? /*#__PURE__*/jsx(RadioGroup, {
445
457
  ref: ref,
458
+ className: PANEL_RADIO_GROUP_CLASSES,
446
459
  name: "".concat(name, ".name"),
447
460
  orientation: "vertical",
448
461
  value: selectedField === null || selectedField === void 0 ? void 0 : selectedField.value,
@@ -472,8 +485,6 @@ var ActionPanel = function ActionPanel() {
472
485
  });
473
486
  };
474
487
 
475
- var DEFAULT_LONG_TEXT_ROWS = 8;
476
-
477
488
  var Target$k = function Target(_ref) {
478
489
  var _errors$actions, _touched$actions, _selectedField$separa;
479
490
  var index = _ref.index,
@@ -2053,7 +2064,7 @@ var MultiSelectCheckbox$1 = function MultiSelectCheckbox(_ref2) {
2053
2064
  };
2054
2065
  var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || t("neetoRules.labels.selectValues");
2055
2066
  return /*#__PURE__*/jsxs("div", {
2056
- className: "space-y-3",
2067
+ className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
2057
2068
  children: [/*#__PURE__*/jsx(Label, {
2058
2069
  required: required,
2059
2070
  children: defaultLabel
@@ -3115,8 +3126,9 @@ var ActionSubItemPanel = function ActionSubItemPanel() {
3115
3126
  children: header
3116
3127
  })]
3117
3128
  }), /*#__PURE__*/jsx(Typography, {
3129
+ color: "muted",
3118
3130
  "data-testid": "action-sub-item-description",
3119
- variant: "body1",
3131
+ variant: "body3",
3120
3132
  children: t("neetoRules.form.addActionSubItemDescription")
3121
3133
  })]
3122
3134
  })
@@ -3499,7 +3511,7 @@ var MultiSelectCheckbox = function MultiSelectCheckbox(_ref2) {
3499
3511
  };
3500
3512
  var defaultLabel = t("neetoRules.labels.selectValues");
3501
3513
  return /*#__PURE__*/jsxs("div", {
3502
- className: "space-y-3",
3514
+ className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
3503
3515
  children: [/*#__PURE__*/jsx(Label, {
3504
3516
  required: required,
3505
3517
  children: defaultLabel
@@ -3756,6 +3768,7 @@ var RadioField = function RadioField(_ref2) {
3756
3768
  }), isNotEmpty(searchedOptions) ? /*#__PURE__*/jsx(RadioGroup$1, _objectSpread$4(_objectSpread$4({
3757
3769
  ref: ref,
3758
3770
  required: required,
3771
+ className: PANEL_RADIO_GROUP_CLASSES,
3759
3772
  label: showLabel && t("neetoRules.labels.selectValue"),
3760
3773
  orientation: "vertical",
3761
3774
  value: selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value,
@@ -4013,8 +4026,9 @@ var FieldPanel = function FieldPanel() {
4013
4026
  variant: "h5",
4014
4027
  children: [index ? logicalOperatorLabel : conditionLabel, "..."]
4015
4028
  }), /*#__PURE__*/jsx(Typography, {
4029
+ color: "muted",
4016
4030
  "data-testid": "condition-description",
4017
- variant: "body1",
4031
+ variant: "body3",
4018
4032
  children: t("neetoRules.form.addConditionDescription")
4019
4033
  })]
4020
4034
  })
@@ -4257,8 +4271,9 @@ var VerbAndValuePanel = function VerbAndValuePanel() {
4257
4271
  children: [index ? logicalOperatorLabel : conditionLabel, " ", fieldLabel, "..."]
4258
4272
  })]
4259
4273
  }), /*#__PURE__*/jsx(Typography, {
4274
+ color: "muted",
4260
4275
  "data-testid": "condition-verb-and-value-description",
4261
- variant: "body1",
4276
+ variant: "body3",
4262
4277
  children: t("neetoRules.form.addConditionVerbAndValueDescription")
4263
4278
  })]
4264
4279
  })
@@ -4344,7 +4359,8 @@ var DelayPanel = function DelayPanel() {
4344
4359
  variant: "h5",
4345
4360
  children: t("neetoRules.common.addDelay")
4346
4361
  }), /*#__PURE__*/jsx(Typography, {
4347
- variant: "body1",
4362
+ color: "muted",
4363
+ variant: "body3",
4348
4364
  children: t("neetoRules.helpText.addDelay")
4349
4365
  })]
4350
4366
  })
@@ -4361,16 +4377,14 @@ var DelayPanel = function DelayPanel() {
4361
4377
  type: "number",
4362
4378
  onFocus: setValueFieldActive
4363
4379
  }), /*#__PURE__*/jsx(Select$1, {
4364
- defaultValue: findBy({
4365
- value: value.unit
4366
- }, DELAY_UNIT_OPTIONS),
4367
- innerRef: unitRef,
4380
+ defaultValue: value.unit,
4368
4381
  name: "".concat(name, ".value.unit"),
4369
4382
  options: DELAY_UNIT_OPTIONS,
4370
4383
  placeholder: t("neetoRules.placeholders.selectOption"),
4371
- onChange: function onChange(option) {
4384
+ ref: unitRef,
4385
+ onChange: function onChange(unit) {
4372
4386
  return setValue(_objectSpread$3(_objectSpread$3({}, value), {}, {
4373
- unit: option.value
4387
+ unit: unit
4374
4388
  }));
4375
4389
  },
4376
4390
  onFocus: setUnitFieldActive
@@ -4599,8 +4613,9 @@ var EventsPanel = function EventsPanel() {
4599
4613
  variant: "h5",
4600
4614
  children: [t("neetoRules.common.when"), "..."]
4601
4615
  }), /*#__PURE__*/jsx(Typography, {
4616
+ color: "muted",
4602
4617
  "data-testid": "event-description",
4603
- variant: "body1",
4618
+ variant: "body3",
4604
4619
  children: t("neetoRules.form.addEventDescription")
4605
4620
  })]
4606
4621
  })
@@ -4622,8 +4637,9 @@ var EventsPanel = function EventsPanel() {
4622
4637
  }
4623
4638
  })
4624
4639
  }), /*#__PURE__*/jsxs("div", {
4625
- className: "space-y-3",
4640
+ className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
4626
4641
  children: [isNotEmpty(searchedOptions) ? singleSelect ? /*#__PURE__*/jsx(RadioGroup$1, {
4642
+ className: PANEL_RADIO_GROUP_CLASSES,
4627
4643
  orientation: "vertical",
4628
4644
  value: (eventNames === null || eventNames === void 0 ? void 0 : eventNames[0]) || "",
4629
4645
  onValueChange: handleRadioChange,
@@ -4758,14 +4774,16 @@ var PerformerPanel = function PerformerPanel() {
4758
4774
  children: [t("neetoRules.form.actionTriggeredBy"), "..."]
4759
4775
  })]
4760
4776
  }), /*#__PURE__*/jsx(Typography, {
4777
+ color: "muted",
4761
4778
  "data-testid": "performer-description",
4762
- variant: "body1",
4779
+ variant: "body3",
4763
4780
  children: t("neetoRules.form.addPerformerDescription")
4764
4781
  })]
4765
4782
  })
4766
4783
  }), /*#__PURE__*/jsx(Panel.Body, {
4767
4784
  children: /*#__PURE__*/jsx(RadioGroup, {
4768
4785
  ref: ref,
4786
+ className: PANEL_RADIO_GROUP_CLASSES,
4769
4787
  disabled: isMenuDisabled,
4770
4788
  name: "".concat(performerName, ".value"),
4771
4789
  orientation: "vertical",
@@ -5336,4 +5354,4 @@ var formatData = function formatData(data) {
5336
5354
  };
5337
5355
 
5338
5356
  export { ActionSubItem as A, DEFAULT_RULE_ACTION as D, EditorAction as E, FIELDS_WITH_OPTIONS as F, OPERATORS as O, PANEL_TYPES as P, RadioField as R, SelectField as S, TouchErrors as T, ValueField as V, getFieldDetails$1 as a, getSlackChannelErrors as b, getLogicalOperatorOptions as c, getFieldDetails as d, getVerbOptions as e, DEFAULT_DELAY as f, getActionOptions as g, getAllEvents as h, STATUS_KEYS as i, formatData as j, buildPayload as k, ScrollToErrorField as l, Panel as m, getValidationSchema as n, DEFAULT_INITIAL_VALUE as o, ErrorCallout as p, SmsFields as q, PhoneNumberField as r, usePollRuleName as u };
5339
- //# sourceMappingURL=index-7Oqmz32n.js.map
5357
+ //# sourceMappingURL=index-5dGlq6Wm.js.map