@hyphen/hyphen-components 5.0.0 → 5.1.1

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.
@@ -3452,13 +3452,13 @@ var ToggleGroupItem = /*#__PURE__*/forwardRef(function (_ref2, ref) {
3452
3452
  var appliedVariant = variant || contextVariant;
3453
3453
  return React__default.createElement(ToggleGroupPrimitive.Item, _extends({
3454
3454
  ref: ref,
3455
- className: classNames(styles$b.item, appliedVariant === 'outline' && styles$b.outline, className),
3455
+ className: classNames('br-sm display-flex g-sm p-sm', styles$b.item, appliedVariant === 'outline' && styles$b.outline, className),
3456
3456
  value: value
3457
3457
  }, props), children);
3458
3458
  });
3459
3459
  ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
3460
3460
 
3461
- var _excluded$9 = ["field", "form", "options"];
3461
+ var _excluded$9 = ["field", "form", "options", "helpText", "label", "children"];
3462
3462
  var FormikToggleGroup = function FormikToggleGroup(_ref) {
3463
3463
  var _ref$field = _ref.field,
3464
3464
  name = _ref$field.name,
@@ -3469,9 +3469,15 @@ var FormikToggleGroup = function FormikToggleGroup(_ref) {
3469
3469
  errors = _ref$form.errors,
3470
3470
  setFieldValue = _ref$form.setFieldValue,
3471
3471
  options = _ref.options,
3472
+ helpText = _ref.helpText,
3473
+ label = _ref.label,
3474
+ children = _ref.children,
3472
3475
  props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
3473
- console.log(getIn(touched, name), getIn(errors, name));
3474
- return React__default.createElement(ToggleGroup, _extends({}, props, {
3476
+ return React__default.createElement(Box, {
3477
+ gap: "sm"
3478
+ }, (label || helpText) && React__default.createElement("div", null, label && React__default.createElement(Box, {
3479
+ fontSize: "sm"
3480
+ }, label), helpText && React__default.createElement(HelpText, null, helpText)), React__default.createElement(ToggleGroup, _extends({}, props, {
3475
3481
  name: name,
3476
3482
  onBlur: onBlur,
3477
3483
  onValueChange: function onValueChange(value) {
@@ -3480,13 +3486,14 @@ var FormikToggleGroup = function FormikToggleGroup(_ref) {
3480
3486
  value: value,
3481
3487
  error: getIn(touched, name) && getIn(errors, name),
3482
3488
  type: "single"
3483
- }), options.map(function (option) {
3489
+ }), children ? children : options.map(function (option) {
3484
3490
  return React__default.createElement(ToggleGroupItem, {
3491
+ id: option.id,
3485
3492
  value: option.value,
3486
3493
  key: option.id,
3487
3494
  disabled: !!option.disabled
3488
3495
  }, option.label);
3489
- }));
3496
+ })));
3490
3497
  };
3491
3498
 
3492
3499
  var _excluded$8 = ["children", "padding", "direction", "alignItems", "justifyContent", "gap", "style"];
@@ -5323,7 +5330,7 @@ var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
5323
5330
  props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
5324
5331
  return React__default.createElement(TogglePrimitive.Root, _extends({
5325
5332
  ref: ref,
5326
- className: classNames(styles$1.item, variant === 'outline' && styles$1.outline, className)
5333
+ className: classNames('br-sm display-flex g-sm p-sm', styles$1.item, variant === 'outline' && styles$1.outline, className)
5327
5334
  }, props), children);
5328
5335
  });
5329
5336