@jsenv/navi 0.27.71 → 0.27.73

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.
@@ -19661,7 +19661,7 @@ const MIN_LENGTH_CONSTRAINT = {
19661
19661
  }
19662
19662
  const valueAsString =
19663
19663
  field.uiState === undefined ? "" : String(field.uiState);
19664
- if (!valueAsString) {
19664
+ if (!valueAsString && !field.controlHostProps.required) {
19665
19665
  return null;
19666
19666
  }
19667
19667
  const valueLength = valueAsString.length;
@@ -31513,7 +31513,6 @@ const FieldAsLabel = props => {
31513
31513
  children
31514
31514
  } = props;
31515
31515
  const isVertical = props.flex === "y";
31516
- const htmlFor = Object.hasOwn(props, "htmlFor") ? props.htmlFor : undefined;
31517
31516
  return jsx(Label, {
31518
31517
  "navi-field": "",
31519
31518
  alignX: isVertical ? "start" : undefined,
@@ -31521,7 +31520,6 @@ const FieldAsLabel = props => {
31521
31520
  ...props,
31522
31521
  spacingWithControl: undefined,
31523
31522
  "data-vertical": isVertical ? "" : undefined,
31524
- htmlFor: htmlFor,
31525
31523
  children: children
31526
31524
  });
31527
31525
  };
@@ -31572,13 +31570,14 @@ const Label = props => {
31572
31570
  // When neither is present the label either wraps the control directly
31573
31571
  // (implicit HTML association) or is disconnected — either way, a
31574
31572
  // randomly generated id would point to nothing and cause confusion.
31575
- const htmlFor = Object.hasOwn(props, "htmlFor") ? props.htmlFor : controlId;
31573
+ if (!Object.hasOwn(props, "htmlFor") && controlId) {
31574
+ props.htmlFor = controlId;
31575
+ }
31576
31576
  const [messageProps, remainingProps] = extractMessageAndRemainingProps(props);
31577
31577
  const messagePropsRef = useRef();
31578
31578
  messagePropsRef.current = messageProps;
31579
31579
  return jsx(Box, {
31580
31580
  as: "label",
31581
- htmlFor: htmlFor,
31582
31581
  baseClassName: "navi_label",
31583
31582
  pseudoClasses: FIELD_PSEUDO_CLASSES,
31584
31583
  "data-control-connected": connected ? "" : undefined,
@@ -31600,7 +31599,7 @@ const Label = props => {
31600
31599
  children: jsx(MessagePropsRefContext.Provider, {
31601
31600
  value: messagePropsRef,
31602
31601
  children: jsx(ControlIdContext.Provider, {
31603
- value: htmlFor,
31602
+ value: props.htmlFor,
31604
31603
  children: children
31605
31604
  })
31606
31605
  })