@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.cjs CHANGED
@@ -5178,7 +5178,10 @@ var Icons = {
5178
5178
  // src/components/PresentationContext.tsx
5179
5179
  var import_react5 = require("react");
5180
5180
  var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
5181
- var PresentationContext = (0, import_react5.createContext)({});
5181
+ var PresentationContext = (0, import_react5.createContext)({
5182
+ // Required fields should always show asterisk
5183
+ fieldProps: { labelSuffix: { required: "*" } }
5184
+ });
5182
5185
  function PresentationProvider(props) {
5183
5186
  const { children, ...presentationProps } = props;
5184
5187
  const existingContext = usePresentationContext();
@@ -8385,8 +8388,9 @@ var BorderHoverParent = "BorderHoverParent";
8385
8388
  var BorderHoverChild = "BorderHoverChild";
8386
8389
 
8387
8390
  // src/forms/labelUtils.ts
8388
- function getLabelSuffix(required) {
8391
+ function useLabelSuffix(required, readOnly) {
8389
8392
  const { fieldProps } = usePresentationContext();
8393
+ if (readOnly) return void 0;
8390
8394
  if (required === true) {
8391
8395
  return fieldProps?.labelSuffix?.required;
8392
8396
  } else if (required === false) {
@@ -8456,7 +8460,7 @@ function TextFieldBase(props) {
8456
8460
  const internalProps = props.internalProps || {};
8457
8461
  const { compound = false, forceFocus = false, forceHover = false } = internalProps;
8458
8462
  const errorMessageId = `${inputProps.id}-error`;
8459
- const labelSuffix = getLabelSuffix(required);
8463
+ const labelSuffix = useLabelSuffix(required, inputProps.readOnly);
8460
8464
  const ElementType = multiline ? "textarea" : "input";
8461
8465
  const tid = useTestIds(props, defaultTestId(label));
8462
8466
  const [isFocused, setIsFocused] = (0, import_react30.useState)(false);