@wix/form-public 0.507.0 → 0.508.0

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.js CHANGED
@@ -55357,19 +55357,12 @@ var useInvokeCallback = (callback) => {
55357
55357
  // ../form-fields/dist/esm/ui/events-repeater/events-repeater-headless.js
55358
55358
  var NO_ERRORS2 = [];
55359
55359
  var NO_VALUES = {};
55360
- var GuestCount = ({ children, className, groupClassName, ...internal }) => {
55360
+ var GuestCount = ({ children, ...internal }) => {
55361
55361
  const { guestLimit, guestCount, onGuestCountChange } = internal;
55362
- const { id: id6, label, disabled, readOnly, onBlur, onFocus } = useFieldPropsV2();
55363
- const { inputId, ariaDescribedBy } = useFieldAttributes();
55362
+ const { label, disabled, readOnly, onBlur, onFocus } = useFieldPropsV2();
55364
55363
  const invokeBlur = useInvokeCallback(onBlur);
55365
- const ref = useRef(null);
55366
- useFocusFieldEvent(() => {
55367
- ref.current?.focus();
55368
- }, id6);
55369
- const decrementElement = findChildOfType(children, GuestCount.Decrement);
55370
- const incrementElement = findChildOfType(children, GuestCount.Increment);
55364
+ const controlElement = findChildOfType(children, GuestCount.Control);
55371
55365
  return /* @__PURE__ */ React172.createElement(NumberField, {
55372
- className: groupClassName,
55373
55366
  "aria-label": label,
55374
55367
  value: guestCount,
55375
55368
  onChange: onGuestCountChange,
@@ -55380,13 +55373,33 @@ var GuestCount = ({ children, className, groupClassName, ...internal }) => {
55380
55373
  isReadOnly: readOnly,
55381
55374
  onBlur: invokeBlur,
55382
55375
  onFocus
55383
- }, /* @__PURE__ */ React172.createElement(Input, {
55376
+ }, controlElement);
55377
+ };
55378
+ var GuestCountControl = ({ children, className }) => {
55379
+ const { disabled, readOnly } = useFieldPropsV2();
55380
+ const inputElement = findChildOfType(children, GuestCount.Input);
55381
+ const decrementElement = findChildOfType(children, GuestCount.Decrement);
55382
+ const incrementElement = findChildOfType(children, GuestCount.Increment);
55383
+ return /* @__PURE__ */ React172.createElement(Group, {
55384
+ className,
55385
+ isDisabled: disabled,
55386
+ isReadOnly: readOnly
55387
+ }, inputElement, incrementElement, decrementElement);
55388
+ };
55389
+ var GuestCountInput = ({ className }) => {
55390
+ const { id: id6 } = useFieldPropsV2();
55391
+ const { inputId, ariaDescribedBy } = useFieldAttributes();
55392
+ const ref = useRef(null);
55393
+ useFocusFieldEvent(() => {
55394
+ ref.current?.focus();
55395
+ }, id6);
55396
+ return /* @__PURE__ */ React172.createElement(Input, {
55384
55397
  ref,
55385
55398
  id: inputId,
55386
55399
  "aria-describedby": ariaDescribedBy,
55387
55400
  className,
55388
55401
  inputMode: "numeric"
55389
- }), incrementElement, decrementElement);
55402
+ });
55390
55403
  };
55391
55404
  var GuestCountDecrement = ({ children, className }) => {
55392
55405
  return /* @__PURE__ */ React172.createElement(Button, {
@@ -55495,6 +55508,8 @@ var Guest = ({ className, ...internal }) => {
55495
55508
  fieldActions
55496
55509
  }));
55497
55510
  };
55511
+ GuestCount.Control = GuestCountControl;
55512
+ GuestCount.Input = GuestCountInput;
55498
55513
  GuestCount.Decrement = GuestCountDecrement;
55499
55514
  GuestCount.Increment = GuestCountIncrement;
55500
55515
  GuestToggle.Input = SelectionIndicator;