@ostack.tech/ui 0.6.4 → 0.7.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.
Files changed (45) hide show
  1. package/dist/chunks/{en-C2peM913.js → en-BfgHKQwn.js} +2 -1
  2. package/dist/chunks/en-BfgHKQwn.js.map +1 -0
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +1 -0
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +1 -0
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui.css +16 -10
  10. package/dist/ostack-ui.css.map +1 -1
  11. package/dist/ostack-ui.js +1065 -909
  12. package/dist/ostack-ui.js.map +1 -1
  13. package/dist/types/components/Button/Button.d.ts +35 -10
  14. package/dist/types/components/Checkbox/Checkbox.d.ts +26 -2
  15. package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +29 -2
  16. package/dist/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +4 -0
  17. package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +1 -1
  18. package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +47 -12
  19. package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
  20. package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +1 -1
  21. package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
  22. package/dist/types/components/Field/FieldContext.d.ts +1 -0
  23. package/dist/types/components/IconButton/IconButton.d.ts +35 -8
  24. package/dist/types/components/Input/Input.d.ts +32 -2
  25. package/dist/types/components/MenuList/MenuListItem.d.ts +30 -13
  26. package/dist/types/components/Output/Output.d.ts +20 -2
  27. package/dist/types/components/RadioGroup/Radio.d.ts +26 -2
  28. package/dist/types/components/RadioGroup/RadioGroup.d.ts +26 -2
  29. package/dist/types/components/Select/Select.d.ts +1 -1
  30. package/dist/types/index.d.ts +2 -1
  31. package/dist/types/providers/LocalizationProvider/LocalizationObject.d.ts +1 -1
  32. package/dist/types/utils/combineAriaIds.d.ts +2 -0
  33. package/dist/types/utils/control.d.ts +1 -0
  34. package/dist/types/utils/setNativeProperty.d.ts +8 -0
  35. package/package.json +1 -1
  36. package/scss/components/Checkbox/_Checkbox.scss +1 -1
  37. package/scss/components/DropdownMenu/_DropdownMenu.scss +1 -1
  38. package/scss/components/RadioGroup/_Radio.scss +1 -1
  39. package/scss/components/Root/_Root.scss +5 -0
  40. package/scss/scss/placeholders/checkable/_checkable.scss +3 -3
  41. package/scss/scss/placeholders/control/_control.scss +1 -1
  42. package/scss/scss/placeholders/menu/_menu.scss +8 -3
  43. package/dist/chunks/en-C2peM913.js.map +0 -1
  44. package/dist/types/utils/mergeAriaIds.d.ts +0 -2
  45. package/dist/types/utils/setNativeValue.d.ts +0 -7
package/dist/ostack-ui.js CHANGED
@@ -883,7 +883,7 @@ function useSetFieldControl(controlId, controlTagName, controlCodeId, controlHas
883
883
  const store = useFieldContext();
884
884
  const generatedId = useId();
885
885
  const actualControlId = controlId ?? prefix(`control-${generatedId}`);
886
- const actualCodeId = controlCodeId ?? prefix(`control-code-${generatedId}`);
886
+ const actualCodeId = controlHasCode ? controlCodeId ?? prefix(`control-code-${generatedId}`) : void 0;
887
887
  useEffect(() => {
888
888
  store?.setState({
889
889
  controlId: actualControlId,
@@ -899,8 +899,9 @@ function useSetFieldControl(controlId, controlTagName, controlCodeId, controlHas
899
899
  });
900
900
  }, [actualControlId, controlTagName, controlHasCode, controlRequired, store]);
901
901
  return {
902
+ generatedId,
902
903
  controlId: actualControlId,
903
- codeId: controlHasCode ? actualCodeId : void 0
904
+ codeId: actualCodeId
904
905
  };
905
906
  }
906
907
  function useSetFieldControlFocused() {
@@ -1331,7 +1332,7 @@ const Spinner = forwardRef(
1331
1332
  ),
1332
1333
  "data-accent": color,
1333
1334
  role: "status",
1334
- "aria-hidden": "true",
1335
+ "aria-hidden": true,
1335
1336
  ref: forwardedRef,
1336
1337
  ...otherProps
1337
1338
  }
@@ -1419,8 +1420,8 @@ const IconButton = forwardRef(
1419
1420
  active,
1420
1421
  disabled,
1421
1422
  loading,
1422
- enabledWhenLoading,
1423
1423
  loadingLabel,
1424
+ showSpinner = loading,
1424
1425
  disableTooltip,
1425
1426
  iconProps,
1426
1427
  spinnerProps,
@@ -1432,10 +1433,10 @@ const IconButton = forwardRef(
1432
1433
  ...otherProps
1433
1434
  }, forwardedRef) {
1434
1435
  const prefix = usePrefix();
1435
- const relevantLabel = loading ? loadingLabel ?? label : label;
1436
+ const relevantLabel = loading ? loadingLabel || label : label;
1436
1437
  const labelEl = relevantLabel && /* @__PURE__ */ jsx(VisuallyHidden, { children: relevantLabel });
1437
- const iconEl = icon && !loading && /* @__PURE__ */ jsx(Slot, { className: cx(prefix("icon-button__icon"), iconProps?.className), children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, fixedWidth: true, ...iconProps }) });
1438
- const spinnerEl = loading && /* @__PURE__ */ jsx(
1438
+ const iconEl = icon && !showSpinner && /* @__PURE__ */ jsx(Slot, { className: cx(prefix("icon-button__icon"), iconProps?.className), children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, fixedWidth: true, ...iconProps }) });
1439
+ const spinnerEl = showSpinner && /* @__PURE__ */ jsx(
1439
1440
  Spinner,
1440
1441
  {
1441
1442
  ...spinnerProps,
@@ -1450,16 +1451,15 @@ const IconButton = forwardRef(
1450
1451
  if (asChild) {
1451
1452
  content = cloneElement(children, void 0, content);
1452
1453
  }
1453
- const loadingDisabled = loading && !enabledWhenLoading;
1454
- const visiblyDisabled = disabled || loadingDisabled;
1455
1454
  const handleClick = useCallback(
1456
1455
  (evt) => {
1457
- if (visiblyDisabled) {
1458
- return evt.preventDefault();
1456
+ if (disabled || loading) {
1457
+ evt.preventDefault();
1458
+ return;
1459
1459
  }
1460
- return onClick?.(evt);
1460
+ onClick?.(evt);
1461
1461
  },
1462
- [onClick, visiblyDisabled]
1462
+ [disabled, loading, onClick]
1463
1463
  );
1464
1464
  const As = asChild ? Slot : "button";
1465
1465
  const button = /* @__PURE__ */ jsx(
@@ -1476,8 +1476,8 @@ const IconButton = forwardRef(
1476
1476
  onClick: handleClick,
1477
1477
  "data-accent": color,
1478
1478
  disabled,
1479
- "data-disabled": boolDataAttr(loadingDisabled || asChild && disabled),
1480
- "aria-disabled": loadingDisabled || asChild && disabled ? "true" : void 0,
1479
+ "data-disabled": boolDataAttr(loading || asChild && disabled),
1480
+ "aria-disabled": loading || asChild && disabled || void 0,
1481
1481
  "data-active": boolDataAttr(active),
1482
1482
  tabIndex: asChild && disabled ? -1 : void 0,
1483
1483
  ref: forwardedRef,
@@ -1678,8 +1678,8 @@ const Button = forwardRef(
1678
1678
  active,
1679
1679
  disabled,
1680
1680
  loading,
1681
- enabledWhenLoading,
1682
1681
  loadingContent,
1682
+ showSpinner = loading,
1683
1683
  iconProps,
1684
1684
  spinnerProps,
1685
1685
  type,
@@ -1689,7 +1689,7 @@ const Button = forwardRef(
1689
1689
  ...otherProps
1690
1690
  }, forwardedRef) {
1691
1691
  const prefix = usePrefix();
1692
- const iconEl = icon && !loading && /* @__PURE__ */ jsx(
1692
+ const iconEl = icon && !showSpinner && /* @__PURE__ */ jsx(
1693
1693
  Slot,
1694
1694
  {
1695
1695
  className: cx(
@@ -1700,7 +1700,7 @@ const Button = forwardRef(
1700
1700
  children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, ...iconProps })
1701
1701
  }
1702
1702
  );
1703
- const spinnerEl = loading && /* @__PURE__ */ jsx(
1703
+ const spinnerEl = showSpinner && /* @__PURE__ */ jsx(
1704
1704
  Spinner,
1705
1705
  {
1706
1706
  ...spinnerProps,
@@ -1712,16 +1712,15 @@ const Button = forwardRef(
1712
1712
  }
1713
1713
  );
1714
1714
  const content = loading && loadingContent ? asChild ? cloneElement(children, void 0, loadingContent) : loadingContent : children;
1715
- const loadingDisabled = loading && !enabledWhenLoading;
1716
- const visiblyDisabled = disabled || loadingDisabled;
1717
1715
  const handleClick = useCallback(
1718
1716
  (evt) => {
1719
- if (visiblyDisabled) {
1720
- return evt.preventDefault();
1717
+ if (disabled || loading) {
1718
+ evt.preventDefault();
1719
+ return;
1721
1720
  }
1722
- return onClick?.(evt);
1721
+ onClick?.(evt);
1723
1722
  },
1724
- [onClick, visiblyDisabled]
1723
+ [disabled, loading, onClick]
1725
1724
  );
1726
1725
  const As = asChild ? Slot : "button";
1727
1726
  return /* @__PURE__ */ jsxs(
@@ -1738,8 +1737,8 @@ const Button = forwardRef(
1738
1737
  onClick: handleClick,
1739
1738
  "data-accent": color,
1740
1739
  disabled,
1741
- "data-disabled": boolDataAttr(loadingDisabled || asChild && disabled),
1742
- "aria-disabled": loadingDisabled || asChild && disabled ? "true" : void 0,
1740
+ "data-disabled": boolDataAttr(loading || asChild && disabled),
1741
+ "aria-disabled": loading || asChild && disabled || void 0,
1743
1742
  "data-active": boolDataAttr(active),
1744
1743
  tabIndex: asChild && disabled ? -1 : void 0,
1745
1744
  ref: forwardedRef,
@@ -2858,7 +2857,9 @@ const ControlAddon = forwardRef(
2858
2857
  className: cx(prefix("control-addon"), className),
2859
2858
  "data-variant": controlContext?.variant ?? variant,
2860
2859
  "data-status": controlContext?.status ?? status,
2861
- "data-muted": boolDataAttr(controlContext?.disabled || muted),
2860
+ "data-muted": boolDataAttr(
2861
+ controlContext?.disabled || controlContext?.loading || muted
2862
+ ),
2862
2863
  "data-readonly": boolDataAttr(controlContext?.readOnly || readOnly),
2863
2864
  ref: forwardedRef,
2864
2865
  ...otherProps
@@ -2866,34 +2867,34 @@ const ControlAddon = forwardRef(
2866
2867
  ) });
2867
2868
  }
2868
2869
  );
2869
- function mergeAriaIds(...args) {
2870
+ function combineAriaIds(...args) {
2870
2871
  const ids = [];
2871
2872
  for (const arg of args) {
2872
- if (!arg) {
2873
- continue;
2874
- }
2875
2873
  if (Array.isArray(arg)) {
2876
- const innerIds = mergeAriaIds(...arg);
2874
+ const innerIds = combineAriaIds(...arg);
2877
2875
  if (innerIds) {
2878
2876
  args.push(innerIds);
2879
2877
  }
2880
- } else {
2878
+ } else if (arg) {
2881
2879
  ids.push(String(arg));
2882
2880
  }
2883
2881
  }
2884
2882
  return ids.join(" ") || void 0;
2885
2883
  }
2886
- function setNativeValue(element, value) {
2887
- const { set: valueSetter } = Object.getOwnPropertyDescriptor(element, "value") ?? {};
2888
- const prototype = Object.getPrototypeOf(element);
2889
- const { set: prototypeValueSetter } = Object.getOwnPropertyDescriptor(prototype, "value") ?? {};
2890
- if (prototypeValueSetter && valueSetter !== prototypeValueSetter) {
2891
- prototypeValueSetter.call(element, value);
2892
- } else if (valueSetter) {
2893
- valueSetter.call(element, value);
2894
- } else {
2895
- throw new Error("The given element does not have a value setter.");
2884
+ function setNativeProperty(element, prop, value) {
2885
+ for (let proto = Object.getPrototypeOf(element); proto !== null; proto = Object.getPrototypeOf(proto)) {
2886
+ const protoSetter = Object.getOwnPropertyDescriptor(proto, prop)?.set;
2887
+ if (protoSetter) {
2888
+ protoSetter.call(element, value);
2889
+ return;
2890
+ }
2891
+ }
2892
+ const ownSetter = Object.getOwnPropertyDescriptor(element, prop)?.set;
2893
+ if (ownSetter) {
2894
+ ownSetter.call(element, value);
2895
+ return;
2896
2896
  }
2897
+ throw new Error(`The given element does not have a "${prop}" setter.`);
2897
2898
  }
2898
2899
  function camelToKebabCase(str) {
2899
2900
  return str.replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`);
@@ -3429,11 +3430,11 @@ const Table = forwardRef(
3429
3430
  className
3430
3431
  ),
3431
3432
  "data-status": status,
3432
- "aria-describedby": mergeAriaIds(
3433
+ "aria-describedby": combineAriaIds(
3433
3434
  codeId,
3434
- descriptionIds,
3435
3435
  errorMessageIds,
3436
- ariaDescribedBy
3436
+ ariaDescribedBy,
3437
+ descriptionIds
3437
3438
  ),
3438
3439
  ...otherProps,
3439
3440
  ref: combinedTableRef,
@@ -3693,7 +3694,7 @@ const TableRow = forwardRef(
3693
3694
  {
3694
3695
  className: cx(prefix("table__row"), className),
3695
3696
  "data-selected": boolDataAttr(selected),
3696
- "aria-selected": selected ? "true" : void 0,
3697
+ "aria-selected": selected || void 0,
3697
3698
  ...otherProps,
3698
3699
  ref: forwardedRef
3699
3700
  }
@@ -3880,9 +3881,9 @@ const TableHead = forwardRef(
3880
3881
  prefix("table__column-sort-button"),
3881
3882
  sortButtonProps?.className
3882
3883
  ),
3883
- "aria-describedby": mergeAriaIds(
3884
- sortDescriptionId,
3885
- sortButtonProps?.["aria-describedby"]
3884
+ "aria-describedby": combineAriaIds(
3885
+ sortButtonProps?.["aria-describedby"],
3886
+ sortDescriptionId
3886
3887
  ),
3887
3888
  onClick: combineEventHandlers(
3888
3889
  sortButtonProps?.onClick,
@@ -4376,6 +4377,8 @@ const Checkbox = forwardRef(function Checkbox2({
4376
4377
  status,
4377
4378
  code,
4378
4379
  loading,
4380
+ loadingDescription,
4381
+ showSpinner = loading,
4379
4382
  onBlurToOutside,
4380
4383
  children,
4381
4384
  rootProps,
@@ -4396,26 +4399,29 @@ const Checkbox = forwardRef(function Checkbox2({
4396
4399
  required,
4397
4400
  disabled,
4398
4401
  readOnly,
4402
+ "aria-label": ariaLabel,
4399
4403
  "aria-labelledby": ariaLabelledBy,
4400
4404
  "aria-describedby": ariaDescribedBy,
4401
4405
  ...otherProps
4402
4406
  }, forwardedRef) {
4403
4407
  const prefix = usePrefix();
4408
+ const [locale7] = useLocale();
4409
+ loadingDescription ??= locale7.Input.loadingDescription;
4404
4410
  const controlContext = useControlContext();
4405
4411
  const checkboxGroupContext = useContext(CheckboxGroupContext);
4406
4412
  const fieldLabelId = useFieldLabelId();
4407
4413
  const dataTableColumnLabelId = useDataTableColumnLabelId();
4408
4414
  const descriptionIds = useFieldDescriptionIds();
4409
4415
  const errorMessageIds = useFieldErrorMessageIds();
4410
- const { controlId, codeId } = useSetFieldControl(
4416
+ const { generatedId, controlId, codeId } = useSetFieldControl(
4411
4417
  id,
4412
4418
  "BUTTON",
4413
4419
  codeProps?.id,
4414
- !!code,
4420
+ Boolean(code),
4415
4421
  required
4416
4422
  );
4417
- const generatedId = useId();
4418
4423
  const labelId = children && (labelProps?.id ?? prefix(`checkbox-label-${generatedId}`));
4424
+ const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
4419
4425
  const checkboxRef = useRef(null);
4420
4426
  const containerRef = useRef(null);
4421
4427
  const labelRef = useRef(null);
@@ -4423,6 +4429,7 @@ const Checkbox = forwardRef(function Checkbox2({
4423
4429
  const checkboxVariant = variant ?? (isInTableCell ? "cell" : "default");
4424
4430
  status = controlContext?.status ?? status;
4425
4431
  disabled = controlContext?.disabled || disabled;
4432
+ loading = controlContext?.loading || loading;
4426
4433
  readOnly = controlContext?.readOnly || readOnly;
4427
4434
  const [checked, setChecked] = useControllableState(
4428
4435
  defaultChecked ?? false,
@@ -4431,13 +4438,20 @@ const Checkbox = forwardRef(function Checkbox2({
4431
4438
  const onContextCheckedChange = checkboxGroupContext?.onCheckedChange;
4432
4439
  const handleCheckedChange = useCallback(
4433
4440
  (state) => {
4434
- if (!readOnly) {
4441
+ if (!loading && !readOnly) {
4435
4442
  onCheckedChange?.(state);
4436
4443
  setChecked(state);
4437
4444
  onContextCheckedChange?.(value?.toString() ?? "", state === true);
4438
4445
  }
4439
4446
  },
4440
- [onCheckedChange, onContextCheckedChange, readOnly, setChecked, value]
4447
+ [
4448
+ loading,
4449
+ onCheckedChange,
4450
+ onContextCheckedChange,
4451
+ readOnly,
4452
+ setChecked,
4453
+ value
4454
+ ]
4441
4455
  );
4442
4456
  const setFieldControlFocused = useSetFieldControlFocused();
4443
4457
  const handleFocus = useCallback(() => {
@@ -4461,6 +4475,10 @@ const Checkbox = forwardRef(function Checkbox2({
4461
4475
  void Promise.resolve().then(() => labelEl.tabIndex = -1);
4462
4476
  }
4463
4477
  }, []);
4478
+ const combinedLabelIds = combineAriaIds(
4479
+ codeId,
4480
+ labelId ?? fieldLabelId ?? dataTableColumnLabelId
4481
+ );
4464
4482
  const combinedContainerRef = useCombinedRef(
4465
4483
  containerProps?.ref,
4466
4484
  containerRef
@@ -4478,6 +4496,7 @@ const Checkbox = forwardRef(function Checkbox2({
4478
4496
  ),
4479
4497
  status,
4480
4498
  disabled,
4499
+ loading,
4481
4500
  readOnly
4482
4501
  },
4483
4502
  children: /* @__PURE__ */ jsxs(
@@ -4503,7 +4522,7 @@ const Checkbox = forwardRef(function Checkbox2({
4503
4522
  {
4504
4523
  "data-status": status,
4505
4524
  "data-variant": checkboxVariant,
4506
- "data-disabled": boolDataAttr(disabled),
4525
+ "data-disabled": boolDataAttr(disabled || loading),
4507
4526
  "data-readonly": boolDataAttr(readOnly),
4508
4527
  ...containerProps,
4509
4528
  className: cx(
@@ -4521,30 +4540,31 @@ const Checkbox = forwardRef(function Checkbox2({
4521
4540
  {
4522
4541
  id: controlId,
4523
4542
  className: cx(prefix("checkbox"), className),
4524
- name: name ?? (checkboxGroupContext?.name ? `${checkboxGroupContext.name}[]` : void 0),
4543
+ name: name ?? checkboxGroupContext?.name,
4525
4544
  value,
4526
4545
  checked,
4527
4546
  required,
4528
4547
  disabled,
4548
+ "data-loading": boolDataAttr(loading),
4529
4549
  "data-readonly": boolDataAttr(readOnly),
4530
4550
  "data-status": status,
4531
4551
  "data-variant": checkboxVariant,
4532
4552
  onCheckedChange: handleCheckedChange,
4533
4553
  onFocus: combineEventHandlers(onFocus, handleFocus),
4534
4554
  onBlur: combineEventHandlers(onBlur, handleBlur),
4535
- "aria-readonly": readOnly ? "true" : void 0,
4536
- "aria-labelledby": dataTableColumnLabelId || fieldLabelId || ariaLabelledBy ? mergeAriaIds(
4537
- dataTableColumnLabelId,
4538
- fieldLabelId,
4539
- labelId,
4540
- ariaLabelledBy
4541
- ) : void 0,
4542
- "aria-invalid": status === "invalid" ? "true" : void 0,
4543
- "aria-describedby": mergeAriaIds(
4544
- codeId,
4555
+ "aria-disabled": loading || readOnly || void 0,
4556
+ "aria-label": ariaLabel,
4557
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel === void 0 && combinedLabelIds !== labelId && combinedLabelIds !== fieldLabelId ? combinedLabelIds : void 0),
4558
+ "aria-invalid": status === "invalid" || void 0,
4559
+ "aria-describedby": combineAriaIds(
4560
+ loadingDescriptionId,
4561
+ checkboxGroupContext?.loadingDescriptionId,
4545
4562
  errorMessageIds,
4563
+ checkboxGroupContext?.errorMessageIds,
4564
+ ariaDescribedBy,
4565
+ checkboxGroupContext?.ariaDescribedBy,
4546
4566
  descriptionIds,
4547
- ariaDescribedBy
4567
+ checkboxGroupContext?.descriptionIds
4548
4568
  ),
4549
4569
  ...otherProps,
4550
4570
  ref: combinedCheckboxRef,
@@ -4561,7 +4581,7 @@ const Checkbox = forwardRef(function Checkbox2({
4561
4581
  ) })
4562
4582
  }
4563
4583
  ),
4564
- children && /* @__PURE__ */ jsx(
4584
+ labelId && /* @__PURE__ */ jsx(
4565
4585
  Label,
4566
4586
  {
4567
4587
  htmlFor: controlId,
@@ -4585,18 +4605,19 @@ const Checkbox = forwardRef(function Checkbox2({
4585
4605
  children
4586
4606
  }
4587
4607
  ),
4588
- loading && /* @__PURE__ */ jsx(
4608
+ showSpinner && /* @__PURE__ */ jsx(
4589
4609
  Spinner,
4590
4610
  {
4591
4611
  color: controlStatusToAccent(status, "neutral"),
4592
- "data-disabled": boolDataAttr(disabled),
4612
+ "data-disabled": boolDataAttr(disabled || loading),
4593
4613
  ...spinnerProps,
4594
4614
  className: cx(
4595
4615
  prefix("checkbox__spinner"),
4596
4616
  spinnerProps?.className
4597
4617
  )
4598
4618
  }
4599
- )
4619
+ ),
4620
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
4600
4621
  ]
4601
4622
  }
4602
4623
  )
@@ -5025,7 +5046,7 @@ function ScrolledDataTableRows({
5025
5046
  });
5026
5047
  }, [endIndex, startIndex, store]);
5027
5048
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5028
- /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(
5049
+ /* @__PURE__ */ jsx("tr", { "aria-hidden": true, children: /* @__PURE__ */ jsx(
5029
5050
  "td",
5030
5051
  {
5031
5052
  style: {
@@ -5049,7 +5070,7 @@ function ScrolledDataTableRows({
5049
5070
  const key = rowsWindow[i] ? `row-${getRowKey(rowsWindow[i], rowKey)}` : `loading-${i}`;
5050
5071
  return renderRow ? /* @__PURE__ */ jsx(Fragment$1, { children: renderRow(props) }, key) : /* @__PURE__ */ jsx(DataTableRow, { ...props }, key);
5051
5072
  }),
5052
- /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(
5073
+ /* @__PURE__ */ jsx("tr", { "aria-hidden": true, children: /* @__PURE__ */ jsx(
5053
5074
  "td",
5054
5075
  {
5055
5076
  style: {
@@ -5559,7 +5580,9 @@ const DataTableSelectionTrigger = forwardRef(function DataTableSelectionTrigger2
5559
5580
  }
5560
5581
  );
5561
5582
  });
5562
- const REQUIRABLE_CONTROLS = ["INPUT", "SELECT", "TEXTAREA"];
5583
+ const REQUIRED_TAGS = ["INPUT", "SELECT", "TEXTAREA"];
5584
+ const READ_ONLY_TAGS = ["INPUT", "TEXTAREA"];
5585
+ const NON_READONLY_INPUT_TYPES = ["file", "color"];
5563
5586
  const Input = forwardRef(
5564
5587
  function Input2({
5565
5588
  asChild,
@@ -5570,6 +5593,8 @@ const Input = forwardRef(
5570
5593
  status,
5571
5594
  code,
5572
5595
  loading,
5596
+ loadingDescription,
5597
+ showSpinner = loading,
5573
5598
  align,
5574
5599
  startAdornment,
5575
5600
  endAdornment,
@@ -5592,35 +5617,53 @@ const Input = forwardRef(
5592
5617
  onFocus,
5593
5618
  onBlur,
5594
5619
  onClick,
5620
+ "aria-label": ariaLabel,
5595
5621
  "aria-labelledby": ariaLabelledBy,
5596
5622
  "aria-describedby": ariaDescribedBy,
5597
5623
  ...otherProps
5598
5624
  }, forwardedRef) {
5599
5625
  const prefix = usePrefix();
5600
5626
  const [locale7] = useLocale();
5627
+ loadingDescription ??= locale7.Input.loadingDescription;
5601
5628
  clearButtonLabel ??= locale7.Input.clearButtonLabel;
5602
5629
  const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();
5630
+ const labelId = useFieldLabelId();
5603
5631
  const dataTableColumnLabelId = useDataTableColumnLabelId();
5604
5632
  const descriptionIds = useFieldDescriptionIds();
5605
5633
  const errorMessageIds = useFieldErrorMessageIds();
5606
5634
  const { printHidden } = usePrintClassNames();
5607
5635
  const [inputEl, setInputEl] = useState(null);
5608
- const { controlId, codeId } = useSetFieldControl(
5636
+ const tagName = inputEl?.tagName;
5637
+ const { generatedId, controlId, codeId } = useSetFieldControl(
5609
5638
  id,
5610
- inputEl?.tagName,
5639
+ tagName,
5611
5640
  codeProps?.id,
5612
- !!code,
5641
+ Boolean(code),
5613
5642
  required
5614
5643
  );
5644
+ const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
5615
5645
  const containerRef = useRef(null);
5616
5646
  const clearButtonRef = useRef(null);
5617
5647
  const isInTableCell = useIsInTableCell();
5618
5648
  variant ??= isInTableCell ? "cell" : "default";
5649
+ const isControlled = value !== void 0;
5650
+ const [shouldShowClearButton, setShouldShowClearButton] = useState(
5651
+ ((value ?? defaultValue)?.toString() ?? "").length > 0
5652
+ );
5653
+ useEffect(() => {
5654
+ if (inputEl && showClearButton === "auto" && !isControlled) {
5655
+ setShouldShowClearButton(inputEl.value.length > 0);
5656
+ }
5657
+ }, [inputEl, isControlled, showClearButton]);
5619
5658
  const handleChange = useCallback(
5620
5659
  (event) => {
5621
- onValueChange?.(event.target.value);
5660
+ const inputEl2 = event.target;
5661
+ onValueChange?.(inputEl2.value);
5662
+ if (showClearButton === "auto" && !isControlled) {
5663
+ setShouldShowClearButton(inputEl2.value.length > 0);
5664
+ }
5622
5665
  },
5623
- [onValueChange]
5666
+ [isControlled, onValueChange, showClearButton]
5624
5667
  );
5625
5668
  const setFieldControlFocused = useSetFieldControlFocused();
5626
5669
  const handleControlFocus = useCallback(
@@ -5644,7 +5687,7 @@ const Input = forwardRef(
5644
5687
  );
5645
5688
  const handleClick = useCallback(
5646
5689
  (evt) => {
5647
- if (readOnly && (type === "file" || type === "color")) {
5690
+ if (readOnly && type && NON_READONLY_INPUT_TYPES.includes(type)) {
5648
5691
  evt.preventDefault();
5649
5692
  }
5650
5693
  },
@@ -5658,46 +5701,42 @@ const Input = forwardRef(
5658
5701
  requestAnimationFrame(() => {
5659
5702
  try {
5660
5703
  inputEl.setSelectionRange(cursorIdx, cursorIdx);
5661
- } finally {
5662
- inputEl.focus();
5704
+ } catch {
5663
5705
  }
5706
+ inputEl.focus();
5664
5707
  });
5665
5708
  }
5666
5709
  },
5667
5710
  [disabled, inputEl, prefix]
5668
5711
  );
5669
- const [shouldShowClearButton, setShouldShowClearButton] = useState(
5670
- ((value ?? defaultValue)?.toString() ?? "").length > 0
5671
- );
5672
- useEffect(() => {
5673
- if (inputEl && showClearButton === "auto" && value === void 0) {
5674
- const observer = new MutationObserver((mutations) => {
5675
- setShouldShowClearButton(
5676
- mutations[0].target.value.length > 0
5677
- );
5678
- });
5679
- observer.observe(inputEl, { attributeFilter: ["value"] });
5680
- return () => observer.disconnect();
5681
- }
5682
- }, [inputEl, showClearButton, value]);
5683
5712
  const handleClearButtonClick = useCallback(() => {
5684
- if (inputEl) {
5685
- setNativeValue(inputEl, "");
5686
- const changeEvent = new Event("input", { bubbles: true });
5687
- inputEl.dispatchEvent(changeEvent);
5688
- if (!changeEvent.defaultPrevented) {
5689
- onValueChange?.("");
5713
+ if (inputEl && inputEl.value !== "") {
5714
+ setNativeProperty(inputEl, "value", "");
5715
+ const event = new Event(inputEl.type === "file" ? "change" : "input", {
5716
+ bubbles: true,
5717
+ cancelable: true
5718
+ });
5719
+ inputEl.dispatchEvent(event);
5720
+ if (!event.defaultPrevented) {
5690
5721
  inputEl.focus();
5691
5722
  }
5692
5723
  }
5693
- }, [inputEl, onValueChange]);
5694
- const hasClearButton = !disabled && !readOnly && (showClearButton === true || showClearButton === "auto" && (value !== void 0 ? (value?.toString() ?? "")?.length > 0 : shouldShowClearButton));
5724
+ }, [inputEl]);
5725
+ const hasClearButton = !disabled && !loading && !readOnly && (showClearButton === true || showClearButton === "auto" && (isControlled ? (value?.toString() ?? "")?.length > 0 : shouldShowClearButton));
5695
5726
  const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(
5696
5727
  "control",
5697
5728
  { align }
5698
5729
  );
5699
- const requirable = inputEl && REQUIRABLE_CONTROLS.includes(inputEl.tagName);
5700
- const As = asChild ? Slot : "input";
5730
+ const supportsRequired = Boolean(
5731
+ tagName && REQUIRED_TAGS.includes(tagName)
5732
+ );
5733
+ const supportsReadOnly = Boolean(
5734
+ tagName && READ_ONLY_TAGS.includes(tagName) && (!type || !NON_READONLY_INPUT_TYPES.includes(type))
5735
+ );
5736
+ const combinedLabelIds = combineAriaIds(
5737
+ codeId,
5738
+ labelId ?? dataTableColumnLabelId
5739
+ );
5701
5740
  const combinedContainerRef = useCombinedRef(
5702
5741
  containerRef,
5703
5742
  containerProps?.ref
@@ -5707,144 +5746,140 @@ const Input = forwardRef(
5707
5746
  clearButtonRef,
5708
5747
  clearButtonProps?.ref
5709
5748
  );
5710
- return /* @__PURE__ */ jsx(ClearContexts, { field: false, children: /* @__PURE__ */ jsx(
5711
- ControlContext.Provider,
5712
- {
5713
- value: { variant, status, disabled, readOnly },
5714
- children: /* @__PURE__ */ jsxs(
5715
- "div",
5716
- {
5717
- "data-status": status,
5718
- "data-accent": controlStatusToAccent(status),
5719
- "data-variant": variant,
5720
- "data-disabled": boolDataAttr(disabled),
5721
- "data-readonly": boolDataAttr(readOnly),
5722
- ...rootProps,
5723
- className: cx(prefix("input__root"), rootProps?.className),
5724
- children: [
5725
- code && /* @__PURE__ */ jsx(
5726
- ControlCode,
5727
- {
5728
- ...codeProps,
5729
- id: codeId,
5730
- className: cx(prefix("input__code"), codeProps?.className),
5731
- children: code
5732
- }
5733
- ),
5734
- /* @__PURE__ */ jsxs(
5735
- "div",
5736
- {
5737
- "data-status": status,
5738
- "data-accent": controlStatusToAccent(status),
5739
- "data-variant": variant,
5740
- "data-disabled": boolDataAttr(disabled),
5741
- "data-readonly": boolDataAttr(readOnly),
5742
- ...containerProps,
5743
- className: cx(
5744
- prefix("input__container"),
5745
- containerProps?.className
5746
- ),
5747
- onPointerDown: combineEventHandlers(
5748
- containerProps?.onPointerDown,
5749
- handleContainerPointerDown,
5750
- { checkDefaultPrevented: true }
5751
- ),
5752
- ref: combinedContainerRef,
5753
- children: [
5754
- startAdornment,
5755
- /* @__PURE__ */ jsx(
5756
- As,
5757
- {
5758
- type,
5759
- defaultValue,
5760
- value,
5761
- id: controlId,
5762
- className: cx(prefix("input"), className),
5763
- required,
5764
- disabled,
5765
- readOnly,
5766
- onInput: combineEventHandlers(onChange, handleChange, {
5767
- checkDefaultPrevented: true
5768
- }),
5769
- onFocus: combineEventHandlers(onFocus, handleControlFocus, {
5770
- checkDefaultPrevented: true
5771
- }),
5772
- onBlur: combineEventHandlers(onBlur, handleControlBlur, {
5773
- checkDefaultPrevented: true
5774
- }),
5775
- onClick: combineEventHandlers(onClick, handleClick, {
5776
- checkDefaultPrevented: true
5777
- }),
5778
- style: { ...cssVars, ...style },
5779
- ...dataAttrs,
5780
- "data-status": status,
5781
- "data-accent": controlStatusToAccent(status),
5782
- "data-variant": variant,
5783
- "aria-required": required && !requirable ? "true" : void 0,
5784
- "aria-invalid": status === "invalid" ? "true" : void 0,
5785
- "aria-labelledby": mergeAriaIds(
5786
- dataTableColumnLabelId,
5787
- ariaLabelledBy
5788
- ),
5789
- "aria-describedby": mergeAriaIds(
5790
- code && codeId,
5791
- errorMessageIds,
5792
- descriptionIds,
5793
- ariaDescribedBy
5794
- ),
5795
- ...otherProps,
5796
- ref: combinedInputRef
5797
- }
5798
- ),
5799
- hasClearButton && /* @__PURE__ */ jsx(
5800
- CloseButton,
5801
- {
5802
- size: "sm",
5803
- label: clearButtonLabel,
5804
- tabIndex: -1,
5805
- ...clearButtonProps,
5806
- className: cx(
5807
- prefix("input__clear-button"),
5808
- printHidden,
5809
- clearButtonProps?.className
5810
- ),
5811
- onClick: combineEventHandlers(
5812
- clearButtonProps?.onClick,
5813
- handleClearButtonClick,
5814
- { checkDefaultPrevented: true }
5815
- ),
5816
- onFocus: combineEventHandlers(
5817
- clearButtonProps?.onFocus,
5818
- handleControlFocus
5819
- ),
5820
- onBlur: combineEventHandlers(
5821
- clearButtonProps?.onBlur,
5822
- handleControlBlur
5823
- ),
5824
- ref: combinedClearButtonRef
5825
- }
5749
+ const As = asChild ? Slot : "input";
5750
+ return /* @__PURE__ */ jsxs(ClearContexts, { field: false, children: [
5751
+ /* @__PURE__ */ jsx(
5752
+ ControlContext.Provider,
5753
+ {
5754
+ value: { variant, status, disabled, loading, readOnly },
5755
+ children: /* @__PURE__ */ jsxs(
5756
+ "div",
5757
+ {
5758
+ "data-status": status,
5759
+ "data-accent": controlStatusToAccent(status),
5760
+ "data-variant": variant,
5761
+ "data-disabled": boolDataAttr(disabled || loading),
5762
+ "data-readonly": boolDataAttr(readOnly),
5763
+ ...rootProps,
5764
+ className: cx(prefix("input__root"), rootProps?.className),
5765
+ children: [
5766
+ codeId && /* @__PURE__ */ jsx(
5767
+ ControlCode,
5768
+ {
5769
+ ...codeProps,
5770
+ id: codeId,
5771
+ className: cx(prefix("input__code"), codeProps?.className),
5772
+ children: code
5773
+ }
5774
+ ),
5775
+ /* @__PURE__ */ jsxs(
5776
+ "div",
5777
+ {
5778
+ "data-status": status,
5779
+ "data-accent": controlStatusToAccent(status),
5780
+ "data-variant": variant,
5781
+ "data-disabled": boolDataAttr(disabled || loading),
5782
+ "data-readonly": boolDataAttr(readOnly),
5783
+ ...containerProps,
5784
+ className: cx(
5785
+ prefix("input__container"),
5786
+ containerProps?.className
5826
5787
  ),
5827
- loading && /* @__PURE__ */ jsx(
5828
- Spinner,
5829
- {
5830
- color: controlStatusToAccent(status, "neutral"),
5831
- "data-disabled": boolDataAttr(disabled),
5832
- ...spinnerProps,
5833
- className: cx(
5834
- prefix("input__spinner"),
5835
- spinnerProps?.className
5836
- )
5837
- }
5788
+ onPointerDown: combineEventHandlers(
5789
+ containerProps?.onPointerDown,
5790
+ handleContainerPointerDown,
5791
+ { checkDefaultPrevented: true }
5838
5792
  ),
5839
- endAdornment
5840
- ]
5841
- }
5842
- )
5843
- ]
5844
- }
5845
- )
5846
- }
5847
- ) });
5793
+ ref: combinedContainerRef,
5794
+ children: [
5795
+ startAdornment,
5796
+ /* @__PURE__ */ jsx(
5797
+ As,
5798
+ {
5799
+ type,
5800
+ defaultValue,
5801
+ value,
5802
+ id: controlId,
5803
+ className: cx(prefix("input"), className),
5804
+ required: required && supportsRequired,
5805
+ disabled,
5806
+ readOnly: (readOnly || loading) && supportsReadOnly,
5807
+ onChange: combineEventHandlers(onChange, handleChange),
5808
+ onFocus: combineEventHandlers(onFocus, handleControlFocus),
5809
+ onBlur: combineEventHandlers(onBlur, handleControlBlur),
5810
+ onClick: combineEventHandlers(onClick, handleClick),
5811
+ style: { ...cssVars, ...style },
5812
+ ...dataAttrs,
5813
+ "data-loading": loading,
5814
+ "data-status": status,
5815
+ "data-accent": controlStatusToAccent(status),
5816
+ "data-variant": variant,
5817
+ "aria-disabled": (readOnly || loading) && !supportsReadOnly || void 0,
5818
+ "aria-required": required && !supportsRequired || void 0,
5819
+ "aria-invalid": status === "invalid" || void 0,
5820
+ "aria-label": ariaLabel,
5821
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel === void 0 && combinedLabelIds !== labelId ? combinedLabelIds : void 0),
5822
+ "aria-describedby": combineAriaIds(
5823
+ loadingDescriptionId,
5824
+ errorMessageIds,
5825
+ ariaDescribedBy,
5826
+ descriptionIds
5827
+ ),
5828
+ ...otherProps,
5829
+ ref: combinedInputRef
5830
+ }
5831
+ ),
5832
+ hasClearButton && /* @__PURE__ */ jsx(
5833
+ CloseButton,
5834
+ {
5835
+ size: "sm",
5836
+ label: clearButtonLabel,
5837
+ tabIndex: -1,
5838
+ ...clearButtonProps,
5839
+ className: cx(
5840
+ prefix("input__clear-button"),
5841
+ printHidden,
5842
+ clearButtonProps?.className
5843
+ ),
5844
+ onClick: combineEventHandlers(
5845
+ clearButtonProps?.onClick,
5846
+ handleClearButtonClick,
5847
+ { checkDefaultPrevented: true }
5848
+ ),
5849
+ onFocus: combineEventHandlers(
5850
+ clearButtonProps?.onFocus,
5851
+ handleControlFocus
5852
+ ),
5853
+ onBlur: combineEventHandlers(
5854
+ clearButtonProps?.onBlur,
5855
+ handleControlBlur
5856
+ ),
5857
+ ref: combinedClearButtonRef
5858
+ }
5859
+ ),
5860
+ showSpinner && /* @__PURE__ */ jsx(
5861
+ Spinner,
5862
+ {
5863
+ color: controlStatusToAccent(status, "neutral"),
5864
+ "data-disabled": boolDataAttr(disabled || loading),
5865
+ ...spinnerProps,
5866
+ className: cx(
5867
+ prefix("input__spinner"),
5868
+ spinnerProps?.className
5869
+ )
5870
+ }
5871
+ ),
5872
+ endAdornment
5873
+ ]
5874
+ }
5875
+ )
5876
+ ]
5877
+ }
5878
+ )
5879
+ }
5880
+ ),
5881
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
5882
+ ] });
5848
5883
  }
5849
5884
  );
5850
5885
  const InputWithContainerRef = forwardRef(function InputWithContainerRef2({ inputRef, containerProps, ...otherProps }, forwardedRef) {
@@ -5949,8 +5984,8 @@ const MenuListItem = forwardRef(
5949
5984
  color,
5950
5985
  disabled,
5951
5986
  loading,
5952
- enabledWhenLoading,
5953
5987
  loadingContent,
5988
+ showSpinner = loading,
5954
5989
  icon = null,
5955
5990
  iconPlacement,
5956
5991
  href,
@@ -5969,59 +6004,56 @@ const MenuListItem = forwardRef(
5969
6004
  const variant = menuListContext.variant;
5970
6005
  iconPlacement ??= menuListContext.iconPlacement;
5971
6006
  const handleSelect = useCallback(
5972
- (event) => {
5973
- if (!disabled) {
5974
- onSelect?.(event);
6007
+ (evt) => {
6008
+ if (disabled || loading) {
6009
+ evt.preventDefault();
6010
+ return;
5975
6011
  }
6012
+ onSelect?.(evt);
5976
6013
  },
5977
- [disabled, onSelect]
6014
+ [disabled, loading, onSelect]
5978
6015
  );
5979
- const iconEl = useMemo(
5980
- () => icon && /* @__PURE__ */ jsx(
5981
- Slot,
5982
- {
5983
- className: cx(
5984
- prefix("menu-list__item-icon"),
5985
- prefix(`menu-list__item-icon--${iconPlacement}`),
5986
- iconProps?.className
5987
- ),
5988
- children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, ...iconProps })
5989
- }
5990
- ),
5991
- [icon, iconPlacement, iconProps, prefix]
6016
+ const iconEl = icon && !showSpinner && /* @__PURE__ */ jsx(
6017
+ Slot,
6018
+ {
6019
+ className: cx(
6020
+ prefix("menu-list__item-icon"),
6021
+ prefix(`menu-list__item-icon--${iconPlacement}`),
6022
+ iconProps?.className
6023
+ ),
6024
+ children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, ...iconProps })
6025
+ }
5992
6026
  );
5993
- const spinnerEl = useMemo(
5994
- () => /* @__PURE__ */ jsx(
5995
- Spinner,
5996
- {
5997
- ...spinnerProps,
5998
- className: cx(
5999
- prefix("menu-list__item-spinner"),
6000
- prefix(`menu-list__item-spinner--${iconPlacement}`),
6001
- spinnerProps?.className
6002
- )
6003
- }
6004
- ),
6005
- [iconPlacement, prefix, spinnerProps]
6027
+ const spinnerEl = showSpinner && /* @__PURE__ */ jsx(
6028
+ Spinner,
6029
+ {
6030
+ ...spinnerProps,
6031
+ className: cx(
6032
+ prefix("menu-list__item-spinner"),
6033
+ prefix(`menu-list__item-spinner--${iconPlacement}`),
6034
+ spinnerProps?.className
6035
+ )
6036
+ }
6006
6037
  );
6007
- const shouldDisable = disabled || loading && !enabledWhenLoading;
6008
6038
  const Action = type === "button" ? "button" : type === "link" ? "a" : "div";
6009
6039
  const actionEl = /* @__PURE__ */ jsxs(
6010
6040
  Action,
6011
6041
  {
6012
6042
  type: type === "button" ? "button" : void 0,
6013
- disabled: type === "button" ? shouldDisable : void 0,
6014
- "data-disabled": boolDataAttr(type !== "button" && shouldDisable),
6015
- "aria-disabled": type !== "button" && shouldDisable ? "true" : void 0,
6043
+ disabled: type === "button" ? disabled : void 0,
6044
+ "data-disabled": boolDataAttr(type !== "button" && disabled),
6045
+ "aria-disabled": type !== "button" && disabled || loading || void 0,
6046
+ "data-loading": boolDataAttr(loading),
6016
6047
  "data-selected": boolDataAttr(selected),
6017
6048
  "data-accent": color,
6018
6049
  href,
6019
6050
  target,
6020
6051
  rel,
6052
+ tabIndex: type === "link" && disabled ? -1 : void 0,
6021
6053
  ...actionProps,
6022
6054
  onClick: combineEventHandlers(
6023
- actionProps?.onClick,
6024
6055
  handleSelect,
6056
+ actionProps?.onClick,
6025
6057
  { checkDefaultPrevented: true }
6026
6058
  ),
6027
6059
  className: cx(
@@ -6030,8 +6062,8 @@ const MenuListItem = forwardRef(
6030
6062
  actionProps?.className
6031
6063
  ),
6032
6064
  children: [
6033
- loading && iconPlacement === "start" && spinnerEl,
6034
- !loading && iconPlacement === "start" && iconEl,
6065
+ iconPlacement === "start" && spinnerEl,
6066
+ iconPlacement === "start" && iconEl,
6035
6067
  /* @__PURE__ */ jsx(
6036
6068
  "span",
6037
6069
  {
@@ -6043,8 +6075,8 @@ const MenuListItem = forwardRef(
6043
6075
  children: loading && loadingContent ? loadingContent : asChild ? children.props.children : children
6044
6076
  }
6045
6077
  ),
6046
- !loading && iconPlacement === "end" && iconEl,
6047
- loading && iconPlacement === "end" && spinnerEl
6078
+ iconPlacement === "end" && iconEl,
6079
+ iconPlacement === "end" && spinnerEl
6048
6080
  ]
6049
6081
  }
6050
6082
  );
@@ -6290,8 +6322,8 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6290
6322
  color,
6291
6323
  disabled,
6292
6324
  loading,
6293
- enabledWhenLoading,
6294
6325
  loadingContent,
6326
+ showSpinner,
6295
6327
  icon,
6296
6328
  iconPlacement,
6297
6329
  href,
@@ -6307,11 +6339,17 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6307
6339
  ...otherProps
6308
6340
  }, forwardedRef) {
6309
6341
  const prefix = usePrefix();
6310
- const handleSelect = useCallback(() => {
6311
- if (asLink) {
6312
- window.open(href, target, rel?.split(" ").join(","));
6313
- }
6314
- }, [asLink, href, rel, target]);
6342
+ const handleSelect = useCallback(
6343
+ (value) => {
6344
+ if (!loading) {
6345
+ onSelect?.(value);
6346
+ if (asLink) {
6347
+ window.open(href, target, rel?.split(" ").join(","));
6348
+ }
6349
+ }
6350
+ },
6351
+ [asLink, href, loading, onSelect, rel, target]
6352
+ );
6315
6353
  return /* @__PURE__ */ jsx(
6316
6354
  MenuListItem,
6317
6355
  {
@@ -6320,8 +6358,8 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6320
6358
  color,
6321
6359
  disabled,
6322
6360
  loading,
6323
- enabledWhenLoading,
6324
6361
  loadingContent,
6362
+ showSpinner,
6325
6363
  icon,
6326
6364
  iconPlacement,
6327
6365
  href,
@@ -6342,10 +6380,10 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6342
6380
  children: /* @__PURE__ */ jsx(
6343
6381
  Command.Item,
6344
6382
  {
6345
- disabled: disabled || loading && !enabledWhenLoading,
6383
+ disabled,
6346
6384
  ...otherProps,
6347
6385
  keywords: typeof children === "string" ? [children, ...keywords ?? []] : keywords,
6348
- onSelect: combineEventHandlers(onSelect, handleSelect),
6386
+ onSelect: handleSelect,
6349
6387
  className: cx(prefix("command-menu__item"), className),
6350
6388
  ref: forwardedRef,
6351
6389
  children
@@ -6666,7 +6704,7 @@ function SelectMultipleValue() {
6666
6704
  ),
6667
6705
  ...valueTagProps?.contentProps
6668
6706
  },
6669
- "aria-hidden": "true"
6707
+ "aria-hidden": true
6670
6708
  },
6671
6709
  optionState.content
6672
6710
  );
@@ -6713,6 +6751,7 @@ const Select = forwardRef(function Select2({
6713
6751
  readOnly,
6714
6752
  required,
6715
6753
  loading,
6754
+ loadingDescription,
6716
6755
  variant,
6717
6756
  status,
6718
6757
  code,
@@ -6723,6 +6762,7 @@ const Select = forwardRef(function Select2({
6723
6762
  loadingOptions,
6724
6763
  loadingOptionsLabel,
6725
6764
  loadingOptionsProgress,
6765
+ showSpinner = loading || loadingOptions,
6726
6766
  emptyMessage,
6727
6767
  valueTagMaxWidth,
6728
6768
  onKeyDown,
@@ -6775,11 +6815,11 @@ const Select = forwardRef(function Select2({
6775
6815
  evt.preventDefault();
6776
6816
  const buttonEl = buttonRef.current;
6777
6817
  const target = evt.target;
6778
- if (buttonEl && !disabled && !target.closest("input, select, textarea, button, a")) {
6818
+ if (buttonEl && !disabled && !loading && !target.closest("input, select, textarea, button, a")) {
6779
6819
  setOpen((open2) => !open2);
6780
6820
  }
6781
6821
  },
6782
- [disabled, setOpen]
6822
+ [disabled, loading, setOpen]
6783
6823
  );
6784
6824
  const handleOptionSelect = useCallback(
6785
6825
  (optionValue) => {
@@ -6844,7 +6884,7 @@ const Select = forwardRef(function Select2({
6844
6884
  value: actualValue,
6845
6885
  onOptionSelect: handleOptionSelect,
6846
6886
  status,
6847
- disabled,
6887
+ disabled: disabled || loading,
6848
6888
  readOnly,
6849
6889
  valueTagProps
6850
6890
  });
@@ -6852,7 +6892,7 @@ const Select = forwardRef(function Select2({
6852
6892
  () => ({ registering: true, ...selectContext }),
6853
6893
  [selectContext]
6854
6894
  );
6855
- const showOpen = open && !disabled && !readOnly;
6895
+ const showOpen = open && !disabled && !loading && !readOnly;
6856
6896
  const combinedClearButtonRef = useCombinedRef(
6857
6897
  clearButtonRef,
6858
6898
  clearButtonProps?.ref
@@ -6895,7 +6935,9 @@ const Select = forwardRef(function Select2({
6895
6935
  disabled,
6896
6936
  readOnly,
6897
6937
  required,
6898
- loading: loading || loadingOptions,
6938
+ loading,
6939
+ loadingDescription,
6940
+ showSpinner,
6899
6941
  startAdornment,
6900
6942
  endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
6901
6943
  !readOnly && /* @__PURE__ */ jsx(
@@ -6908,7 +6950,7 @@ const Select = forwardRef(function Select2({
6908
6950
  arrowProps?.className
6909
6951
  ),
6910
6952
  "data-status": status,
6911
- "data-disabled": disabled
6953
+ "data-disabled": disabled || loading
6912
6954
  }
6913
6955
  ),
6914
6956
  endAdornment
@@ -6947,7 +6989,6 @@ const Select = forwardRef(function Select2({
6947
6989
  ...spinnerProps,
6948
6990
  className: cx(prefix("select__spinner"), spinnerProps?.className)
6949
6991
  },
6950
- "aria-readonly": readOnly ? "true" : void 0,
6951
6992
  "data-placeholder": boolDataAttr(isEmpty),
6952
6993
  children: /* @__PURE__ */ jsx("button", { ref: combinedButtonRef, children: /* @__PURE__ */ jsxs(
6953
6994
  "span",
@@ -7420,6 +7461,8 @@ const CheckboxGroup = forwardRef(function CheckboxGroup2({
7420
7461
  code,
7421
7462
  name,
7422
7463
  loading,
7464
+ loadingDescription,
7465
+ showSpinner = loading,
7423
7466
  required,
7424
7467
  disabled = false,
7425
7468
  readOnly = false,
@@ -7438,22 +7481,26 @@ const CheckboxGroup = forwardRef(function CheckboxGroup2({
7438
7481
  onMouseDown,
7439
7482
  tabIndex: controlledTabIndex,
7440
7483
  children,
7484
+ "aria-label": ariaLabel,
7441
7485
  "aria-labelledby": ariaLabelledBy,
7442
7486
  "aria-describedby": ariaDescribedBy,
7443
7487
  ...otherProps
7444
7488
  }, forwardedRef) {
7445
7489
  const prefix = usePrefix();
7490
+ const [locale7] = useLocale();
7491
+ loadingDescription ??= locale7.Input.loadingDescription;
7446
7492
  const labelId = useFieldLabelId();
7447
7493
  const dataTableColumnLabelId = useDataTableColumnLabelId();
7448
7494
  const descriptionIds = useFieldDescriptionIds();
7449
7495
  const errorMessageIds = useFieldErrorMessageIds();
7450
- const { controlId, codeId } = useSetFieldControl(
7496
+ const { generatedId, controlId, codeId } = useSetFieldControl(
7451
7497
  id,
7452
7498
  "DIV",
7453
7499
  codeProps?.id,
7454
- !!code,
7500
+ Boolean(code),
7455
7501
  required
7456
7502
  );
7503
+ const loadingDescriptionId = loading && loadingDescription ? prefix(`control-loading-${generatedId}`) : void 0;
7457
7504
  const checkboxGroupRef = useRef(null);
7458
7505
  const isInTableCell = useIsInTableCell();
7459
7506
  inline ??= isInTableCell;
@@ -7512,101 +7559,107 @@ const CheckboxGroup = forwardRef(function CheckboxGroup2({
7512
7559
  checkboxGroupRef,
7513
7560
  forwardedRef
7514
7561
  );
7515
- return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(ControlContext.Provider, { value: { variant, status, disabled, readOnly }, children: /* @__PURE__ */ jsx(
7516
- CheckboxGroupContext.Provider,
7562
+ return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(
7563
+ ControlContext.Provider,
7517
7564
  {
7518
- value: { name, value, onCheckedChange: handleCheckedChange },
7519
- children: /* @__PURE__ */ jsxs(
7520
- "div",
7565
+ value: { variant, status, disabled, loading, readOnly },
7566
+ children: /* @__PURE__ */ jsx(
7567
+ CheckboxGroupContext.Provider,
7521
7568
  {
7522
- role: "group",
7523
- id: controlId,
7524
- ...otherProps,
7525
- "data-status": status,
7526
- "data-accent": controlStatusToAccent(status),
7527
- "data-variant": variant,
7528
- className: cx(
7529
- prefix("checkbox-group"),
7530
- inline && prefix("checkbox-group--inline"),
7531
- className
7532
- ),
7533
- onMouseDown: combineEventHandlers(onMouseDown, handleMouseDown),
7534
- onFocus: combineEventHandlers(onFocus, handleFocus),
7535
- onBlur: combineEventHandlers(onBlur, handleBlur),
7536
- "aria-readonly": readOnly ? "true" : void 0,
7537
- "aria-labelledby": mergeAriaIds(
7538
- dataTableColumnLabelId,
7539
- labelId,
7540
- ariaLabelledBy
7541
- ),
7542
- "aria-describedby": mergeAriaIds(
7543
- codeId,
7544
- descriptionIds,
7569
+ value: {
7570
+ name,
7571
+ value,
7572
+ onCheckedChange: handleCheckedChange,
7573
+ loadingDescriptionId,
7545
7574
  errorMessageIds,
7546
- ariaDescribedBy
7547
- ),
7548
- tabIndex,
7549
- ref: combinedCheckboxGroupRef,
7550
- children: [
7551
- code && /* @__PURE__ */ jsx(
7552
- ControlCode,
7553
- {
7554
- status,
7555
- ...codeProps,
7556
- id: codeId,
7557
- className: cx(
7558
- prefix("checkbox-group__code"),
7559
- codeProps?.className
7575
+ ariaDescribedBy,
7576
+ descriptionIds
7577
+ },
7578
+ children: /* @__PURE__ */ jsxs(
7579
+ "div",
7580
+ {
7581
+ role: "group",
7582
+ id: controlId,
7583
+ ...otherProps,
7584
+ "data-status": status,
7585
+ "data-accent": controlStatusToAccent(status),
7586
+ "data-variant": variant,
7587
+ className: cx(
7588
+ prefix("checkbox-group"),
7589
+ inline && prefix("checkbox-group--inline"),
7590
+ className
7591
+ ),
7592
+ onMouseDown: combineEventHandlers(onMouseDown, handleMouseDown),
7593
+ onFocus: combineEventHandlers(onFocus, handleFocus),
7594
+ onBlur: combineEventHandlers(onBlur, handleBlur),
7595
+ "aria-disabled": loading || readOnly || void 0,
7596
+ "aria-label": ariaLabel,
7597
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel === void 0 ? combineAriaIds(codeId, labelId ?? dataTableColumnLabelId) : void 0),
7598
+ tabIndex,
7599
+ ref: combinedCheckboxGroupRef,
7600
+ children: [
7601
+ code && /* @__PURE__ */ jsx(
7602
+ ControlCode,
7603
+ {
7604
+ status,
7605
+ ...codeProps,
7606
+ id: codeId,
7607
+ className: cx(
7608
+ prefix("checkbox-group__code"),
7609
+ codeProps?.className
7610
+ ),
7611
+ children: code
7612
+ }
7560
7613
  ),
7561
- children: code
7562
- }
7563
- ),
7564
- /* @__PURE__ */ jsx(
7565
- "div",
7566
- {
7567
- "data-status": status,
7568
- "data-variant": variant,
7569
- "data-disabled": boolDataAttr(disabled),
7570
- "data-readonly": boolDataAttr(readOnly),
7571
- ...containerProps,
7572
- className: cx(
7573
- prefix("checkbox-group__container"),
7574
- containerProps?.className
7575
- ),
7576
- children: /* @__PURE__ */ jsx(ClearContexts, { children })
7577
- }
7578
- ),
7579
- loading && /* @__PURE__ */ jsx(
7580
- "div",
7581
- {
7582
- "data-status": status,
7583
- "data-variant": variant,
7584
- "data-disabled": boolDataAttr(disabled),
7585
- "data-readonly": boolDataAttr(readOnly),
7586
- ...endContainerProps,
7587
- className: cx(
7588
- prefix("checkbox-group__end-container"),
7589
- endContainerProps?.className
7614
+ /* @__PURE__ */ jsx(
7615
+ "div",
7616
+ {
7617
+ "data-status": status,
7618
+ "data-variant": variant,
7619
+ "data-disabled": boolDataAttr(disabled || loading),
7620
+ "data-readonly": boolDataAttr(readOnly),
7621
+ ...containerProps,
7622
+ className: cx(
7623
+ prefix("checkbox-group__container"),
7624
+ containerProps?.className
7625
+ ),
7626
+ children: /* @__PURE__ */ jsx(ClearContexts, { children })
7627
+ }
7590
7628
  ),
7591
- children: /* @__PURE__ */ jsx(
7592
- Spinner,
7629
+ showSpinner && /* @__PURE__ */ jsx(
7630
+ "div",
7593
7631
  {
7594
- color: controlStatusToAccent(status, "neutral"),
7595
- "data-disabled": boolDataAttr(disabled),
7596
- ...spinnerProps,
7632
+ "data-status": status,
7633
+ "data-variant": variant,
7634
+ "data-disabled": boolDataAttr(disabled || loading),
7635
+ "data-readonly": boolDataAttr(readOnly),
7636
+ ...endContainerProps,
7597
7637
  className: cx(
7598
- prefix("checkbox-group__spinner"),
7599
- spinnerProps?.className
7638
+ prefix("checkbox-group__end-container"),
7639
+ endContainerProps?.className
7640
+ ),
7641
+ children: /* @__PURE__ */ jsx(
7642
+ Spinner,
7643
+ {
7644
+ color: controlStatusToAccent(status, "neutral"),
7645
+ "data-disabled": boolDataAttr(disabled || loading),
7646
+ ...spinnerProps,
7647
+ className: cx(
7648
+ prefix("checkbox-group__spinner"),
7649
+ spinnerProps?.className
7650
+ )
7651
+ }
7600
7652
  )
7601
7653
  }
7602
- )
7603
- }
7604
- )
7605
- ]
7654
+ ),
7655
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
7656
+ ]
7657
+ }
7658
+ )
7606
7659
  }
7607
7660
  )
7608
7661
  }
7609
- ) }) });
7662
+ ) });
7610
7663
  });
7611
7664
  const Container = forwardRef(
7612
7665
  function Container2({
@@ -7718,6 +7771,7 @@ const DateInput = forwardRef(
7718
7771
  onChange,
7719
7772
  onFocus,
7720
7773
  disabled,
7774
+ loading,
7721
7775
  readOnly,
7722
7776
  showClearButton = "auto",
7723
7777
  endAdornment,
@@ -7921,6 +7975,7 @@ const DateInput = forwardRef(
7921
7975
  value: formattedValue,
7922
7976
  placeholder,
7923
7977
  disabled,
7978
+ loading,
7924
7979
  readOnly,
7925
7980
  onChange: combineEventHandlers(onChange, handleInputChange),
7926
7981
  onFocus: combineEventHandlers(onFocus, handleInputFocus),
@@ -7934,7 +7989,7 @@ const DateInput = forwardRef(
7934
7989
  className: printHidden,
7935
7990
  "aria-label": calendarButtonLabel?.(
7936
7991
  fullFormattedValue,
7937
- !disabled && !readOnly
7992
+ !disabled && !loading && !readOnly
7938
7993
  ),
7939
7994
  onClick: handleAddonButtonClick,
7940
7995
  onBlur: handleControlBlur,
@@ -7944,7 +7999,7 @@ const DateInput = forwardRef(
7944
7999
  }
7945
8000
  ) }) })
7946
8001
  ] }),
7947
- "aria-describedby": mergeAriaIds(
8002
+ "aria-describedby": combineAriaIds(
7948
8003
  formatDescriptionId,
7949
8004
  ariaDescribedBy
7950
8005
  ),
@@ -8008,7 +8063,7 @@ const DateInput = forwardRef(
8008
8063
  ),
8009
8064
  month,
8010
8065
  onMonthChange: handleMonthChange,
8011
- disabled: disabled || readOnly || datePickerProps?.disabled,
8066
+ disabled: disabled || loading || readOnly || datePickerProps?.disabled,
8012
8067
  minDate,
8013
8068
  maxDate,
8014
8069
  minMonth,
@@ -8144,8 +8199,10 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8144
8199
  minYear,
8145
8200
  maxYear,
8146
8201
  loading,
8147
- startLoading = loading,
8148
- endLoading = loading,
8202
+ loadingDescription,
8203
+ showSpinners = loading,
8204
+ showStartSpinner = showSpinners,
8205
+ showEndSpinner = showSpinners,
8149
8206
  align,
8150
8207
  startAdornment,
8151
8208
  endAdornment,
@@ -8179,6 +8236,7 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8179
8236
  }, forwardedRef) {
8180
8237
  const prefix = usePrefix();
8181
8238
  const [locale7] = useLocale();
8239
+ loadingDescription ??= locale7.Input.loadingDescription;
8182
8240
  clearButtonsLabel ??= locale7.Input.clearButtonLabel;
8183
8241
  dateFnsLocale ??= locale7.dateFnsLocale;
8184
8242
  placeholder ??= locale7.DateInput.placeholder;
@@ -8196,17 +8254,17 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8196
8254
  const descriptionIds = useFieldDescriptionIds();
8197
8255
  const errorMessageIds = useFieldErrorMessageIds();
8198
8256
  const { printHidden } = usePrintClassNames();
8199
- const { controlId, codeId } = useSetFieldControl(
8257
+ const { generatedId, controlId, codeId } = useSetFieldControl(
8200
8258
  startInputProps?.id,
8201
8259
  "INPUT",
8202
8260
  codeProps?.id,
8203
- !!code,
8261
+ Boolean(code),
8204
8262
  required
8205
8263
  );
8206
8264
  const setFieldControlFocused = useSetFieldControlFocused();
8207
- const generatedId = useId();
8208
8265
  const startInputLabelId = startInputLabel && prefix(`control-start-label-${generatedId}`);
8209
8266
  const endInputLabelId = endInputLabel && prefix(`control-end-label-${generatedId}`);
8267
+ const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
8210
8268
  const formatDescriptionId = formatDescription && prefix(`control-format-${generatedId}`);
8211
8269
  const isInTableCell = useIsInTableCell();
8212
8270
  variant ??= isInTableCell ? "cell" : "default";
@@ -8385,10 +8443,14 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8385
8443
  );
8386
8444
  const handleClearButtonClick = useCallback(
8387
8445
  (ref) => () => {
8388
- if (ref.current) {
8389
- setNativeValue(ref.current, "");
8390
- ref.current.dispatchEvent(new Event("change", { bubbles: true }));
8391
- ref.current.focus();
8446
+ const inputEl = ref.current;
8447
+ if (inputEl && inputEl.value !== "") {
8448
+ setNativeProperty(inputEl, "value", "");
8449
+ const event = new Event("change", { bubbles: true, cancelable: true });
8450
+ inputEl.dispatchEvent(event);
8451
+ if (!event.defaultPrevented) {
8452
+ inputEl.focus();
8453
+ }
8392
8454
  }
8393
8455
  },
8394
8456
  []
@@ -8503,8 +8565,8 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8503
8565
  setFormattedValue
8504
8566
  ]
8505
8567
  );
8506
- const hasStartClearButton = !disabled && !startInputProps?.disabled && !readOnly && !startInputProps?.readOnly && (showClearButtons === true || showClearButtons === "auto" && formattedValue.start !== "");
8507
- const hasEndClearButton = !disabled && !endInputProps?.disabled && !readOnly && !endInputProps?.readOnly && (showClearButtons === true || showClearButtons === "auto" && formattedValue.end !== "");
8568
+ const hasStartClearButton = !disabled && !loading && !startInputProps?.disabled && !readOnly && !startInputProps?.readOnly && (showClearButtons === true || showClearButtons === "auto" && formattedValue.start !== "");
8569
+ const hasEndClearButton = !disabled && !loading && !endInputProps?.disabled && !readOnly && !endInputProps?.readOnly && (showClearButtons === true || showClearButtons === "auto" && formattedValue.end !== "");
8508
8570
  const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();
8509
8571
  const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(
8510
8572
  "control",
@@ -8538,373 +8600,393 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8538
8600
  popoverRef,
8539
8601
  popoverContentProps?.ref
8540
8602
  );
8541
- return /* @__PURE__ */ jsx(ClearContexts, { field: false, children: /* @__PURE__ */ jsx(ControlContext.Provider, { value: { variant, status, disabled, readOnly }, children: /* @__PURE__ */ jsxs(
8542
- "div",
8603
+ return /* @__PURE__ */ jsx(ClearContexts, { field: false, children: /* @__PURE__ */ jsx(
8604
+ ControlContext.Provider,
8543
8605
  {
8544
- "data-status": status,
8545
- "data-accent": controlStatusToAccent(status),
8546
- "data-variant": variant,
8547
- "data-disabled": boolDataAttr(disabled),
8548
- "data-readonly": boolDataAttr(readOnly),
8549
- className: cx(prefix("date-range-input__root"), className),
8550
- ...otherProps,
8551
- ref: forwardedRef,
8552
- children: [
8553
- startInputLabel && /* @__PURE__ */ jsx(VisuallyHidden, { id: startInputLabelId, children: startInputLabel }),
8554
- endInputLabel && /* @__PURE__ */ jsx(VisuallyHidden, { id: endInputLabelId, children: endInputLabel }),
8555
- formatDescription && /* @__PURE__ */ jsx(VisuallyHidden, { id: formatDescriptionId, children: formatDescription }),
8556
- code && /* @__PURE__ */ jsx(
8557
- ControlCode,
8558
- {
8559
- ...codeProps,
8560
- id: codeId,
8561
- className: cx(
8562
- prefix("date-range-input__code"),
8563
- codeProps?.className
8606
+ value: { variant, status, disabled, loading, readOnly },
8607
+ children: /* @__PURE__ */ jsxs(
8608
+ "div",
8609
+ {
8610
+ "data-status": status,
8611
+ "data-accent": controlStatusToAccent(status),
8612
+ "data-variant": variant,
8613
+ "data-disabled": boolDataAttr(
8614
+ disabled || loading || startInputProps?.disabled && endInputProps?.disabled
8615
+ ),
8616
+ "data-readonly": boolDataAttr(
8617
+ readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8618
+ ),
8619
+ className: cx(prefix("date-range-input__root"), className),
8620
+ ...otherProps,
8621
+ ref: forwardedRef,
8622
+ children: [
8623
+ startInputLabelId && /* @__PURE__ */ jsx(VisuallyHidden, { id: startInputLabelId, children: startInputLabel }),
8624
+ endInputLabelId && /* @__PURE__ */ jsx(VisuallyHidden, { id: endInputLabelId, children: endInputLabel }),
8625
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription }),
8626
+ formatDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: formatDescriptionId, children: formatDescription }),
8627
+ code && /* @__PURE__ */ jsx(
8628
+ ControlCode,
8629
+ {
8630
+ ...codeProps,
8631
+ id: codeId,
8632
+ className: cx(
8633
+ prefix("date-range-input__code"),
8634
+ codeProps?.className
8635
+ ),
8636
+ children: code
8637
+ }
8564
8638
  ),
8565
- children: code
8566
- }
8567
- ),
8568
- /* @__PURE__ */ jsxs(Popover, { open: popoverState.open, modal: popoverState.modal, children: [
8569
- /* @__PURE__ */ jsxs(
8570
- PopoverAnchor,
8571
- {
8572
- ...popoverAnchorProps,
8573
- className: cx(
8574
- prefix("date-range-input__container"),
8575
- prefix("date-range-input__popover-anchor"),
8576
- popoverAnchorProps?.className
8577
- ),
8578
- children: [
8579
- startAdornment,
8580
- /* @__PURE__ */ jsxs(
8581
- "div",
8582
- {
8583
- "data-focused": boolDataAttr(
8584
- !disabled && !startInputProps?.disabled && popoverState.open && selectionMode === "start"
8585
- ),
8586
- "data-status": status,
8587
- "data-accent": controlStatusToAccent(status),
8588
- "data-variant": variant,
8589
- "data-disabled": boolDataAttr(
8590
- disabled || startInputProps?.disabled && endInputProps?.disabled
8591
- ),
8592
- "data-readonly": boolDataAttr(
8593
- readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8594
- ),
8595
- ...startContainerProps,
8596
- className: cx(
8597
- prefix("date-range-input__container"),
8598
- prefix("date-range-input__container--start"),
8599
- startContainerProps?.className
8600
- ),
8601
- onPointerDown: combineEventHandlers(
8602
- startContainerProps?.onPointerDown,
8603
- handleContainerPointerDown("start")
8604
- ),
8605
- ref: combinedStartContainerRef,
8606
- children: [
8607
- /* @__PURE__ */ jsx(
8608
- "input",
8609
- {
8610
- ...startInputProps,
8611
- id: controlId,
8612
- "data-status": status,
8613
- "data-variant": variant,
8614
- className: cx(
8615
- prefix("date-range-input"),
8616
- prefix("date-range-input--start"),
8617
- startInputProps?.className
8618
- ),
8619
- value: formattedValue.start,
8620
- placeholder: startInputProps?.placeholder ?? startPlaceholder ?? placeholder,
8621
- required: required || startInputProps?.required,
8622
- disabled: disabled || startInputProps?.disabled,
8623
- readOnly: readOnly || startInputProps?.readOnly,
8624
- onChange: combineEventHandlers(
8625
- startInputProps?.onChange,
8626
- handleStartInputChange
8627
- ),
8628
- onFocus: combineEventHandlers(
8629
- startInputProps?.onFocus,
8630
- handleInputFocus("start")
8631
- ),
8632
- onBlur: combineEventHandlers(
8633
- startInputProps?.onBlur,
8634
- handleControlBlur
8635
- ),
8636
- style: { ...cssVars, ...startInputProps?.style },
8637
- ...dataAttrs,
8638
- "aria-invalid": status === "invalid" ? "true" : void 0,
8639
- "aria-labelledby": mergeAriaIds(
8640
- dataTableColumnLabelId,
8641
- labelId,
8642
- startInputLabelId,
8643
- startInputProps?.["aria-labelledby"]
8644
- ),
8645
- "aria-describedby": mergeAriaIds(
8646
- codeId,
8647
- errorMessageIds,
8648
- descriptionIds,
8649
- formatDescriptionId,
8650
- startInputProps?.["aria-describedby"]
8651
- ),
8652
- ref: combinedStartInputRef
8653
- }
8654
- ),
8655
- hasStartClearButton && /* @__PURE__ */ jsx(
8656
- CloseButton,
8657
- {
8658
- size: "sm",
8659
- label: clearButtonsLabel,
8660
- tabIndex: -1,
8661
- ...startClearButtonProps,
8662
- className: cx(
8663
- prefix("date-range-input__clear-button"),
8664
- prefix("date-range-input__clear-button--start"),
8665
- printHidden,
8666
- startClearButtonProps?.className
8667
- ),
8668
- onClick: combineEventHandlers(
8669
- startClearButtonProps?.onClick,
8670
- handleClearButtonClick(startInputRef),
8671
- { checkDefaultPrevented: true }
8639
+ /* @__PURE__ */ jsxs(Popover, { open: popoverState.open, modal: popoverState.modal, children: [
8640
+ /* @__PURE__ */ jsxs(
8641
+ PopoverAnchor,
8642
+ {
8643
+ "data-status": status,
8644
+ "data-accent": controlStatusToAccent(status),
8645
+ "data-variant": variant,
8646
+ "data-disabled": boolDataAttr(
8647
+ disabled || loading || startInputProps?.disabled && endInputProps?.disabled
8648
+ ),
8649
+ "data-readonly": boolDataAttr(
8650
+ readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8651
+ ),
8652
+ ...popoverAnchorProps,
8653
+ className: cx(
8654
+ prefix("date-range-input__container"),
8655
+ prefix("date-range-input__popover-anchor"),
8656
+ popoverAnchorProps?.className
8657
+ ),
8658
+ children: [
8659
+ startAdornment,
8660
+ /* @__PURE__ */ jsxs(
8661
+ "div",
8662
+ {
8663
+ "data-focused": boolDataAttr(
8664
+ !disabled && !startInputProps?.disabled && popoverState.open && selectionMode === "start"
8665
+ ),
8666
+ "data-status": status,
8667
+ "data-accent": controlStatusToAccent(status),
8668
+ "data-variant": variant,
8669
+ "data-disabled": boolDataAttr(
8670
+ disabled || loading || startInputProps?.disabled && endInputProps?.disabled
8671
+ ),
8672
+ "data-readonly": boolDataAttr(
8673
+ readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8674
+ ),
8675
+ ...startContainerProps,
8676
+ className: cx(
8677
+ prefix("date-range-input__container"),
8678
+ prefix("date-range-input__container--start"),
8679
+ startContainerProps?.className
8680
+ ),
8681
+ onPointerDown: combineEventHandlers(
8682
+ startContainerProps?.onPointerDown,
8683
+ handleContainerPointerDown("start")
8684
+ ),
8685
+ ref: combinedStartContainerRef,
8686
+ children: [
8687
+ /* @__PURE__ */ jsx(
8688
+ "input",
8689
+ {
8690
+ ...startInputProps,
8691
+ id: controlId,
8692
+ "data-loading": boolDataAttr(loading),
8693
+ "data-status": status,
8694
+ "data-variant": variant,
8695
+ className: cx(
8696
+ prefix("date-range-input"),
8697
+ prefix("date-range-input--start"),
8698
+ startInputProps?.className
8699
+ ),
8700
+ value: formattedValue.start,
8701
+ placeholder: startInputProps?.placeholder ?? startPlaceholder ?? placeholder,
8702
+ required: required || startInputProps?.required,
8703
+ disabled: disabled || startInputProps?.disabled,
8704
+ readOnly: readOnly || loading || startInputProps?.readOnly,
8705
+ onChange: combineEventHandlers(
8706
+ startInputProps?.onChange,
8707
+ handleStartInputChange
8708
+ ),
8709
+ onFocus: combineEventHandlers(
8710
+ startInputProps?.onFocus,
8711
+ handleInputFocus("start")
8712
+ ),
8713
+ onBlur: combineEventHandlers(
8714
+ startInputProps?.onBlur,
8715
+ handleControlBlur
8716
+ ),
8717
+ style: { ...cssVars, ...startInputProps?.style },
8718
+ ...dataAttrs,
8719
+ "aria-invalid": status === "invalid" || void 0,
8720
+ "aria-labelledby": startInputProps?.["aria-labelledby"] ?? (startInputProps?.["aria-label"] === void 0 ? combineAriaIds(
8721
+ codeId,
8722
+ labelId ?? dataTableColumnLabelId,
8723
+ startInputLabelId
8724
+ ) : void 0),
8725
+ "aria-describedby": combineAriaIds(
8726
+ loadingDescriptionId,
8727
+ errorMessageIds,
8728
+ startInputProps?.["aria-describedby"],
8729
+ formatDescriptionId,
8730
+ descriptionIds
8731
+ ),
8732
+ ref: combinedStartInputRef
8733
+ }
8672
8734
  ),
8673
- ref: combinedStartClearButtonRef
8674
- }
8675
- ),
8676
- startLoading && /* @__PURE__ */ jsx(
8677
- Spinner,
8678
- {
8679
- color: controlStatusToAccent(status, "neutral"),
8680
- "data-disabled": boolDataAttr(
8681
- disabled || startInputProps?.disabled
8735
+ hasStartClearButton && /* @__PURE__ */ jsx(
8736
+ CloseButton,
8737
+ {
8738
+ size: "sm",
8739
+ label: clearButtonsLabel,
8740
+ tabIndex: -1,
8741
+ ...startClearButtonProps,
8742
+ className: cx(
8743
+ prefix("date-range-input__clear-button"),
8744
+ prefix("date-range-input__clear-button--start"),
8745
+ printHidden,
8746
+ startClearButtonProps?.className
8747
+ ),
8748
+ onClick: combineEventHandlers(
8749
+ startClearButtonProps?.onClick,
8750
+ handleClearButtonClick(startInputRef),
8751
+ { checkDefaultPrevented: true }
8752
+ ),
8753
+ ref: combinedStartClearButtonRef
8754
+ }
8682
8755
  ),
8683
- ...spinnerProps,
8684
- className: cx(
8685
- prefix("date-range-input__spinner"),
8686
- prefix("date-range-input__spinner--start"),
8687
- spinnerProps?.className
8756
+ showStartSpinner && /* @__PURE__ */ jsx(
8757
+ Spinner,
8758
+ {
8759
+ color: controlStatusToAccent(status, "neutral"),
8760
+ "data-disabled": boolDataAttr(
8761
+ disabled || loading || startInputProps?.disabled
8762
+ ),
8763
+ ...spinnerProps,
8764
+ className: cx(
8765
+ prefix("date-range-input__spinner"),
8766
+ prefix("date-range-input__spinner--start"),
8767
+ spinnerProps?.className
8768
+ )
8769
+ }
8688
8770
  )
8689
- }
8690
- )
8691
- ]
8692
- }
8693
- ),
8694
- /* @__PURE__ */ jsx(ControlAddon, { className: cx(prefix("date-range-input__arrow")), children: /* @__PURE__ */ jsx(Icon, { icon: faArrowRight }) }),
8695
- /* @__PURE__ */ jsxs(
8696
- "div",
8697
- {
8698
- "data-focused": boolDataAttr(
8699
- !disabled && !endInputProps?.disabled && popoverState.open && selectionMode === "end"
8700
- ),
8701
- "data-status": status,
8702
- "data-accent": controlStatusToAccent(status),
8703
- "data-variant": variant,
8704
- "data-disabled": boolDataAttr(
8705
- disabled || startInputProps?.disabled && endInputProps?.disabled
8706
- ),
8707
- "data-readonly": boolDataAttr(
8708
- readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8709
- ),
8710
- ...endContainerProps,
8711
- className: cx(
8712
- prefix("date-range-input__container"),
8713
- prefix("date-range-input__container--end"),
8714
- endContainerProps?.className
8715
- ),
8716
- onPointerDown: combineEventHandlers(
8717
- endContainerProps?.onPointerDown,
8718
- handleContainerPointerDown("end")
8771
+ ]
8772
+ }
8719
8773
  ),
8720
- ref: combinedEndContainerRef,
8721
- children: [
8722
- /* @__PURE__ */ jsx(
8723
- "input",
8724
- {
8725
- ...endInputProps,
8726
- "data-status": status,
8727
- "data-variant": variant,
8728
- className: cx(
8729
- prefix("date-range-input"),
8730
- prefix("date-range-input--end"),
8731
- endInputProps?.className
8732
- ),
8733
- value: formattedValue.end,
8734
- placeholder: endInputProps?.placeholder ?? endPlaceholder ?? placeholder,
8735
- required: required || endInputProps?.required,
8736
- disabled: disabled || endInputProps?.disabled,
8737
- readOnly: readOnly || endInputProps?.readOnly,
8738
- onChange: combineEventHandlers(
8739
- endInputProps?.onChange,
8740
- handleEndInputChange
8741
- ),
8742
- onFocus: combineEventHandlers(
8743
- endInputProps?.onFocus,
8744
- handleInputFocus("end")
8745
- ),
8746
- onBlur: combineEventHandlers(
8747
- endInputProps?.onBlur,
8748
- handleControlBlur
8749
- ),
8750
- style: { ...cssVars, ...endInputProps?.style },
8751
- ...dataAttrs,
8752
- "aria-invalid": status === "invalid" ? "true" : void 0,
8753
- "aria-labelledby": mergeAriaIds(
8754
- dataTableColumnLabelId,
8755
- labelId,
8756
- endInputLabelId,
8757
- endInputProps?.["aria-labelledby"]
8758
- ),
8759
- "aria-describedby": mergeAriaIds(
8760
- codeId,
8761
- errorMessageIds,
8762
- descriptionIds,
8763
- formatDescriptionId,
8764
- endInputProps?.["aria-describedby"]
8765
- ),
8766
- ref: combinedEndInputRef
8767
- }
8768
- ),
8769
- hasEndClearButton && /* @__PURE__ */ jsx(
8770
- CloseButton,
8771
- {
8772
- size: "sm",
8773
- label: clearButtonsLabel,
8774
- tabIndex: -1,
8775
- ...endClearButtonProps,
8776
- className: cx(
8777
- prefix("date-range-input__clear-button"),
8778
- prefix("date-range-input__clear-button--end"),
8779
- printHidden,
8780
- endClearButtonProps?.className
8781
- ),
8782
- onClick: combineEventHandlers(
8783
- endClearButtonProps?.onClick,
8784
- handleClearButtonClick(endInputRef),
8785
- { checkDefaultPrevented: true }
8774
+ /* @__PURE__ */ jsx(ControlAddon, { className: cx(prefix("date-range-input__arrow")), children: /* @__PURE__ */ jsx(Icon, { icon: faArrowRight }) }),
8775
+ /* @__PURE__ */ jsxs(
8776
+ "div",
8777
+ {
8778
+ "data-focused": boolDataAttr(
8779
+ !disabled && !endInputProps?.disabled && popoverState.open && selectionMode === "end"
8780
+ ),
8781
+ "data-status": status,
8782
+ "data-accent": controlStatusToAccent(status),
8783
+ "data-variant": variant,
8784
+ "data-disabled": boolDataAttr(
8785
+ disabled || loading || startInputProps?.disabled && endInputProps?.disabled
8786
+ ),
8787
+ "data-readonly": boolDataAttr(
8788
+ readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8789
+ ),
8790
+ ...endContainerProps,
8791
+ className: cx(
8792
+ prefix("date-range-input__container"),
8793
+ prefix("date-range-input__container--end"),
8794
+ endContainerProps?.className
8795
+ ),
8796
+ onPointerDown: combineEventHandlers(
8797
+ endContainerProps?.onPointerDown,
8798
+ handleContainerPointerDown("end")
8799
+ ),
8800
+ ref: combinedEndContainerRef,
8801
+ children: [
8802
+ /* @__PURE__ */ jsx(
8803
+ "input",
8804
+ {
8805
+ ...endInputProps,
8806
+ "data-loading": boolDataAttr(loading),
8807
+ "data-status": status,
8808
+ "data-variant": variant,
8809
+ className: cx(
8810
+ prefix("date-range-input"),
8811
+ prefix("date-range-input--end"),
8812
+ endInputProps?.className
8813
+ ),
8814
+ value: formattedValue.end,
8815
+ placeholder: endInputProps?.placeholder ?? endPlaceholder ?? placeholder,
8816
+ required: required || endInputProps?.required,
8817
+ disabled: disabled || endInputProps?.disabled,
8818
+ readOnly: readOnly || loading || endInputProps?.readOnly,
8819
+ onChange: combineEventHandlers(
8820
+ endInputProps?.onChange,
8821
+ handleEndInputChange
8822
+ ),
8823
+ onFocus: combineEventHandlers(
8824
+ endInputProps?.onFocus,
8825
+ handleInputFocus("end")
8826
+ ),
8827
+ onBlur: combineEventHandlers(
8828
+ endInputProps?.onBlur,
8829
+ handleControlBlur
8830
+ ),
8831
+ style: { ...cssVars, ...endInputProps?.style },
8832
+ ...dataAttrs,
8833
+ "aria-invalid": status === "invalid" || void 0,
8834
+ "aria-labelledby": endInputProps?.["aria-labelledby"] ?? (endInputProps?.["aria-label"] === void 0 ? combineAriaIds(
8835
+ codeId,
8836
+ labelId ?? dataTableColumnLabelId,
8837
+ endInputLabelId
8838
+ ) : void 0),
8839
+ "aria-describedby": combineAriaIds(
8840
+ loadingDescriptionId,
8841
+ errorMessageIds,
8842
+ endInputProps?.["aria-describedby"],
8843
+ formatDescriptionId,
8844
+ descriptionIds
8845
+ ),
8846
+ ref: combinedEndInputRef
8847
+ }
8786
8848
  ),
8787
- ref: combinedEndClearButtonRef
8788
- }
8789
- ),
8790
- endLoading && /* @__PURE__ */ jsx(
8791
- Spinner,
8792
- {
8793
- color: controlStatusToAccent(status, "neutral"),
8794
- "data-disabled": boolDataAttr(
8795
- disabled || endInputProps?.disabled
8849
+ hasEndClearButton && /* @__PURE__ */ jsx(
8850
+ CloseButton,
8851
+ {
8852
+ size: "sm",
8853
+ label: clearButtonsLabel,
8854
+ tabIndex: -1,
8855
+ ...endClearButtonProps,
8856
+ className: cx(
8857
+ prefix("date-range-input__clear-button"),
8858
+ prefix("date-range-input__clear-button--end"),
8859
+ printHidden,
8860
+ endClearButtonProps?.className
8861
+ ),
8862
+ onClick: combineEventHandlers(
8863
+ endClearButtonProps?.onClick,
8864
+ handleClearButtonClick(endInputRef),
8865
+ { checkDefaultPrevented: true }
8866
+ ),
8867
+ ref: combinedEndClearButtonRef
8868
+ }
8796
8869
  ),
8797
- ...spinnerProps,
8798
- className: cx(
8799
- prefix("date-range-input__spinner"),
8800
- prefix("date-range-input__spinner--end"),
8801
- spinnerProps?.className
8870
+ showEndSpinner && /* @__PURE__ */ jsx(
8871
+ Spinner,
8872
+ {
8873
+ color: controlStatusToAccent(status, "neutral"),
8874
+ "data-disabled": boolDataAttr(
8875
+ disabled || loading || endInputProps?.disabled
8876
+ ),
8877
+ ...spinnerProps,
8878
+ className: cx(
8879
+ prefix("date-range-input__spinner"),
8880
+ prefix("date-range-input__spinner--end"),
8881
+ spinnerProps?.className
8882
+ )
8883
+ }
8802
8884
  )
8803
- }
8804
- )
8805
- ]
8806
- }
8807
- ),
8808
- endAdornment,
8809
- /* @__PURE__ */ jsx(ControlAddon, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(
8810
- "button",
8811
- {
8812
- "aria-label": calendarButtonLabel?.(
8813
- fullFormattedValue,
8814
- !disabled && !readOnly
8815
- ),
8816
- onClick: handleAddonButtonClick,
8817
- onBlur: handleControlBlur,
8818
- "data-state": void 0,
8819
- className: cx(
8820
- prefix("date-range-input__calendar-button"),
8821
- printHidden
8885
+ ]
8886
+ }
8822
8887
  ),
8823
- ref: addonButtonRef,
8824
- children: /* @__PURE__ */ jsx(Icon, { icon: faCalendar })
8825
- }
8826
- ) }) })
8827
- ]
8828
- }
8829
- ),
8830
- /* @__PURE__ */ jsx(
8831
- PopoverContent,
8832
- {
8833
- ...popoverContentProps,
8834
- className: cx(
8835
- prefix("date-range-input__popover"),
8836
- popoverContentProps?.className
8837
- ),
8838
- side: popoverContentProps?.side ?? "bottom",
8839
- sideOffset: popoverContentProps?.sideOffset ?? 5,
8840
- showArrow: popoverContentProps?.showArrow ?? false,
8841
- onOpenAutoFocus: combineEventHandlers(
8842
- popoverContentProps?.onOpenAutoFocus,
8843
- handlePopoverOpenAutoFocus
8844
- ),
8845
- onEscapeKeyDown: combineEventHandlers(
8846
- popoverContentProps?.onEscapeKeyDown,
8847
- handlePopoverEscapeKeyDown
8848
- ),
8849
- onPointerDownOutside: combineEventHandlers(
8850
- popoverContentProps?.onPointerDownOutside,
8851
- handlePopoverPointerDownOutside
8852
- ),
8853
- onInteractOutside: combineEventHandlers(
8854
- popoverContentProps?.onInteractOutside,
8855
- handlePopoverInteractOutside
8856
- ),
8857
- onBlur: combineEventHandlers(
8858
- popoverContentProps?.onBlur,
8859
- handleControlBlur
8888
+ endAdornment,
8889
+ /* @__PURE__ */ jsx(ControlAddon, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(
8890
+ "button",
8891
+ {
8892
+ "aria-label": calendarButtonLabel?.(
8893
+ fullFormattedValue,
8894
+ !disabled && !loading && !readOnly
8895
+ ),
8896
+ onClick: handleAddonButtonClick,
8897
+ onBlur: handleControlBlur,
8898
+ "data-state": void 0,
8899
+ className: cx(
8900
+ prefix("date-range-input__calendar-button"),
8901
+ printHidden
8902
+ ),
8903
+ ref: addonButtonRef,
8904
+ children: /* @__PURE__ */ jsx(Icon, { icon: faCalendar })
8905
+ }
8906
+ ) }) })
8907
+ ]
8908
+ }
8860
8909
  ),
8861
- ref: combinedPopoverRef,
8862
- children: /* @__PURE__ */ jsx(
8863
- DateRangePicker,
8910
+ /* @__PURE__ */ jsx(
8911
+ PopoverContent,
8864
8912
  {
8913
+ ...popoverContentProps,
8865
8914
  className: cx(
8866
- prefix("date-range-input__picker"),
8867
- dateRangePickerProps?.className
8915
+ prefix("date-range-input__popover"),
8916
+ popoverContentProps?.className
8868
8917
  ),
8869
- ...dateRangePickerProps,
8870
- value: deferredDateValue,
8871
- onChange: combineEventHandlers(
8872
- dateRangePickerProps?.onChange,
8873
- handleDatePickerChange
8918
+ side: popoverContentProps?.side ?? "bottom",
8919
+ sideOffset: popoverContentProps?.sideOffset ?? 5,
8920
+ showArrow: popoverContentProps?.showArrow ?? false,
8921
+ onOpenAutoFocus: combineEventHandlers(
8922
+ popoverContentProps?.onOpenAutoFocus,
8923
+ handlePopoverOpenAutoFocus
8874
8924
  ),
8875
- selectionMode,
8876
- month,
8877
- onMonthChange: handleMonthChange,
8878
- disabled: disabled || readOnly || (startInputProps?.disabled || startInputProps?.readOnly) && (endInputProps?.disabled || endInputProps?.readOnly) || dateRangePickerProps?.disabled,
8879
- minDate,
8880
- maxDate,
8881
- minMonth,
8882
- maxMonth,
8883
- minYear,
8884
- maxYear,
8885
- locale: dateFnsLocale,
8886
- monthSelectProps: {
8887
- ...dateRangePickerProps?.monthSelectProps,
8888
- popoverProps: {
8889
- ...dateRangePickerProps?.monthSelectProps?.popoverProps,
8890
- ref: monthSelectMenuRef
8891
- }
8892
- },
8893
- yearSelectProps: {
8894
- ...dateRangePickerProps?.yearSelectProps,
8895
- popoverProps: {
8896
- ...dateRangePickerProps?.yearSelectProps?.popoverProps,
8897
- ref: yearSelectMenuRef
8925
+ onEscapeKeyDown: combineEventHandlers(
8926
+ popoverContentProps?.onEscapeKeyDown,
8927
+ handlePopoverEscapeKeyDown
8928
+ ),
8929
+ onPointerDownOutside: combineEventHandlers(
8930
+ popoverContentProps?.onPointerDownOutside,
8931
+ handlePopoverPointerDownOutside
8932
+ ),
8933
+ onInteractOutside: combineEventHandlers(
8934
+ popoverContentProps?.onInteractOutside,
8935
+ handlePopoverInteractOutside
8936
+ ),
8937
+ onBlur: combineEventHandlers(
8938
+ popoverContentProps?.onBlur,
8939
+ handleControlBlur
8940
+ ),
8941
+ ref: combinedPopoverRef,
8942
+ children: /* @__PURE__ */ jsx(
8943
+ DateRangePicker,
8944
+ {
8945
+ className: cx(
8946
+ prefix("date-range-input__picker"),
8947
+ dateRangePickerProps?.className
8948
+ ),
8949
+ ...dateRangePickerProps,
8950
+ value: deferredDateValue,
8951
+ onChange: combineEventHandlers(
8952
+ dateRangePickerProps?.onChange,
8953
+ handleDatePickerChange
8954
+ ),
8955
+ selectionMode,
8956
+ month,
8957
+ onMonthChange: handleMonthChange,
8958
+ disabled: disabled || loading || readOnly || (startInputProps?.disabled || startInputProps?.readOnly) && (endInputProps?.disabled || endInputProps?.readOnly) || dateRangePickerProps?.disabled,
8959
+ minDate,
8960
+ maxDate,
8961
+ minMonth,
8962
+ maxMonth,
8963
+ minYear,
8964
+ maxYear,
8965
+ locale: dateFnsLocale,
8966
+ monthSelectProps: {
8967
+ ...dateRangePickerProps?.monthSelectProps,
8968
+ popoverProps: {
8969
+ ...dateRangePickerProps?.monthSelectProps?.popoverProps,
8970
+ ref: monthSelectMenuRef
8971
+ }
8972
+ },
8973
+ yearSelectProps: {
8974
+ ...dateRangePickerProps?.yearSelectProps,
8975
+ popoverProps: {
8976
+ ...dateRangePickerProps?.yearSelectProps?.popoverProps,
8977
+ ref: yearSelectMenuRef
8978
+ }
8979
+ }
8898
8980
  }
8899
- }
8981
+ )
8900
8982
  }
8901
8983
  )
8902
- }
8903
- )
8904
- ] })
8905
- ]
8984
+ ] })
8985
+ ]
8986
+ }
8987
+ )
8906
8988
  }
8907
- ) }) });
8989
+ ) });
8908
8990
  });
8909
8991
  const DropdownMenu = DropdownMenu$1.Root;
8910
8992
  const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
@@ -8912,11 +8994,12 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8912
8994
  defaultChecked,
8913
8995
  checked: controlledChecked,
8914
8996
  onCheckedChange,
8997
+ onSelect,
8915
8998
  color,
8916
8999
  disabled,
8917
9000
  loading,
8918
- enabledWhenLoading,
8919
9001
  loadingContent,
9002
+ showSpinner,
8920
9003
  iconPlacement,
8921
9004
  actionProps,
8922
9005
  contentProps,
@@ -8933,10 +9016,22 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8933
9016
  );
8934
9017
  const handleCheckedChange = useCallback(
8935
9018
  (checked2) => {
8936
- onCheckedChange?.(checked2);
8937
- setChecked(checked2);
9019
+ if (!loading) {
9020
+ onCheckedChange?.(checked2);
9021
+ setChecked(checked2);
9022
+ }
9023
+ },
9024
+ [loading, onCheckedChange, setChecked]
9025
+ );
9026
+ const handleSelect = useCallback(
9027
+ (evt) => {
9028
+ if (loading) {
9029
+ evt.preventDefault();
9030
+ return;
9031
+ }
9032
+ onSelect?.(evt);
8938
9033
  },
8939
- [onCheckedChange, setChecked]
9034
+ [loading, onSelect]
8940
9035
  );
8941
9036
  return /* @__PURE__ */ jsx(
8942
9037
  MenuListItem,
@@ -8945,8 +9040,8 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8945
9040
  color,
8946
9041
  disabled,
8947
9042
  loading,
8948
- enabledWhenLoading,
8949
9043
  loadingContent,
9044
+ showSpinner,
8950
9045
  iconPlacement,
8951
9046
  actionProps,
8952
9047
  contentProps,
@@ -8970,6 +9065,7 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8970
9065
  {
8971
9066
  checked,
8972
9067
  onCheckedChange: handleCheckedChange,
9068
+ onSelect: handleSelect,
8973
9069
  disabled,
8974
9070
  ...otherProps,
8975
9071
  className: cx(prefix("dropdown-menu__checkbox-item"), className),
@@ -9066,8 +9162,8 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9066
9162
  color,
9067
9163
  disabled,
9068
9164
  loading,
9069
- enabledWhenLoading,
9070
9165
  loadingContent,
9166
+ showSpinner,
9071
9167
  icon,
9072
9168
  iconPlacement,
9073
9169
  href,
@@ -9081,11 +9177,19 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9081
9177
  ...otherProps
9082
9178
  }, forwardedRef) {
9083
9179
  const prefix = usePrefix();
9084
- const handleSelect = useCallback(() => {
9085
- if (asLink) {
9086
- window.open(href, target, rel?.split(" ").join(","));
9087
- }
9088
- }, [asLink, href, rel, target]);
9180
+ const handleSelect = useCallback(
9181
+ (evt) => {
9182
+ if (loading) {
9183
+ evt.preventDefault();
9184
+ return;
9185
+ }
9186
+ onSelect?.(evt);
9187
+ if (asLink && !evt.defaultPrevented) {
9188
+ window.open(href, target, rel?.split(" ").join(","));
9189
+ }
9190
+ },
9191
+ [asLink, href, loading, onSelect, rel, target]
9192
+ );
9089
9193
  return /* @__PURE__ */ jsx(
9090
9194
  MenuListItem,
9091
9195
  {
@@ -9094,8 +9198,8 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9094
9198
  color,
9095
9199
  disabled,
9096
9200
  loading,
9097
- enabledWhenLoading,
9098
9201
  loadingContent,
9202
+ showSpinner,
9099
9203
  icon,
9100
9204
  iconPlacement,
9101
9205
  href,
@@ -9109,11 +9213,9 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9109
9213
  children: /* @__PURE__ */ jsx(
9110
9214
  DropdownMenu$1.Item,
9111
9215
  {
9112
- disabled: disabled || loading && !enabledWhenLoading,
9216
+ disabled,
9113
9217
  ...otherProps,
9114
- onSelect: combineEventHandlers(onSelect, handleSelect, {
9115
- checkDefaultPrevented: true
9116
- }),
9218
+ onSelect: handleSelect,
9117
9219
  className: cx(prefix("dropdown-menu__item"), className),
9118
9220
  ref: forwardedRef
9119
9221
  }
@@ -9143,11 +9245,12 @@ const DropdownMenuRadioGroup = forwardRef(function DropdownMenuRadioGroup2({ lab
9143
9245
  });
9144
9246
  const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9145
9247
  showRadio = true,
9248
+ onSelect,
9146
9249
  color,
9147
9250
  disabled,
9148
9251
  loading,
9149
- enabledWhenLoading,
9150
9252
  loadingContent,
9253
+ showSpinner,
9151
9254
  iconPlacement,
9152
9255
  actionProps,
9153
9256
  contentProps,
@@ -9158,6 +9261,16 @@ const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9158
9261
  ...otherProps
9159
9262
  }, forwardedRef) {
9160
9263
  const prefix = usePrefix();
9264
+ const handleSelect = useCallback(
9265
+ (evt) => {
9266
+ if (loading) {
9267
+ evt.preventDefault();
9268
+ return;
9269
+ }
9270
+ onSelect?.(evt);
9271
+ },
9272
+ [loading, onSelect]
9273
+ );
9161
9274
  return /* @__PURE__ */ jsx(
9162
9275
  MenuListItem,
9163
9276
  {
@@ -9165,8 +9278,8 @@ const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9165
9278
  color,
9166
9279
  disabled,
9167
9280
  loading,
9168
- enabledWhenLoading,
9169
9281
  loadingContent,
9282
+ showSpinner,
9170
9283
  iconPlacement,
9171
9284
  actionProps,
9172
9285
  contentProps,
@@ -9188,6 +9301,7 @@ const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9188
9301
  DropdownMenu$1.RadioItem,
9189
9302
  {
9190
9303
  disabled,
9304
+ onSelect: handleSelect,
9191
9305
  className: cx(prefix("dropdown-menu__radio-item"), className),
9192
9306
  ref: forwardedRef,
9193
9307
  ...otherProps
@@ -9482,8 +9596,8 @@ const FieldGroup = forwardRef(
9482
9596
  function FieldGroup2({
9483
9597
  asChild,
9484
9598
  className,
9599
+ "aria-label": ariaLabel,
9485
9600
  "aria-labelledby": ariaLabelledBy,
9486
- "aria-describedby": ariaDescribedBy,
9487
9601
  ...otherProps
9488
9602
  }, forwardedRef) {
9489
9603
  const prefix = usePrefix();
@@ -9496,8 +9610,8 @@ const FieldGroup = forwardRef(
9496
9610
  className: cx(prefix("field-group"), className),
9497
9611
  role: "group",
9498
9612
  ...otherProps,
9499
- "aria-labelledby": mergeAriaIds(titleId, ariaLabelledBy),
9500
- "aria-describedby": mergeAriaIds(codeId, ariaDescribedBy),
9613
+ "aria-label": ariaLabel,
9614
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel === void 0 ? combineAriaIds(codeId, titleId) : void 0),
9501
9615
  ref: forwardedRef
9502
9616
  }
9503
9617
  ) });
@@ -9538,7 +9652,7 @@ const FieldGroupHeader = forwardRef(function FieldGroupHeader2({
9538
9652
  As,
9539
9653
  {
9540
9654
  className: cx(prefix("field-group__header"), className),
9541
- "data-has-code": boolDataAttr(!!code),
9655
+ "data-has-code": boolDataAttr(Boolean(code)),
9542
9656
  ...otherProps,
9543
9657
  ref: forwardedRef,
9544
9658
  children: [
@@ -9938,7 +10052,7 @@ function transformOptions({
9938
10052
  ...otherOptions
9939
10053
  };
9940
10054
  }
9941
- const NumericInput = forwardRef(function DateInput3({
10055
+ const NumericInput = forwardRef(function NumericInput2({
9942
10056
  defaultValue,
9943
10057
  value,
9944
10058
  valueIsUnformattedString = false,
@@ -10104,7 +10218,7 @@ function validateNumericProps({
10104
10218
  }
10105
10219
  }
10106
10220
  function valueNeedsTransformation(value, valueIsUnformattedString, valueIsInteger, scale) {
10107
- return value != null && valueIsInteger && !!scale && (typeof value !== "string" || valueIsUnformattedString);
10221
+ return value != null && valueIsInteger && Boolean(scale) && (typeof value !== "string" || valueIsUnformattedString);
10108
10222
  }
10109
10223
  function transformIntegerValueWithScale(value, scale) {
10110
10224
  const stringValue = numericToString(value);
@@ -10124,16 +10238,27 @@ function transformNumberFormatValues({ formattedValue, value, floatValue }, valu
10124
10238
  return { formattedValue, stringValue, numberValue: +stringValue };
10125
10239
  }
10126
10240
  const Output = forwardRef(
10127
- function Output2({ className, children, ...otherProps }, forwardedRef) {
10241
+ function Output2({
10242
+ pending,
10243
+ pendingContent,
10244
+ showSpinner = pending,
10245
+ children,
10246
+ className,
10247
+ ...otherProps
10248
+ }, forwardedRef) {
10128
10249
  const prefix = usePrefix();
10129
10250
  return /* @__PURE__ */ jsx(
10130
10251
  Input,
10131
10252
  {
10253
+ showSpinner,
10254
+ "aria-busy": pending || void 0,
10255
+ "aria-disabled": void 0,
10256
+ "aria-invalid": void 0,
10132
10257
  ...otherProps,
10133
10258
  className: cx(prefix("output"), className),
10134
10259
  readOnly: true,
10135
10260
  asChild: true,
10136
- children: /* @__PURE__ */ jsx("output", { ref: forwardedRef, children })
10261
+ children: /* @__PURE__ */ jsx("output", { ref: forwardedRef, children: pending ? pendingContent || children : children })
10137
10262
  }
10138
10263
  );
10139
10264
  }
@@ -10143,6 +10268,8 @@ const Radio = forwardRef(function Radio2({
10143
10268
  status,
10144
10269
  code,
10145
10270
  loading,
10271
+ loadingDescription,
10272
+ showSpinner = loading,
10146
10273
  children,
10147
10274
  rootProps,
10148
10275
  codeProps,
@@ -10152,18 +10279,34 @@ const Radio = forwardRef(function Radio2({
10152
10279
  id,
10153
10280
  disabled,
10154
10281
  readOnly,
10282
+ onClick,
10155
10283
  className,
10156
- "aria-describedby": ariaDescribedBy,
10284
+ "aria-label": ariaLabel,
10285
+ "aria-labelledby": ariaLabelledBy,
10157
10286
  ...otherProps
10158
10287
  }, forwardedRef) {
10159
10288
  const prefix = usePrefix();
10289
+ const [locale7] = useLocale();
10290
+ loadingDescription ??= locale7.Input.loadingDescription;
10160
10291
  const controlContext = useControlContext();
10161
10292
  const generatedId = useId();
10162
- const radioId = id ?? prefix(`radio-${generatedId}`);
10163
- const codeId = codeProps?.id ?? prefix(`control-code-${generatedId}`);
10293
+ const controlId = id ?? prefix(`control-${generatedId}`);
10294
+ const codeId = code && (codeProps?.id ?? prefix(`control-code-${generatedId}`));
10295
+ const labelId = children && (labelProps?.id ?? prefix(`radio-label-${generatedId}`));
10296
+ const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
10164
10297
  status = controlContext?.status ?? status;
10165
10298
  disabled = controlContext?.disabled || disabled;
10299
+ loading = controlContext?.loading || loading;
10166
10300
  readOnly = controlContext?.readOnly || readOnly;
10301
+ const handleClick = useCallback(
10302
+ (evt) => {
10303
+ if (loading || readOnly) {
10304
+ evt.preventDefault();
10305
+ }
10306
+ },
10307
+ [loading, readOnly]
10308
+ );
10309
+ const combinedLabelIds = combineAriaIds(codeId, labelId);
10167
10310
  return /* @__PURE__ */ jsxs(
10168
10311
  "div",
10169
10312
  {
@@ -10171,7 +10314,7 @@ const Radio = forwardRef(function Radio2({
10171
10314
  ...rootProps,
10172
10315
  className: cx(prefix("radio__root"), rootProps?.className),
10173
10316
  children: [
10174
- code && /* @__PURE__ */ jsx(
10317
+ codeId && /* @__PURE__ */ jsx(
10175
10318
  ControlCode,
10176
10319
  {
10177
10320
  status,
@@ -10184,19 +10327,19 @@ const Radio = forwardRef(function Radio2({
10184
10327
  /* @__PURE__ */ jsx(
10185
10328
  RadioGroup$1.Item,
10186
10329
  {
10187
- id: radioId,
10330
+ id: controlId,
10188
10331
  className: cx(prefix("radio"), className),
10189
10332
  value: value?.toString() ?? "",
10190
10333
  disabled,
10334
+ "data-loading": boolDataAttr(loading),
10191
10335
  "data-readonly": boolDataAttr(readOnly),
10192
- "aria-readonly": readOnly ? "true" : void 0,
10193
10336
  "data-status": status,
10194
- "aria-describedby": mergeAriaIds(
10195
- code != null ? codeId : void 0,
10196
- ariaDescribedBy
10197
- ),
10198
- ref: forwardedRef,
10337
+ "aria-disabled": loading || readOnly || void 0,
10338
+ "aria-label": ariaLabel,
10339
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel === void 0 && combinedLabelIds !== labelId ? combinedLabelIds : void 0),
10199
10340
  ...otherProps,
10341
+ onClick: combineEventHandlers(onClick, handleClick),
10342
+ ref: forwardedRef,
10200
10343
  children: /* @__PURE__ */ jsx(
10201
10344
  RadioGroup$1.Indicator,
10202
10345
  {
@@ -10206,12 +10349,13 @@ const Radio = forwardRef(function Radio2({
10206
10349
  )
10207
10350
  }
10208
10351
  ),
10209
- children && /* @__PURE__ */ jsx(
10352
+ labelId && /* @__PURE__ */ jsx(
10210
10353
  Label,
10211
10354
  {
10212
- htmlFor: radioId,
10355
+ htmlFor: controlId,
10213
10356
  "data-status": status,
10214
10357
  ...labelProps,
10358
+ id: labelId,
10215
10359
  className: cx(prefix("radio__label"), labelProps?.className),
10216
10360
  containerProps: {
10217
10361
  ...labelProps?.containerProps,
@@ -10223,15 +10367,16 @@ const Radio = forwardRef(function Radio2({
10223
10367
  children
10224
10368
  }
10225
10369
  ),
10226
- loading && /* @__PURE__ */ jsx(
10370
+ showSpinner && /* @__PURE__ */ jsx(
10227
10371
  Spinner,
10228
10372
  {
10229
10373
  "data-status": status,
10230
- "data-disabled": boolDataAttr(disabled),
10374
+ "data-disabled": boolDataAttr(disabled || loading),
10231
10375
  ...spinnerProps,
10232
- className: cx(prefix("checkbox__spinner"), spinnerProps?.className)
10376
+ className: cx(prefix("radio__spinner"), spinnerProps?.className)
10233
10377
  }
10234
- )
10378
+ ),
10379
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
10235
10380
  ]
10236
10381
  }
10237
10382
  );
@@ -10244,6 +10389,8 @@ const RadioGroup = forwardRef(function RadioGroup2({
10244
10389
  variant,
10245
10390
  status,
10246
10391
  loading,
10392
+ loadingDescription,
10393
+ showSpinner = loading,
10247
10394
  code,
10248
10395
  showClearButton,
10249
10396
  clearButtonLabel,
@@ -10259,6 +10406,7 @@ const RadioGroup = forwardRef(function RadioGroup2({
10259
10406
  readOnly,
10260
10407
  className,
10261
10408
  children,
10409
+ "aria-label": ariaLabel,
10262
10410
  "aria-labelledby": ariaLabelledBy,
10263
10411
  "aria-describedby": ariaDescribedBy,
10264
10412
  onFocus,
@@ -10268,6 +10416,7 @@ const RadioGroup = forwardRef(function RadioGroup2({
10268
10416
  }, forwardedRef) {
10269
10417
  const prefix = usePrefix();
10270
10418
  const [locale7] = useLocale();
10419
+ loadingDescription ??= locale7.Input.loadingDescription;
10271
10420
  clearButtonLabel ??= locale7.Input.clearButtonLabel;
10272
10421
  const labelId = useFieldLabelId();
10273
10422
  const dataTableColumnLabelId = useDataTableColumnLabelId();
@@ -10277,25 +10426,26 @@ const RadioGroup = forwardRef(function RadioGroup2({
10277
10426
  defaultValue ?? "",
10278
10427
  controlledValue
10279
10428
  );
10280
- const { controlId, codeId } = useSetFieldControl(
10429
+ const { generatedId, controlId, codeId } = useSetFieldControl(
10281
10430
  id,
10282
10431
  "DIV",
10283
10432
  codeProps?.id,
10284
- !!code,
10433
+ Boolean(code),
10285
10434
  required
10286
10435
  );
10436
+ const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
10287
10437
  const radioGroupRef = useRef(null);
10288
10438
  const isInTableCell = useIsInTableCell();
10289
10439
  inline ??= isInTableCell;
10290
10440
  variant ??= isInTableCell ? "cell" : "default";
10291
10441
  const handleValueChange = useCallback(
10292
10442
  (value2) => {
10293
- if (!readOnly) {
10443
+ if (!loading && !readOnly) {
10294
10444
  setValue(value2);
10295
10445
  onValueChange?.(value2);
10296
10446
  }
10297
10447
  },
10298
- [onValueChange, readOnly, setValue]
10448
+ [loading, onValueChange, readOnly, setValue]
10299
10449
  );
10300
10450
  const setFieldControlFocused = useSetFieldControlFocused();
10301
10451
  const handleControlFocus = useCallback(() => {
@@ -10314,7 +10464,7 @@ const RadioGroup = forwardRef(function RadioGroup2({
10314
10464
  handleValueChange("");
10315
10465
  radioGroupRef.current?.focus();
10316
10466
  }, [handleValueChange]);
10317
- const hasClearButton = !disabled && !readOnly && (showClearButton === true || showClearButton === "auto" && (value?.length ?? 0) > 0);
10467
+ const hasClearButton = !disabled && !loading && !readOnly && (showClearButton === true || showClearButton === "auto" && (value?.length ?? 0) > 0);
10318
10468
  const handleKeyDown = useCallback(
10319
10469
  (evt) => {
10320
10470
  if (hasClearButton && (evt.code === "Delete" || evt.code === "Backspace")) {
@@ -10324,123 +10474,128 @@ const RadioGroup = forwardRef(function RadioGroup2({
10324
10474
  [handleClearButtonClick, hasClearButton]
10325
10475
  );
10326
10476
  const combinedRadioGroupRef = useCombinedRef(radioGroupRef, forwardedRef);
10327
- return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(ControlContext.Provider, { value: { variant, status, disabled, readOnly }, children: /* @__PURE__ */ jsxs(
10328
- RadioGroup$1.Root,
10477
+ return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(
10478
+ ControlContext.Provider,
10329
10479
  {
10330
- value,
10331
- onValueChange: handleValueChange,
10332
- id: controlId,
10333
- "data-status": status,
10334
- "data-accent": controlStatusToAccent(status),
10335
- "data-variant": variant,
10336
- required,
10337
- disabled,
10338
- className: cx(
10339
- prefix("radio-group"),
10340
- inline && prefix("radio-group--inline"),
10341
- className
10342
- ),
10343
- "aria-readonly": readOnly ? "true" : void 0,
10344
- "aria-labelledby": mergeAriaIds(
10345
- dataTableColumnLabelId,
10346
- labelId,
10347
- ariaLabelledBy
10348
- ),
10349
- "aria-describedby": mergeAriaIds(
10350
- codeId,
10351
- errorMessageIds,
10352
- descriptionIds,
10353
- ariaDescribedBy
10354
- ),
10355
- onFocus: combineEventHandlers(onFocus, handleControlFocus),
10356
- onBlur: combineEventHandlers(onBlur, handleControlBlur),
10357
- onKeyDown: combineEventHandlers(onKeyDown, handleKeyDown),
10358
- ...otherProps,
10359
- ref: combinedRadioGroupRef,
10360
- children: [
10361
- code && /* @__PURE__ */ jsx(
10362
- ControlCode,
10363
- {
10364
- status,
10365
- ...codeProps,
10366
- id: codeId,
10367
- className: cx(prefix("radio-group__code"), codeProps?.className),
10368
- children: code
10369
- }
10370
- ),
10371
- /* @__PURE__ */ jsx(
10372
- "div",
10373
- {
10374
- "data-status": status,
10375
- "data-variant": variant,
10376
- "data-disabled": boolDataAttr(disabled),
10377
- "data-readonly": boolDataAttr(readOnly),
10378
- ...containerProps,
10379
- className: cx(
10380
- prefix("radio-group__container"),
10381
- containerProps?.className
10480
+ value: { variant, status, disabled, loading, readOnly },
10481
+ children: /* @__PURE__ */ jsxs(
10482
+ RadioGroup$1.Root,
10483
+ {
10484
+ value,
10485
+ onValueChange: handleValueChange,
10486
+ id: controlId,
10487
+ "data-status": status,
10488
+ "data-accent": controlStatusToAccent(status),
10489
+ "data-variant": variant,
10490
+ required,
10491
+ disabled,
10492
+ className: cx(
10493
+ prefix("radio-group"),
10494
+ inline && prefix("radio-group--inline"),
10495
+ className
10496
+ ),
10497
+ "aria-disabled": loading || readOnly || void 0,
10498
+ "aria-invalid": status === "invalid" || void 0,
10499
+ "aria-label": ariaLabel,
10500
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel === void 0 ? combineAriaIds(codeId, labelId ?? dataTableColumnLabelId) : void 0),
10501
+ "aria-describedby": combineAriaIds(
10502
+ loadingDescriptionId,
10503
+ errorMessageIds,
10504
+ ariaDescribedBy,
10505
+ descriptionIds
10506
+ ),
10507
+ onFocus: combineEventHandlers(onFocus, handleControlFocus),
10508
+ onBlur: combineEventHandlers(onBlur, handleControlBlur),
10509
+ onKeyDown: combineEventHandlers(onKeyDown, handleKeyDown),
10510
+ ...otherProps,
10511
+ ref: combinedRadioGroupRef,
10512
+ children: [
10513
+ code && /* @__PURE__ */ jsx(
10514
+ ControlCode,
10515
+ {
10516
+ status,
10517
+ ...codeProps,
10518
+ id: codeId,
10519
+ className: cx(prefix("radio-group__code"), codeProps?.className),
10520
+ children: code
10521
+ }
10382
10522
  ),
10383
- children: /* @__PURE__ */ jsx(ClearContexts, { children })
10384
- }
10385
- ),
10386
- (hasClearButton || loading) && /* @__PURE__ */ jsxs(
10387
- "div",
10388
- {
10389
- "data-status": status,
10390
- "data-variant": variant,
10391
- "data-disabled": boolDataAttr(disabled),
10392
- "data-readonly": boolDataAttr(readOnly),
10393
- ...endContainerProps,
10394
- className: cx(
10395
- prefix("checkbox-group__end-container"),
10396
- endContainerProps?.className
10523
+ /* @__PURE__ */ jsx(
10524
+ "div",
10525
+ {
10526
+ "data-status": status,
10527
+ "data-variant": variant,
10528
+ "data-disabled": boolDataAttr(disabled || loading),
10529
+ "data-readonly": boolDataAttr(readOnly),
10530
+ ...containerProps,
10531
+ className: cx(
10532
+ prefix("radio-group__container"),
10533
+ containerProps?.className
10534
+ ),
10535
+ children: /* @__PURE__ */ jsx(ClearContexts, { children })
10536
+ }
10397
10537
  ),
10398
- children: [
10399
- hasClearButton && /* @__PURE__ */ jsx(
10400
- CloseButton,
10401
- {
10402
- size: "sm",
10403
- label: clearButtonLabel,
10404
- tabIndex: -1,
10405
- circle: true,
10406
- ...clearButtonProps,
10407
- className: cx(
10408
- prefix("radio-group__clear-button"),
10409
- clearButtonProps?.className
10410
- ),
10411
- onClick: combineEventHandlers(
10412
- clearButtonProps?.onClick,
10413
- handleClearButtonClick,
10414
- { checkDefaultPrevented: true }
10415
- ),
10416
- onFocus: combineEventHandlers(
10417
- clearButtonProps?.onFocus,
10418
- handleControlFocus
10538
+ (hasClearButton || showSpinner) && /* @__PURE__ */ jsxs(
10539
+ "div",
10540
+ {
10541
+ "data-status": status,
10542
+ "data-variant": variant,
10543
+ "data-disabled": boolDataAttr(disabled || loading),
10544
+ "data-readonly": boolDataAttr(readOnly),
10545
+ ...endContainerProps,
10546
+ className: cx(
10547
+ prefix("radio-group__end-container"),
10548
+ endContainerProps?.className
10549
+ ),
10550
+ children: [
10551
+ hasClearButton && /* @__PURE__ */ jsx(
10552
+ CloseButton,
10553
+ {
10554
+ size: "sm",
10555
+ label: clearButtonLabel,
10556
+ tabIndex: -1,
10557
+ circle: true,
10558
+ ...clearButtonProps,
10559
+ className: cx(
10560
+ prefix("radio-group__clear-button"),
10561
+ clearButtonProps?.className
10562
+ ),
10563
+ onClick: combineEventHandlers(
10564
+ clearButtonProps?.onClick,
10565
+ handleClearButtonClick,
10566
+ { checkDefaultPrevented: true }
10567
+ ),
10568
+ onFocus: combineEventHandlers(
10569
+ clearButtonProps?.onFocus,
10570
+ handleControlFocus
10571
+ ),
10572
+ onBlur: combineEventHandlers(
10573
+ clearButtonProps?.onBlur,
10574
+ handleControlBlur
10575
+ )
10576
+ }
10419
10577
  ),
10420
- onBlur: combineEventHandlers(
10421
- clearButtonProps?.onBlur,
10422
- handleControlBlur
10423
- )
10424
- }
10425
- ),
10426
- loading && /* @__PURE__ */ jsx(
10427
- Spinner,
10428
- {
10429
- color: controlStatusToAccent(status, "neutral"),
10430
- "data-disabled": boolDataAttr(disabled),
10431
- ...spinnerProps,
10432
- className: cx(
10433
- prefix("checkbox-group__spinner"),
10434
- spinnerProps?.className
10578
+ showSpinner && /* @__PURE__ */ jsx(
10579
+ Spinner,
10580
+ {
10581
+ color: controlStatusToAccent(status, "neutral"),
10582
+ "data-disabled": boolDataAttr(disabled || loading),
10583
+ ...spinnerProps,
10584
+ className: cx(
10585
+ prefix("radio-group__spinner"),
10586
+ spinnerProps?.className
10587
+ )
10588
+ }
10435
10589
  )
10436
- }
10437
- )
10438
- ]
10439
- }
10440
- )
10441
- ]
10590
+ ]
10591
+ }
10592
+ ),
10593
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
10594
+ ]
10595
+ }
10596
+ )
10442
10597
  }
10443
- ) }) });
10598
+ ) });
10444
10599
  });
10445
10600
  const Separator = forwardRef(function Separator2({ className, ...otherProps }, forwardedRef) {
10446
10601
  const prefix = usePrefix();
@@ -10900,7 +11055,7 @@ function TabListScrollButton({ side, onClick }) {
10900
11055
  disabled,
10901
11056
  onClick,
10902
11057
  tabIndex: -1,
10903
- "aria-hidden": "true"
11058
+ "aria-hidden": true
10904
11059
  }
10905
11060
  );
10906
11061
  }
@@ -11089,7 +11244,7 @@ function useIntersectionObserver(element, onIntersectionEntryChange, options) {
11089
11244
  }
11090
11245
  }, [element, onIntersectionEntryChange, options]);
11091
11246
  }
11092
- const MONKEY_PATCHED_HISTORY = Symbol.for("ostack-ui.monkeyPatchedHistory");
11247
+ const MONKEY_PATCHED_HISTORY = /* @__PURE__ */ Symbol.for("ostack-ui.monkeyPatchedHistory");
11093
11248
  const HISTORY_EVENT_TYPES = [
11094
11249
  "popstate",
11095
11250
  "hashchange",
@@ -11376,6 +11531,7 @@ export {
11376
11531
  VisuallyHidden,
11377
11532
  boolDataAttr,
11378
11533
  buildErrorReport,
11534
+ combineAriaIds,
11379
11535
  combineEventHandlers,
11380
11536
  compare,
11381
11537
  compareNumericStrings,
@@ -11390,7 +11546,6 @@ export {
11390
11546
  ignoreFormControlsKeyboardShortcut,
11391
11547
  isNumericStringNegative,
11392
11548
  matchAgainstFilter,
11393
- mergeAriaIds,
11394
11549
  navigate,
11395
11550
  normalizeNumericString,
11396
11551
  numericStringFloatToInt,
@@ -11404,6 +11559,7 @@ export {
11404
11559
  registerKeyboardShortcut,
11405
11560
  setBoolDataAttr,
11406
11561
  setDefaultPrefix,
11562
+ setNativeProperty,
11407
11563
  stableSort,
11408
11564
  stringHash,
11409
11565
  useAlertDialog,