@homebound/beam 2.379.1 → 2.380.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.
package/dist/index.js CHANGED
@@ -4834,7 +4834,10 @@ var Icons = {
4834
4834
  // src/components/PresentationContext.tsx
4835
4835
  import { createContext, useContext as useContext2, useMemo as useMemo2 } from "react";
4836
4836
  import { jsx as jsx4 } from "@emotion/react/jsx-runtime";
4837
- var PresentationContext = createContext({});
4837
+ var PresentationContext = createContext({
4838
+ // Required fields should always show asterisk
4839
+ fieldProps: { labelSuffix: { required: "*" } }
4840
+ });
4838
4841
  function PresentationProvider(props) {
4839
4842
  const { children, ...presentationProps } = props;
4840
4843
  const existingContext = usePresentationContext();
@@ -8043,8 +8046,9 @@ var BorderHoverParent = "BorderHoverParent";
8043
8046
  var BorderHoverChild = "BorderHoverChild";
8044
8047
 
8045
8048
  // src/forms/labelUtils.ts
8046
- function getLabelSuffix(required) {
8049
+ function useLabelSuffix(required, readOnly) {
8047
8050
  const { fieldProps } = usePresentationContext();
8051
+ if (readOnly) return void 0;
8048
8052
  if (required === true) {
8049
8053
  return fieldProps?.labelSuffix?.required;
8050
8054
  } else if (required === false) {
@@ -8114,7 +8118,7 @@ function TextFieldBase(props) {
8114
8118
  const internalProps = props.internalProps || {};
8115
8119
  const { compound = false, forceFocus = false, forceHover = false } = internalProps;
8116
8120
  const errorMessageId = `${inputProps.id}-error`;
8117
- const labelSuffix = getLabelSuffix(required);
8121
+ const labelSuffix = useLabelSuffix(required, inputProps.readOnly);
8118
8122
  const ElementType = multiline ? "textarea" : "input";
8119
8123
  const tid = useTestIds(props, defaultTestId(label));
8120
8124
  const [isFocused, setIsFocused] = useState11(false);