@ostack.tech/ui 0.6.5 → 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 (44) 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 +13 -10
  10. package/dist/ostack-ui.css.map +1 -1
  11. package/dist/ostack-ui.js +1050 -893
  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/scss/placeholders/checkable/_checkable.scss +3 -3
  40. package/scss/scss/placeholders/control/_control.scss +1 -1
  41. package/scss/scss/placeholders/menu/_menu.scss +8 -3
  42. package/dist/chunks/en-C2peM913.js.map +0 -1
  43. package/dist/types/utils/mergeAriaIds.d.ts +0 -2
  44. 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,26 +5617,31 @@ 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();
@@ -5657,7 +5687,7 @@ const Input = forwardRef(
5657
5687
  );
5658
5688
  const handleClick = useCallback(
5659
5689
  (evt) => {
5660
- if (readOnly && (type === "file" || type === "color")) {
5690
+ if (readOnly && type && NON_READONLY_INPUT_TYPES.includes(type)) {
5661
5691
  evt.preventDefault();
5662
5692
  }
5663
5693
  },
@@ -5671,32 +5701,42 @@ const Input = forwardRef(
5671
5701
  requestAnimationFrame(() => {
5672
5702
  try {
5673
5703
  inputEl.setSelectionRange(cursorIdx, cursorIdx);
5674
- } finally {
5675
- inputEl.focus();
5704
+ } catch {
5676
5705
  }
5706
+ inputEl.focus();
5677
5707
  });
5678
5708
  }
5679
5709
  },
5680
5710
  [disabled, inputEl, prefix]
5681
5711
  );
5682
5712
  const handleClearButtonClick = useCallback(() => {
5683
- if (inputEl) {
5684
- setNativeValue(inputEl, "");
5685
- const changeEvent = new Event("input", { bubbles: true });
5686
- inputEl.dispatchEvent(changeEvent);
5687
- if (!changeEvent.defaultPrevented) {
5688
- 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) {
5689
5721
  inputEl.focus();
5690
5722
  }
5691
5723
  }
5692
- }, [inputEl, onValueChange]);
5693
- const hasClearButton = !disabled && !readOnly && (showClearButton === true || showClearButton === "auto" && (isControlled ? (value?.toString() ?? "")?.length > 0 : shouldShowClearButton));
5724
+ }, [inputEl]);
5725
+ const hasClearButton = !disabled && !loading && !readOnly && (showClearButton === true || showClearButton === "auto" && (isControlled ? (value?.toString() ?? "")?.length > 0 : shouldShowClearButton));
5694
5726
  const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(
5695
5727
  "control",
5696
5728
  { align }
5697
5729
  );
5698
- const requirable = inputEl && REQUIRABLE_CONTROLS.includes(inputEl.tagName);
5699
- 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
+ );
5700
5740
  const combinedContainerRef = useCombinedRef(
5701
5741
  containerRef,
5702
5742
  containerProps?.ref
@@ -5706,144 +5746,140 @@ const Input = forwardRef(
5706
5746
  clearButtonRef,
5707
5747
  clearButtonProps?.ref
5708
5748
  );
5709
- return /* @__PURE__ */ jsx(ClearContexts, { field: false, children: /* @__PURE__ */ jsx(
5710
- ControlContext.Provider,
5711
- {
5712
- value: { variant, status, disabled, readOnly },
5713
- children: /* @__PURE__ */ jsxs(
5714
- "div",
5715
- {
5716
- "data-status": status,
5717
- "data-accent": controlStatusToAccent(status),
5718
- "data-variant": variant,
5719
- "data-disabled": boolDataAttr(disabled),
5720
- "data-readonly": boolDataAttr(readOnly),
5721
- ...rootProps,
5722
- className: cx(prefix("input__root"), rootProps?.className),
5723
- children: [
5724
- code && /* @__PURE__ */ jsx(
5725
- ControlCode,
5726
- {
5727
- ...codeProps,
5728
- id: codeId,
5729
- className: cx(prefix("input__code"), codeProps?.className),
5730
- children: code
5731
- }
5732
- ),
5733
- /* @__PURE__ */ jsxs(
5734
- "div",
5735
- {
5736
- "data-status": status,
5737
- "data-accent": controlStatusToAccent(status),
5738
- "data-variant": variant,
5739
- "data-disabled": boolDataAttr(disabled),
5740
- "data-readonly": boolDataAttr(readOnly),
5741
- ...containerProps,
5742
- className: cx(
5743
- prefix("input__container"),
5744
- containerProps?.className
5745
- ),
5746
- onPointerDown: combineEventHandlers(
5747
- containerProps?.onPointerDown,
5748
- handleContainerPointerDown,
5749
- { checkDefaultPrevented: true }
5750
- ),
5751
- ref: combinedContainerRef,
5752
- children: [
5753
- startAdornment,
5754
- /* @__PURE__ */ jsx(
5755
- As,
5756
- {
5757
- type,
5758
- defaultValue,
5759
- value,
5760
- id: controlId,
5761
- className: cx(prefix("input"), className),
5762
- required,
5763
- disabled,
5764
- readOnly,
5765
- onInput: combineEventHandlers(onChange, handleChange, {
5766
- checkDefaultPrevented: true
5767
- }),
5768
- onFocus: combineEventHandlers(onFocus, handleControlFocus, {
5769
- checkDefaultPrevented: true
5770
- }),
5771
- onBlur: combineEventHandlers(onBlur, handleControlBlur, {
5772
- checkDefaultPrevented: true
5773
- }),
5774
- onClick: combineEventHandlers(onClick, handleClick, {
5775
- checkDefaultPrevented: true
5776
- }),
5777
- style: { ...cssVars, ...style },
5778
- ...dataAttrs,
5779
- "data-status": status,
5780
- "data-accent": controlStatusToAccent(status),
5781
- "data-variant": variant,
5782
- "aria-required": required && !requirable ? "true" : void 0,
5783
- "aria-invalid": status === "invalid" ? "true" : void 0,
5784
- "aria-labelledby": mergeAriaIds(
5785
- dataTableColumnLabelId,
5786
- ariaLabelledBy
5787
- ),
5788
- "aria-describedby": mergeAriaIds(
5789
- code && codeId,
5790
- errorMessageIds,
5791
- descriptionIds,
5792
- ariaDescribedBy
5793
- ),
5794
- ...otherProps,
5795
- ref: combinedInputRef
5796
- }
5797
- ),
5798
- hasClearButton && /* @__PURE__ */ jsx(
5799
- CloseButton,
5800
- {
5801
- size: "sm",
5802
- label: clearButtonLabel,
5803
- tabIndex: -1,
5804
- ...clearButtonProps,
5805
- className: cx(
5806
- prefix("input__clear-button"),
5807
- printHidden,
5808
- clearButtonProps?.className
5809
- ),
5810
- onClick: combineEventHandlers(
5811
- clearButtonProps?.onClick,
5812
- handleClearButtonClick,
5813
- { checkDefaultPrevented: true }
5814
- ),
5815
- onFocus: combineEventHandlers(
5816
- clearButtonProps?.onFocus,
5817
- handleControlFocus
5818
- ),
5819
- onBlur: combineEventHandlers(
5820
- clearButtonProps?.onBlur,
5821
- handleControlBlur
5822
- ),
5823
- ref: combinedClearButtonRef
5824
- }
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
5825
5787
  ),
5826
- loading && /* @__PURE__ */ jsx(
5827
- Spinner,
5828
- {
5829
- color: controlStatusToAccent(status, "neutral"),
5830
- "data-disabled": boolDataAttr(disabled),
5831
- ...spinnerProps,
5832
- className: cx(
5833
- prefix("input__spinner"),
5834
- spinnerProps?.className
5835
- )
5836
- }
5788
+ onPointerDown: combineEventHandlers(
5789
+ containerProps?.onPointerDown,
5790
+ handleContainerPointerDown,
5791
+ { checkDefaultPrevented: true }
5837
5792
  ),
5838
- endAdornment
5839
- ]
5840
- }
5841
- )
5842
- ]
5843
- }
5844
- )
5845
- }
5846
- ) });
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
+ ] });
5847
5883
  }
5848
5884
  );
5849
5885
  const InputWithContainerRef = forwardRef(function InputWithContainerRef2({ inputRef, containerProps, ...otherProps }, forwardedRef) {
@@ -5948,8 +5984,8 @@ const MenuListItem = forwardRef(
5948
5984
  color,
5949
5985
  disabled,
5950
5986
  loading,
5951
- enabledWhenLoading,
5952
5987
  loadingContent,
5988
+ showSpinner = loading,
5953
5989
  icon = null,
5954
5990
  iconPlacement,
5955
5991
  href,
@@ -5968,59 +6004,56 @@ const MenuListItem = forwardRef(
5968
6004
  const variant = menuListContext.variant;
5969
6005
  iconPlacement ??= menuListContext.iconPlacement;
5970
6006
  const handleSelect = useCallback(
5971
- (event) => {
5972
- if (!disabled) {
5973
- onSelect?.(event);
6007
+ (evt) => {
6008
+ if (disabled || loading) {
6009
+ evt.preventDefault();
6010
+ return;
5974
6011
  }
6012
+ onSelect?.(evt);
5975
6013
  },
5976
- [disabled, onSelect]
6014
+ [disabled, loading, onSelect]
5977
6015
  );
5978
- const iconEl = useMemo(
5979
- () => icon && /* @__PURE__ */ jsx(
5980
- Slot,
5981
- {
5982
- className: cx(
5983
- prefix("menu-list__item-icon"),
5984
- prefix(`menu-list__item-icon--${iconPlacement}`),
5985
- iconProps?.className
5986
- ),
5987
- children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, ...iconProps })
5988
- }
5989
- ),
5990
- [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
+ }
5991
6026
  );
5992
- const spinnerEl = useMemo(
5993
- () => /* @__PURE__ */ jsx(
5994
- Spinner,
5995
- {
5996
- ...spinnerProps,
5997
- className: cx(
5998
- prefix("menu-list__item-spinner"),
5999
- prefix(`menu-list__item-spinner--${iconPlacement}`),
6000
- spinnerProps?.className
6001
- )
6002
- }
6003
- ),
6004
- [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
+ }
6005
6037
  );
6006
- const shouldDisable = disabled || loading && !enabledWhenLoading;
6007
6038
  const Action = type === "button" ? "button" : type === "link" ? "a" : "div";
6008
6039
  const actionEl = /* @__PURE__ */ jsxs(
6009
6040
  Action,
6010
6041
  {
6011
6042
  type: type === "button" ? "button" : void 0,
6012
- disabled: type === "button" ? shouldDisable : void 0,
6013
- "data-disabled": boolDataAttr(type !== "button" && shouldDisable),
6014
- "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),
6015
6047
  "data-selected": boolDataAttr(selected),
6016
6048
  "data-accent": color,
6017
6049
  href,
6018
6050
  target,
6019
6051
  rel,
6052
+ tabIndex: type === "link" && disabled ? -1 : void 0,
6020
6053
  ...actionProps,
6021
6054
  onClick: combineEventHandlers(
6022
- actionProps?.onClick,
6023
6055
  handleSelect,
6056
+ actionProps?.onClick,
6024
6057
  { checkDefaultPrevented: true }
6025
6058
  ),
6026
6059
  className: cx(
@@ -6029,8 +6062,8 @@ const MenuListItem = forwardRef(
6029
6062
  actionProps?.className
6030
6063
  ),
6031
6064
  children: [
6032
- loading && iconPlacement === "start" && spinnerEl,
6033
- !loading && iconPlacement === "start" && iconEl,
6065
+ iconPlacement === "start" && spinnerEl,
6066
+ iconPlacement === "start" && iconEl,
6034
6067
  /* @__PURE__ */ jsx(
6035
6068
  "span",
6036
6069
  {
@@ -6042,8 +6075,8 @@ const MenuListItem = forwardRef(
6042
6075
  children: loading && loadingContent ? loadingContent : asChild ? children.props.children : children
6043
6076
  }
6044
6077
  ),
6045
- !loading && iconPlacement === "end" && iconEl,
6046
- loading && iconPlacement === "end" && spinnerEl
6078
+ iconPlacement === "end" && iconEl,
6079
+ iconPlacement === "end" && spinnerEl
6047
6080
  ]
6048
6081
  }
6049
6082
  );
@@ -6289,8 +6322,8 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6289
6322
  color,
6290
6323
  disabled,
6291
6324
  loading,
6292
- enabledWhenLoading,
6293
6325
  loadingContent,
6326
+ showSpinner,
6294
6327
  icon,
6295
6328
  iconPlacement,
6296
6329
  href,
@@ -6306,11 +6339,17 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6306
6339
  ...otherProps
6307
6340
  }, forwardedRef) {
6308
6341
  const prefix = usePrefix();
6309
- const handleSelect = useCallback(() => {
6310
- if (asLink) {
6311
- window.open(href, target, rel?.split(" ").join(","));
6312
- }
6313
- }, [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
+ );
6314
6353
  return /* @__PURE__ */ jsx(
6315
6354
  MenuListItem,
6316
6355
  {
@@ -6319,8 +6358,8 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6319
6358
  color,
6320
6359
  disabled,
6321
6360
  loading,
6322
- enabledWhenLoading,
6323
6361
  loadingContent,
6362
+ showSpinner,
6324
6363
  icon,
6325
6364
  iconPlacement,
6326
6365
  href,
@@ -6341,10 +6380,10 @@ const CommandMenuItem = forwardRef(function CommandMenuItem2({
6341
6380
  children: /* @__PURE__ */ jsx(
6342
6381
  Command.Item,
6343
6382
  {
6344
- disabled: disabled || loading && !enabledWhenLoading,
6383
+ disabled,
6345
6384
  ...otherProps,
6346
6385
  keywords: typeof children === "string" ? [children, ...keywords ?? []] : keywords,
6347
- onSelect: combineEventHandlers(onSelect, handleSelect),
6386
+ onSelect: handleSelect,
6348
6387
  className: cx(prefix("command-menu__item"), className),
6349
6388
  ref: forwardedRef,
6350
6389
  children
@@ -6665,7 +6704,7 @@ function SelectMultipleValue() {
6665
6704
  ),
6666
6705
  ...valueTagProps?.contentProps
6667
6706
  },
6668
- "aria-hidden": "true"
6707
+ "aria-hidden": true
6669
6708
  },
6670
6709
  optionState.content
6671
6710
  );
@@ -6712,6 +6751,7 @@ const Select = forwardRef(function Select2({
6712
6751
  readOnly,
6713
6752
  required,
6714
6753
  loading,
6754
+ loadingDescription,
6715
6755
  variant,
6716
6756
  status,
6717
6757
  code,
@@ -6722,6 +6762,7 @@ const Select = forwardRef(function Select2({
6722
6762
  loadingOptions,
6723
6763
  loadingOptionsLabel,
6724
6764
  loadingOptionsProgress,
6765
+ showSpinner = loading || loadingOptions,
6725
6766
  emptyMessage,
6726
6767
  valueTagMaxWidth,
6727
6768
  onKeyDown,
@@ -6774,11 +6815,11 @@ const Select = forwardRef(function Select2({
6774
6815
  evt.preventDefault();
6775
6816
  const buttonEl = buttonRef.current;
6776
6817
  const target = evt.target;
6777
- if (buttonEl && !disabled && !target.closest("input, select, textarea, button, a")) {
6818
+ if (buttonEl && !disabled && !loading && !target.closest("input, select, textarea, button, a")) {
6778
6819
  setOpen((open2) => !open2);
6779
6820
  }
6780
6821
  },
6781
- [disabled, setOpen]
6822
+ [disabled, loading, setOpen]
6782
6823
  );
6783
6824
  const handleOptionSelect = useCallback(
6784
6825
  (optionValue) => {
@@ -6843,7 +6884,7 @@ const Select = forwardRef(function Select2({
6843
6884
  value: actualValue,
6844
6885
  onOptionSelect: handleOptionSelect,
6845
6886
  status,
6846
- disabled,
6887
+ disabled: disabled || loading,
6847
6888
  readOnly,
6848
6889
  valueTagProps
6849
6890
  });
@@ -6851,7 +6892,7 @@ const Select = forwardRef(function Select2({
6851
6892
  () => ({ registering: true, ...selectContext }),
6852
6893
  [selectContext]
6853
6894
  );
6854
- const showOpen = open && !disabled && !readOnly;
6895
+ const showOpen = open && !disabled && !loading && !readOnly;
6855
6896
  const combinedClearButtonRef = useCombinedRef(
6856
6897
  clearButtonRef,
6857
6898
  clearButtonProps?.ref
@@ -6894,7 +6935,9 @@ const Select = forwardRef(function Select2({
6894
6935
  disabled,
6895
6936
  readOnly,
6896
6937
  required,
6897
- loading: loading || loadingOptions,
6938
+ loading,
6939
+ loadingDescription,
6940
+ showSpinner,
6898
6941
  startAdornment,
6899
6942
  endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
6900
6943
  !readOnly && /* @__PURE__ */ jsx(
@@ -6907,7 +6950,7 @@ const Select = forwardRef(function Select2({
6907
6950
  arrowProps?.className
6908
6951
  ),
6909
6952
  "data-status": status,
6910
- "data-disabled": disabled
6953
+ "data-disabled": disabled || loading
6911
6954
  }
6912
6955
  ),
6913
6956
  endAdornment
@@ -6946,7 +6989,6 @@ const Select = forwardRef(function Select2({
6946
6989
  ...spinnerProps,
6947
6990
  className: cx(prefix("select__spinner"), spinnerProps?.className)
6948
6991
  },
6949
- "aria-readonly": readOnly ? "true" : void 0,
6950
6992
  "data-placeholder": boolDataAttr(isEmpty),
6951
6993
  children: /* @__PURE__ */ jsx("button", { ref: combinedButtonRef, children: /* @__PURE__ */ jsxs(
6952
6994
  "span",
@@ -7419,6 +7461,8 @@ const CheckboxGroup = forwardRef(function CheckboxGroup2({
7419
7461
  code,
7420
7462
  name,
7421
7463
  loading,
7464
+ loadingDescription,
7465
+ showSpinner = loading,
7422
7466
  required,
7423
7467
  disabled = false,
7424
7468
  readOnly = false,
@@ -7437,22 +7481,26 @@ const CheckboxGroup = forwardRef(function CheckboxGroup2({
7437
7481
  onMouseDown,
7438
7482
  tabIndex: controlledTabIndex,
7439
7483
  children,
7484
+ "aria-label": ariaLabel,
7440
7485
  "aria-labelledby": ariaLabelledBy,
7441
7486
  "aria-describedby": ariaDescribedBy,
7442
7487
  ...otherProps
7443
7488
  }, forwardedRef) {
7444
7489
  const prefix = usePrefix();
7490
+ const [locale7] = useLocale();
7491
+ loadingDescription ??= locale7.Input.loadingDescription;
7445
7492
  const labelId = useFieldLabelId();
7446
7493
  const dataTableColumnLabelId = useDataTableColumnLabelId();
7447
7494
  const descriptionIds = useFieldDescriptionIds();
7448
7495
  const errorMessageIds = useFieldErrorMessageIds();
7449
- const { controlId, codeId } = useSetFieldControl(
7496
+ const { generatedId, controlId, codeId } = useSetFieldControl(
7450
7497
  id,
7451
7498
  "DIV",
7452
7499
  codeProps?.id,
7453
- !!code,
7500
+ Boolean(code),
7454
7501
  required
7455
7502
  );
7503
+ const loadingDescriptionId = loading && loadingDescription ? prefix(`control-loading-${generatedId}`) : void 0;
7456
7504
  const checkboxGroupRef = useRef(null);
7457
7505
  const isInTableCell = useIsInTableCell();
7458
7506
  inline ??= isInTableCell;
@@ -7511,101 +7559,107 @@ const CheckboxGroup = forwardRef(function CheckboxGroup2({
7511
7559
  checkboxGroupRef,
7512
7560
  forwardedRef
7513
7561
  );
7514
- return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(ControlContext.Provider, { value: { variant, status, disabled, readOnly }, children: /* @__PURE__ */ jsx(
7515
- CheckboxGroupContext.Provider,
7562
+ return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(
7563
+ ControlContext.Provider,
7516
7564
  {
7517
- value: { name, value, onCheckedChange: handleCheckedChange },
7518
- children: /* @__PURE__ */ jsxs(
7519
- "div",
7565
+ value: { variant, status, disabled, loading, readOnly },
7566
+ children: /* @__PURE__ */ jsx(
7567
+ CheckboxGroupContext.Provider,
7520
7568
  {
7521
- role: "group",
7522
- id: controlId,
7523
- ...otherProps,
7524
- "data-status": status,
7525
- "data-accent": controlStatusToAccent(status),
7526
- "data-variant": variant,
7527
- className: cx(
7528
- prefix("checkbox-group"),
7529
- inline && prefix("checkbox-group--inline"),
7530
- className
7531
- ),
7532
- onMouseDown: combineEventHandlers(onMouseDown, handleMouseDown),
7533
- onFocus: combineEventHandlers(onFocus, handleFocus),
7534
- onBlur: combineEventHandlers(onBlur, handleBlur),
7535
- "aria-readonly": readOnly ? "true" : void 0,
7536
- "aria-labelledby": mergeAriaIds(
7537
- dataTableColumnLabelId,
7538
- labelId,
7539
- ariaLabelledBy
7540
- ),
7541
- "aria-describedby": mergeAriaIds(
7542
- codeId,
7543
- descriptionIds,
7569
+ value: {
7570
+ name,
7571
+ value,
7572
+ onCheckedChange: handleCheckedChange,
7573
+ loadingDescriptionId,
7544
7574
  errorMessageIds,
7545
- ariaDescribedBy
7546
- ),
7547
- tabIndex,
7548
- ref: combinedCheckboxGroupRef,
7549
- children: [
7550
- code && /* @__PURE__ */ jsx(
7551
- ControlCode,
7552
- {
7553
- status,
7554
- ...codeProps,
7555
- id: codeId,
7556
- className: cx(
7557
- prefix("checkbox-group__code"),
7558
- codeProps?.className
7559
- ),
7560
- children: code
7561
- }
7562
- ),
7563
- /* @__PURE__ */ jsx(
7564
- "div",
7565
- {
7566
- "data-status": status,
7567
- "data-variant": variant,
7568
- "data-disabled": boolDataAttr(disabled),
7569
- "data-readonly": boolDataAttr(readOnly),
7570
- ...containerProps,
7571
- className: cx(
7572
- prefix("checkbox-group__container"),
7573
- containerProps?.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
+ }
7574
7613
  ),
7575
- children: /* @__PURE__ */ jsx(ClearContexts, { children })
7576
- }
7577
- ),
7578
- loading && /* @__PURE__ */ jsx(
7579
- "div",
7580
- {
7581
- "data-status": status,
7582
- "data-variant": variant,
7583
- "data-disabled": boolDataAttr(disabled),
7584
- "data-readonly": boolDataAttr(readOnly),
7585
- ...endContainerProps,
7586
- className: cx(
7587
- prefix("checkbox-group__end-container"),
7588
- 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
+ }
7589
7628
  ),
7590
- children: /* @__PURE__ */ jsx(
7591
- Spinner,
7629
+ showSpinner && /* @__PURE__ */ jsx(
7630
+ "div",
7592
7631
  {
7593
- color: controlStatusToAccent(status, "neutral"),
7594
- "data-disabled": boolDataAttr(disabled),
7595
- ...spinnerProps,
7632
+ "data-status": status,
7633
+ "data-variant": variant,
7634
+ "data-disabled": boolDataAttr(disabled || loading),
7635
+ "data-readonly": boolDataAttr(readOnly),
7636
+ ...endContainerProps,
7596
7637
  className: cx(
7597
- prefix("checkbox-group__spinner"),
7598
- 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
+ }
7599
7652
  )
7600
7653
  }
7601
- )
7602
- }
7603
- )
7604
- ]
7654
+ ),
7655
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
7656
+ ]
7657
+ }
7658
+ )
7605
7659
  }
7606
7660
  )
7607
7661
  }
7608
- ) }) });
7662
+ ) });
7609
7663
  });
7610
7664
  const Container = forwardRef(
7611
7665
  function Container2({
@@ -7717,6 +7771,7 @@ const DateInput = forwardRef(
7717
7771
  onChange,
7718
7772
  onFocus,
7719
7773
  disabled,
7774
+ loading,
7720
7775
  readOnly,
7721
7776
  showClearButton = "auto",
7722
7777
  endAdornment,
@@ -7920,6 +7975,7 @@ const DateInput = forwardRef(
7920
7975
  value: formattedValue,
7921
7976
  placeholder,
7922
7977
  disabled,
7978
+ loading,
7923
7979
  readOnly,
7924
7980
  onChange: combineEventHandlers(onChange, handleInputChange),
7925
7981
  onFocus: combineEventHandlers(onFocus, handleInputFocus),
@@ -7933,7 +7989,7 @@ const DateInput = forwardRef(
7933
7989
  className: printHidden,
7934
7990
  "aria-label": calendarButtonLabel?.(
7935
7991
  fullFormattedValue,
7936
- !disabled && !readOnly
7992
+ !disabled && !loading && !readOnly
7937
7993
  ),
7938
7994
  onClick: handleAddonButtonClick,
7939
7995
  onBlur: handleControlBlur,
@@ -7943,7 +7999,7 @@ const DateInput = forwardRef(
7943
7999
  }
7944
8000
  ) }) })
7945
8001
  ] }),
7946
- "aria-describedby": mergeAriaIds(
8002
+ "aria-describedby": combineAriaIds(
7947
8003
  formatDescriptionId,
7948
8004
  ariaDescribedBy
7949
8005
  ),
@@ -8007,7 +8063,7 @@ const DateInput = forwardRef(
8007
8063
  ),
8008
8064
  month,
8009
8065
  onMonthChange: handleMonthChange,
8010
- disabled: disabled || readOnly || datePickerProps?.disabled,
8066
+ disabled: disabled || loading || readOnly || datePickerProps?.disabled,
8011
8067
  minDate,
8012
8068
  maxDate,
8013
8069
  minMonth,
@@ -8143,8 +8199,10 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8143
8199
  minYear,
8144
8200
  maxYear,
8145
8201
  loading,
8146
- startLoading = loading,
8147
- endLoading = loading,
8202
+ loadingDescription,
8203
+ showSpinners = loading,
8204
+ showStartSpinner = showSpinners,
8205
+ showEndSpinner = showSpinners,
8148
8206
  align,
8149
8207
  startAdornment,
8150
8208
  endAdornment,
@@ -8178,6 +8236,7 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8178
8236
  }, forwardedRef) {
8179
8237
  const prefix = usePrefix();
8180
8238
  const [locale7] = useLocale();
8239
+ loadingDescription ??= locale7.Input.loadingDescription;
8181
8240
  clearButtonsLabel ??= locale7.Input.clearButtonLabel;
8182
8241
  dateFnsLocale ??= locale7.dateFnsLocale;
8183
8242
  placeholder ??= locale7.DateInput.placeholder;
@@ -8195,17 +8254,17 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8195
8254
  const descriptionIds = useFieldDescriptionIds();
8196
8255
  const errorMessageIds = useFieldErrorMessageIds();
8197
8256
  const { printHidden } = usePrintClassNames();
8198
- const { controlId, codeId } = useSetFieldControl(
8257
+ const { generatedId, controlId, codeId } = useSetFieldControl(
8199
8258
  startInputProps?.id,
8200
8259
  "INPUT",
8201
8260
  codeProps?.id,
8202
- !!code,
8261
+ Boolean(code),
8203
8262
  required
8204
8263
  );
8205
8264
  const setFieldControlFocused = useSetFieldControlFocused();
8206
- const generatedId = useId();
8207
8265
  const startInputLabelId = startInputLabel && prefix(`control-start-label-${generatedId}`);
8208
8266
  const endInputLabelId = endInputLabel && prefix(`control-end-label-${generatedId}`);
8267
+ const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
8209
8268
  const formatDescriptionId = formatDescription && prefix(`control-format-${generatedId}`);
8210
8269
  const isInTableCell = useIsInTableCell();
8211
8270
  variant ??= isInTableCell ? "cell" : "default";
@@ -8384,10 +8443,14 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8384
8443
  );
8385
8444
  const handleClearButtonClick = useCallback(
8386
8445
  (ref) => () => {
8387
- if (ref.current) {
8388
- setNativeValue(ref.current, "");
8389
- ref.current.dispatchEvent(new Event("change", { bubbles: true }));
8390
- 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
+ }
8391
8454
  }
8392
8455
  },
8393
8456
  []
@@ -8502,8 +8565,8 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8502
8565
  setFormattedValue
8503
8566
  ]
8504
8567
  );
8505
- const hasStartClearButton = !disabled && !startInputProps?.disabled && !readOnly && !startInputProps?.readOnly && (showClearButtons === true || showClearButtons === "auto" && formattedValue.start !== "");
8506
- 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 !== "");
8507
8570
  const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();
8508
8571
  const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(
8509
8572
  "control",
@@ -8537,373 +8600,393 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
8537
8600
  popoverRef,
8538
8601
  popoverContentProps?.ref
8539
8602
  );
8540
- return /* @__PURE__ */ jsx(ClearContexts, { field: false, children: /* @__PURE__ */ jsx(ControlContext.Provider, { value: { variant, status, disabled, readOnly }, children: /* @__PURE__ */ jsxs(
8541
- "div",
8603
+ return /* @__PURE__ */ jsx(ClearContexts, { field: false, children: /* @__PURE__ */ jsx(
8604
+ ControlContext.Provider,
8542
8605
  {
8543
- "data-status": status,
8544
- "data-accent": controlStatusToAccent(status),
8545
- "data-variant": variant,
8546
- "data-disabled": boolDataAttr(disabled),
8547
- "data-readonly": boolDataAttr(readOnly),
8548
- className: cx(prefix("date-range-input__root"), className),
8549
- ...otherProps,
8550
- ref: forwardedRef,
8551
- children: [
8552
- startInputLabel && /* @__PURE__ */ jsx(VisuallyHidden, { id: startInputLabelId, children: startInputLabel }),
8553
- endInputLabel && /* @__PURE__ */ jsx(VisuallyHidden, { id: endInputLabelId, children: endInputLabel }),
8554
- formatDescription && /* @__PURE__ */ jsx(VisuallyHidden, { id: formatDescriptionId, children: formatDescription }),
8555
- code && /* @__PURE__ */ jsx(
8556
- ControlCode,
8557
- {
8558
- ...codeProps,
8559
- id: codeId,
8560
- className: cx(
8561
- prefix("date-range-input__code"),
8562
- 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
+ }
8563
8638
  ),
8564
- children: code
8565
- }
8566
- ),
8567
- /* @__PURE__ */ jsxs(Popover, { open: popoverState.open, modal: popoverState.modal, children: [
8568
- /* @__PURE__ */ jsxs(
8569
- PopoverAnchor,
8570
- {
8571
- ...popoverAnchorProps,
8572
- className: cx(
8573
- prefix("date-range-input__container"),
8574
- prefix("date-range-input__popover-anchor"),
8575
- popoverAnchorProps?.className
8576
- ),
8577
- children: [
8578
- startAdornment,
8579
- /* @__PURE__ */ jsxs(
8580
- "div",
8581
- {
8582
- "data-focused": boolDataAttr(
8583
- !disabled && !startInputProps?.disabled && popoverState.open && selectionMode === "start"
8584
- ),
8585
- "data-status": status,
8586
- "data-accent": controlStatusToAccent(status),
8587
- "data-variant": variant,
8588
- "data-disabled": boolDataAttr(
8589
- disabled || startInputProps?.disabled && endInputProps?.disabled
8590
- ),
8591
- "data-readonly": boolDataAttr(
8592
- readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8593
- ),
8594
- ...startContainerProps,
8595
- className: cx(
8596
- prefix("date-range-input__container"),
8597
- prefix("date-range-input__container--start"),
8598
- startContainerProps?.className
8599
- ),
8600
- onPointerDown: combineEventHandlers(
8601
- startContainerProps?.onPointerDown,
8602
- handleContainerPointerDown("start")
8603
- ),
8604
- ref: combinedStartContainerRef,
8605
- children: [
8606
- /* @__PURE__ */ jsx(
8607
- "input",
8608
- {
8609
- ...startInputProps,
8610
- id: controlId,
8611
- "data-status": status,
8612
- "data-variant": variant,
8613
- className: cx(
8614
- prefix("date-range-input"),
8615
- prefix("date-range-input--start"),
8616
- startInputProps?.className
8617
- ),
8618
- value: formattedValue.start,
8619
- placeholder: startInputProps?.placeholder ?? startPlaceholder ?? placeholder,
8620
- required: required || startInputProps?.required,
8621
- disabled: disabled || startInputProps?.disabled,
8622
- readOnly: readOnly || startInputProps?.readOnly,
8623
- onChange: combineEventHandlers(
8624
- startInputProps?.onChange,
8625
- handleStartInputChange
8626
- ),
8627
- onFocus: combineEventHandlers(
8628
- startInputProps?.onFocus,
8629
- handleInputFocus("start")
8630
- ),
8631
- onBlur: combineEventHandlers(
8632
- startInputProps?.onBlur,
8633
- handleControlBlur
8634
- ),
8635
- style: { ...cssVars, ...startInputProps?.style },
8636
- ...dataAttrs,
8637
- "aria-invalid": status === "invalid" ? "true" : void 0,
8638
- "aria-labelledby": mergeAriaIds(
8639
- dataTableColumnLabelId,
8640
- labelId,
8641
- startInputLabelId,
8642
- startInputProps?.["aria-labelledby"]
8643
- ),
8644
- "aria-describedby": mergeAriaIds(
8645
- codeId,
8646
- errorMessageIds,
8647
- descriptionIds,
8648
- formatDescriptionId,
8649
- startInputProps?.["aria-describedby"]
8650
- ),
8651
- ref: combinedStartInputRef
8652
- }
8653
- ),
8654
- hasStartClearButton && /* @__PURE__ */ jsx(
8655
- CloseButton,
8656
- {
8657
- size: "sm",
8658
- label: clearButtonsLabel,
8659
- tabIndex: -1,
8660
- ...startClearButtonProps,
8661
- className: cx(
8662
- prefix("date-range-input__clear-button"),
8663
- prefix("date-range-input__clear-button--start"),
8664
- printHidden,
8665
- startClearButtonProps?.className
8666
- ),
8667
- onClick: combineEventHandlers(
8668
- startClearButtonProps?.onClick,
8669
- handleClearButtonClick(startInputRef),
8670
- { 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
+ }
8671
8734
  ),
8672
- ref: combinedStartClearButtonRef
8673
- }
8674
- ),
8675
- startLoading && /* @__PURE__ */ jsx(
8676
- Spinner,
8677
- {
8678
- color: controlStatusToAccent(status, "neutral"),
8679
- "data-disabled": boolDataAttr(
8680
- 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
+ }
8681
8755
  ),
8682
- ...spinnerProps,
8683
- className: cx(
8684
- prefix("date-range-input__spinner"),
8685
- prefix("date-range-input__spinner--start"),
8686
- 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
+ }
8687
8770
  )
8688
- }
8689
- )
8690
- ]
8691
- }
8692
- ),
8693
- /* @__PURE__ */ jsx(ControlAddon, { className: cx(prefix("date-range-input__arrow")), children: /* @__PURE__ */ jsx(Icon, { icon: faArrowRight }) }),
8694
- /* @__PURE__ */ jsxs(
8695
- "div",
8696
- {
8697
- "data-focused": boolDataAttr(
8698
- !disabled && !endInputProps?.disabled && popoverState.open && selectionMode === "end"
8699
- ),
8700
- "data-status": status,
8701
- "data-accent": controlStatusToAccent(status),
8702
- "data-variant": variant,
8703
- "data-disabled": boolDataAttr(
8704
- disabled || startInputProps?.disabled && endInputProps?.disabled
8705
- ),
8706
- "data-readonly": boolDataAttr(
8707
- readOnly || startInputProps?.readOnly && endInputProps?.readOnly
8708
- ),
8709
- ...endContainerProps,
8710
- className: cx(
8711
- prefix("date-range-input__container"),
8712
- prefix("date-range-input__container--end"),
8713
- endContainerProps?.className
8714
- ),
8715
- onPointerDown: combineEventHandlers(
8716
- endContainerProps?.onPointerDown,
8717
- handleContainerPointerDown("end")
8771
+ ]
8772
+ }
8718
8773
  ),
8719
- ref: combinedEndContainerRef,
8720
- children: [
8721
- /* @__PURE__ */ jsx(
8722
- "input",
8723
- {
8724
- ...endInputProps,
8725
- "data-status": status,
8726
- "data-variant": variant,
8727
- className: cx(
8728
- prefix("date-range-input"),
8729
- prefix("date-range-input--end"),
8730
- endInputProps?.className
8731
- ),
8732
- value: formattedValue.end,
8733
- placeholder: endInputProps?.placeholder ?? endPlaceholder ?? placeholder,
8734
- required: required || endInputProps?.required,
8735
- disabled: disabled || endInputProps?.disabled,
8736
- readOnly: readOnly || endInputProps?.readOnly,
8737
- onChange: combineEventHandlers(
8738
- endInputProps?.onChange,
8739
- handleEndInputChange
8740
- ),
8741
- onFocus: combineEventHandlers(
8742
- endInputProps?.onFocus,
8743
- handleInputFocus("end")
8744
- ),
8745
- onBlur: combineEventHandlers(
8746
- endInputProps?.onBlur,
8747
- handleControlBlur
8748
- ),
8749
- style: { ...cssVars, ...endInputProps?.style },
8750
- ...dataAttrs,
8751
- "aria-invalid": status === "invalid" ? "true" : void 0,
8752
- "aria-labelledby": mergeAriaIds(
8753
- dataTableColumnLabelId,
8754
- labelId,
8755
- endInputLabelId,
8756
- endInputProps?.["aria-labelledby"]
8757
- ),
8758
- "aria-describedby": mergeAriaIds(
8759
- codeId,
8760
- errorMessageIds,
8761
- descriptionIds,
8762
- formatDescriptionId,
8763
- endInputProps?.["aria-describedby"]
8764
- ),
8765
- ref: combinedEndInputRef
8766
- }
8767
- ),
8768
- hasEndClearButton && /* @__PURE__ */ jsx(
8769
- CloseButton,
8770
- {
8771
- size: "sm",
8772
- label: clearButtonsLabel,
8773
- tabIndex: -1,
8774
- ...endClearButtonProps,
8775
- className: cx(
8776
- prefix("date-range-input__clear-button"),
8777
- prefix("date-range-input__clear-button--end"),
8778
- printHidden,
8779
- endClearButtonProps?.className
8780
- ),
8781
- onClick: combineEventHandlers(
8782
- endClearButtonProps?.onClick,
8783
- handleClearButtonClick(endInputRef),
8784
- { 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
+ }
8785
8848
  ),
8786
- ref: combinedEndClearButtonRef
8787
- }
8788
- ),
8789
- endLoading && /* @__PURE__ */ jsx(
8790
- Spinner,
8791
- {
8792
- color: controlStatusToAccent(status, "neutral"),
8793
- "data-disabled": boolDataAttr(
8794
- 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
+ }
8795
8869
  ),
8796
- ...spinnerProps,
8797
- className: cx(
8798
- prefix("date-range-input__spinner"),
8799
- prefix("date-range-input__spinner--end"),
8800
- 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
+ }
8801
8884
  )
8802
- }
8803
- )
8804
- ]
8805
- }
8806
- ),
8807
- endAdornment,
8808
- /* @__PURE__ */ jsx(ControlAddon, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(
8809
- "button",
8810
- {
8811
- "aria-label": calendarButtonLabel?.(
8812
- fullFormattedValue,
8813
- !disabled && !readOnly
8814
- ),
8815
- onClick: handleAddonButtonClick,
8816
- onBlur: handleControlBlur,
8817
- "data-state": void 0,
8818
- className: cx(
8819
- prefix("date-range-input__calendar-button"),
8820
- printHidden
8885
+ ]
8886
+ }
8821
8887
  ),
8822
- ref: addonButtonRef,
8823
- children: /* @__PURE__ */ jsx(Icon, { icon: faCalendar })
8824
- }
8825
- ) }) })
8826
- ]
8827
- }
8828
- ),
8829
- /* @__PURE__ */ jsx(
8830
- PopoverContent,
8831
- {
8832
- ...popoverContentProps,
8833
- className: cx(
8834
- prefix("date-range-input__popover"),
8835
- popoverContentProps?.className
8836
- ),
8837
- side: popoverContentProps?.side ?? "bottom",
8838
- sideOffset: popoverContentProps?.sideOffset ?? 5,
8839
- showArrow: popoverContentProps?.showArrow ?? false,
8840
- onOpenAutoFocus: combineEventHandlers(
8841
- popoverContentProps?.onOpenAutoFocus,
8842
- handlePopoverOpenAutoFocus
8843
- ),
8844
- onEscapeKeyDown: combineEventHandlers(
8845
- popoverContentProps?.onEscapeKeyDown,
8846
- handlePopoverEscapeKeyDown
8847
- ),
8848
- onPointerDownOutside: combineEventHandlers(
8849
- popoverContentProps?.onPointerDownOutside,
8850
- handlePopoverPointerDownOutside
8851
- ),
8852
- onInteractOutside: combineEventHandlers(
8853
- popoverContentProps?.onInteractOutside,
8854
- handlePopoverInteractOutside
8855
- ),
8856
- onBlur: combineEventHandlers(
8857
- popoverContentProps?.onBlur,
8858
- 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
+ }
8859
8909
  ),
8860
- ref: combinedPopoverRef,
8861
- children: /* @__PURE__ */ jsx(
8862
- DateRangePicker,
8910
+ /* @__PURE__ */ jsx(
8911
+ PopoverContent,
8863
8912
  {
8913
+ ...popoverContentProps,
8864
8914
  className: cx(
8865
- prefix("date-range-input__picker"),
8866
- dateRangePickerProps?.className
8915
+ prefix("date-range-input__popover"),
8916
+ popoverContentProps?.className
8867
8917
  ),
8868
- ...dateRangePickerProps,
8869
- value: deferredDateValue,
8870
- onChange: combineEventHandlers(
8871
- dateRangePickerProps?.onChange,
8872
- handleDatePickerChange
8918
+ side: popoverContentProps?.side ?? "bottom",
8919
+ sideOffset: popoverContentProps?.sideOffset ?? 5,
8920
+ showArrow: popoverContentProps?.showArrow ?? false,
8921
+ onOpenAutoFocus: combineEventHandlers(
8922
+ popoverContentProps?.onOpenAutoFocus,
8923
+ handlePopoverOpenAutoFocus
8873
8924
  ),
8874
- selectionMode,
8875
- month,
8876
- onMonthChange: handleMonthChange,
8877
- disabled: disabled || readOnly || (startInputProps?.disabled || startInputProps?.readOnly) && (endInputProps?.disabled || endInputProps?.readOnly) || dateRangePickerProps?.disabled,
8878
- minDate,
8879
- maxDate,
8880
- minMonth,
8881
- maxMonth,
8882
- minYear,
8883
- maxYear,
8884
- locale: dateFnsLocale,
8885
- monthSelectProps: {
8886
- ...dateRangePickerProps?.monthSelectProps,
8887
- popoverProps: {
8888
- ...dateRangePickerProps?.monthSelectProps?.popoverProps,
8889
- ref: monthSelectMenuRef
8890
- }
8891
- },
8892
- yearSelectProps: {
8893
- ...dateRangePickerProps?.yearSelectProps,
8894
- popoverProps: {
8895
- ...dateRangePickerProps?.yearSelectProps?.popoverProps,
8896
- 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
+ }
8897
8980
  }
8898
- }
8981
+ )
8899
8982
  }
8900
8983
  )
8901
- }
8902
- )
8903
- ] })
8904
- ]
8984
+ ] })
8985
+ ]
8986
+ }
8987
+ )
8905
8988
  }
8906
- ) }) });
8989
+ ) });
8907
8990
  });
8908
8991
  const DropdownMenu = DropdownMenu$1.Root;
8909
8992
  const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
@@ -8911,11 +8994,12 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8911
8994
  defaultChecked,
8912
8995
  checked: controlledChecked,
8913
8996
  onCheckedChange,
8997
+ onSelect,
8914
8998
  color,
8915
8999
  disabled,
8916
9000
  loading,
8917
- enabledWhenLoading,
8918
9001
  loadingContent,
9002
+ showSpinner,
8919
9003
  iconPlacement,
8920
9004
  actionProps,
8921
9005
  contentProps,
@@ -8932,10 +9016,22 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8932
9016
  );
8933
9017
  const handleCheckedChange = useCallback(
8934
9018
  (checked2) => {
8935
- onCheckedChange?.(checked2);
8936
- 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);
8937
9033
  },
8938
- [onCheckedChange, setChecked]
9034
+ [loading, onSelect]
8939
9035
  );
8940
9036
  return /* @__PURE__ */ jsx(
8941
9037
  MenuListItem,
@@ -8944,8 +9040,8 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8944
9040
  color,
8945
9041
  disabled,
8946
9042
  loading,
8947
- enabledWhenLoading,
8948
9043
  loadingContent,
9044
+ showSpinner,
8949
9045
  iconPlacement,
8950
9046
  actionProps,
8951
9047
  contentProps,
@@ -8969,6 +9065,7 @@ const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckboxItem2({
8969
9065
  {
8970
9066
  checked,
8971
9067
  onCheckedChange: handleCheckedChange,
9068
+ onSelect: handleSelect,
8972
9069
  disabled,
8973
9070
  ...otherProps,
8974
9071
  className: cx(prefix("dropdown-menu__checkbox-item"), className),
@@ -9065,8 +9162,8 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9065
9162
  color,
9066
9163
  disabled,
9067
9164
  loading,
9068
- enabledWhenLoading,
9069
9165
  loadingContent,
9166
+ showSpinner,
9070
9167
  icon,
9071
9168
  iconPlacement,
9072
9169
  href,
@@ -9080,11 +9177,19 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9080
9177
  ...otherProps
9081
9178
  }, forwardedRef) {
9082
9179
  const prefix = usePrefix();
9083
- const handleSelect = useCallback(() => {
9084
- if (asLink) {
9085
- window.open(href, target, rel?.split(" ").join(","));
9086
- }
9087
- }, [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
+ );
9088
9193
  return /* @__PURE__ */ jsx(
9089
9194
  MenuListItem,
9090
9195
  {
@@ -9093,8 +9198,8 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9093
9198
  color,
9094
9199
  disabled,
9095
9200
  loading,
9096
- enabledWhenLoading,
9097
9201
  loadingContent,
9202
+ showSpinner,
9098
9203
  icon,
9099
9204
  iconPlacement,
9100
9205
  href,
@@ -9108,11 +9213,9 @@ const DropdownMenuItem = forwardRef(function DropdownMenuItem2({
9108
9213
  children: /* @__PURE__ */ jsx(
9109
9214
  DropdownMenu$1.Item,
9110
9215
  {
9111
- disabled: disabled || loading && !enabledWhenLoading,
9216
+ disabled,
9112
9217
  ...otherProps,
9113
- onSelect: combineEventHandlers(onSelect, handleSelect, {
9114
- checkDefaultPrevented: true
9115
- }),
9218
+ onSelect: handleSelect,
9116
9219
  className: cx(prefix("dropdown-menu__item"), className),
9117
9220
  ref: forwardedRef
9118
9221
  }
@@ -9142,11 +9245,12 @@ const DropdownMenuRadioGroup = forwardRef(function DropdownMenuRadioGroup2({ lab
9142
9245
  });
9143
9246
  const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9144
9247
  showRadio = true,
9248
+ onSelect,
9145
9249
  color,
9146
9250
  disabled,
9147
9251
  loading,
9148
- enabledWhenLoading,
9149
9252
  loadingContent,
9253
+ showSpinner,
9150
9254
  iconPlacement,
9151
9255
  actionProps,
9152
9256
  contentProps,
@@ -9157,6 +9261,16 @@ const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9157
9261
  ...otherProps
9158
9262
  }, forwardedRef) {
9159
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
+ );
9160
9274
  return /* @__PURE__ */ jsx(
9161
9275
  MenuListItem,
9162
9276
  {
@@ -9164,8 +9278,8 @@ const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9164
9278
  color,
9165
9279
  disabled,
9166
9280
  loading,
9167
- enabledWhenLoading,
9168
9281
  loadingContent,
9282
+ showSpinner,
9169
9283
  iconPlacement,
9170
9284
  actionProps,
9171
9285
  contentProps,
@@ -9187,6 +9301,7 @@ const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem2({
9187
9301
  DropdownMenu$1.RadioItem,
9188
9302
  {
9189
9303
  disabled,
9304
+ onSelect: handleSelect,
9190
9305
  className: cx(prefix("dropdown-menu__radio-item"), className),
9191
9306
  ref: forwardedRef,
9192
9307
  ...otherProps
@@ -9481,8 +9596,8 @@ const FieldGroup = forwardRef(
9481
9596
  function FieldGroup2({
9482
9597
  asChild,
9483
9598
  className,
9599
+ "aria-label": ariaLabel,
9484
9600
  "aria-labelledby": ariaLabelledBy,
9485
- "aria-describedby": ariaDescribedBy,
9486
9601
  ...otherProps
9487
9602
  }, forwardedRef) {
9488
9603
  const prefix = usePrefix();
@@ -9495,8 +9610,8 @@ const FieldGroup = forwardRef(
9495
9610
  className: cx(prefix("field-group"), className),
9496
9611
  role: "group",
9497
9612
  ...otherProps,
9498
- "aria-labelledby": mergeAriaIds(titleId, ariaLabelledBy),
9499
- "aria-describedby": mergeAriaIds(codeId, ariaDescribedBy),
9613
+ "aria-label": ariaLabel,
9614
+ "aria-labelledby": ariaLabelledBy ?? (ariaLabel === void 0 ? combineAriaIds(codeId, titleId) : void 0),
9500
9615
  ref: forwardedRef
9501
9616
  }
9502
9617
  ) });
@@ -9537,7 +9652,7 @@ const FieldGroupHeader = forwardRef(function FieldGroupHeader2({
9537
9652
  As,
9538
9653
  {
9539
9654
  className: cx(prefix("field-group__header"), className),
9540
- "data-has-code": boolDataAttr(!!code),
9655
+ "data-has-code": boolDataAttr(Boolean(code)),
9541
9656
  ...otherProps,
9542
9657
  ref: forwardedRef,
9543
9658
  children: [
@@ -9937,7 +10052,7 @@ function transformOptions({
9937
10052
  ...otherOptions
9938
10053
  };
9939
10054
  }
9940
- const NumericInput = forwardRef(function DateInput3({
10055
+ const NumericInput = forwardRef(function NumericInput2({
9941
10056
  defaultValue,
9942
10057
  value,
9943
10058
  valueIsUnformattedString = false,
@@ -10103,7 +10218,7 @@ function validateNumericProps({
10103
10218
  }
10104
10219
  }
10105
10220
  function valueNeedsTransformation(value, valueIsUnformattedString, valueIsInteger, scale) {
10106
- return value != null && valueIsInteger && !!scale && (typeof value !== "string" || valueIsUnformattedString);
10221
+ return value != null && valueIsInteger && Boolean(scale) && (typeof value !== "string" || valueIsUnformattedString);
10107
10222
  }
10108
10223
  function transformIntegerValueWithScale(value, scale) {
10109
10224
  const stringValue = numericToString(value);
@@ -10123,16 +10238,27 @@ function transformNumberFormatValues({ formattedValue, value, floatValue }, valu
10123
10238
  return { formattedValue, stringValue, numberValue: +stringValue };
10124
10239
  }
10125
10240
  const Output = forwardRef(
10126
- function Output2({ className, children, ...otherProps }, forwardedRef) {
10241
+ function Output2({
10242
+ pending,
10243
+ pendingContent,
10244
+ showSpinner = pending,
10245
+ children,
10246
+ className,
10247
+ ...otherProps
10248
+ }, forwardedRef) {
10127
10249
  const prefix = usePrefix();
10128
10250
  return /* @__PURE__ */ jsx(
10129
10251
  Input,
10130
10252
  {
10253
+ showSpinner,
10254
+ "aria-busy": pending || void 0,
10255
+ "aria-disabled": void 0,
10256
+ "aria-invalid": void 0,
10131
10257
  ...otherProps,
10132
10258
  className: cx(prefix("output"), className),
10133
10259
  readOnly: true,
10134
10260
  asChild: true,
10135
- children: /* @__PURE__ */ jsx("output", { ref: forwardedRef, children })
10261
+ children: /* @__PURE__ */ jsx("output", { ref: forwardedRef, children: pending ? pendingContent || children : children })
10136
10262
  }
10137
10263
  );
10138
10264
  }
@@ -10142,6 +10268,8 @@ const Radio = forwardRef(function Radio2({
10142
10268
  status,
10143
10269
  code,
10144
10270
  loading,
10271
+ loadingDescription,
10272
+ showSpinner = loading,
10145
10273
  children,
10146
10274
  rootProps,
10147
10275
  codeProps,
@@ -10151,18 +10279,34 @@ const Radio = forwardRef(function Radio2({
10151
10279
  id,
10152
10280
  disabled,
10153
10281
  readOnly,
10282
+ onClick,
10154
10283
  className,
10155
- "aria-describedby": ariaDescribedBy,
10284
+ "aria-label": ariaLabel,
10285
+ "aria-labelledby": ariaLabelledBy,
10156
10286
  ...otherProps
10157
10287
  }, forwardedRef) {
10158
10288
  const prefix = usePrefix();
10289
+ const [locale7] = useLocale();
10290
+ loadingDescription ??= locale7.Input.loadingDescription;
10159
10291
  const controlContext = useControlContext();
10160
10292
  const generatedId = useId();
10161
- const radioId = id ?? prefix(`radio-${generatedId}`);
10162
- 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}`);
10163
10297
  status = controlContext?.status ?? status;
10164
10298
  disabled = controlContext?.disabled || disabled;
10299
+ loading = controlContext?.loading || loading;
10165
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);
10166
10310
  return /* @__PURE__ */ jsxs(
10167
10311
  "div",
10168
10312
  {
@@ -10170,7 +10314,7 @@ const Radio = forwardRef(function Radio2({
10170
10314
  ...rootProps,
10171
10315
  className: cx(prefix("radio__root"), rootProps?.className),
10172
10316
  children: [
10173
- code && /* @__PURE__ */ jsx(
10317
+ codeId && /* @__PURE__ */ jsx(
10174
10318
  ControlCode,
10175
10319
  {
10176
10320
  status,
@@ -10183,19 +10327,19 @@ const Radio = forwardRef(function Radio2({
10183
10327
  /* @__PURE__ */ jsx(
10184
10328
  RadioGroup$1.Item,
10185
10329
  {
10186
- id: radioId,
10330
+ id: controlId,
10187
10331
  className: cx(prefix("radio"), className),
10188
10332
  value: value?.toString() ?? "",
10189
10333
  disabled,
10334
+ "data-loading": boolDataAttr(loading),
10190
10335
  "data-readonly": boolDataAttr(readOnly),
10191
- "aria-readonly": readOnly ? "true" : void 0,
10192
10336
  "data-status": status,
10193
- "aria-describedby": mergeAriaIds(
10194
- code != null ? codeId : void 0,
10195
- ariaDescribedBy
10196
- ),
10197
- 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),
10198
10340
  ...otherProps,
10341
+ onClick: combineEventHandlers(onClick, handleClick),
10342
+ ref: forwardedRef,
10199
10343
  children: /* @__PURE__ */ jsx(
10200
10344
  RadioGroup$1.Indicator,
10201
10345
  {
@@ -10205,12 +10349,13 @@ const Radio = forwardRef(function Radio2({
10205
10349
  )
10206
10350
  }
10207
10351
  ),
10208
- children && /* @__PURE__ */ jsx(
10352
+ labelId && /* @__PURE__ */ jsx(
10209
10353
  Label,
10210
10354
  {
10211
- htmlFor: radioId,
10355
+ htmlFor: controlId,
10212
10356
  "data-status": status,
10213
10357
  ...labelProps,
10358
+ id: labelId,
10214
10359
  className: cx(prefix("radio__label"), labelProps?.className),
10215
10360
  containerProps: {
10216
10361
  ...labelProps?.containerProps,
@@ -10222,15 +10367,16 @@ const Radio = forwardRef(function Radio2({
10222
10367
  children
10223
10368
  }
10224
10369
  ),
10225
- loading && /* @__PURE__ */ jsx(
10370
+ showSpinner && /* @__PURE__ */ jsx(
10226
10371
  Spinner,
10227
10372
  {
10228
10373
  "data-status": status,
10229
- "data-disabled": boolDataAttr(disabled),
10374
+ "data-disabled": boolDataAttr(disabled || loading),
10230
10375
  ...spinnerProps,
10231
- className: cx(prefix("checkbox__spinner"), spinnerProps?.className)
10376
+ className: cx(prefix("radio__spinner"), spinnerProps?.className)
10232
10377
  }
10233
- )
10378
+ ),
10379
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
10234
10380
  ]
10235
10381
  }
10236
10382
  );
@@ -10243,6 +10389,8 @@ const RadioGroup = forwardRef(function RadioGroup2({
10243
10389
  variant,
10244
10390
  status,
10245
10391
  loading,
10392
+ loadingDescription,
10393
+ showSpinner = loading,
10246
10394
  code,
10247
10395
  showClearButton,
10248
10396
  clearButtonLabel,
@@ -10258,6 +10406,7 @@ const RadioGroup = forwardRef(function RadioGroup2({
10258
10406
  readOnly,
10259
10407
  className,
10260
10408
  children,
10409
+ "aria-label": ariaLabel,
10261
10410
  "aria-labelledby": ariaLabelledBy,
10262
10411
  "aria-describedby": ariaDescribedBy,
10263
10412
  onFocus,
@@ -10267,6 +10416,7 @@ const RadioGroup = forwardRef(function RadioGroup2({
10267
10416
  }, forwardedRef) {
10268
10417
  const prefix = usePrefix();
10269
10418
  const [locale7] = useLocale();
10419
+ loadingDescription ??= locale7.Input.loadingDescription;
10270
10420
  clearButtonLabel ??= locale7.Input.clearButtonLabel;
10271
10421
  const labelId = useFieldLabelId();
10272
10422
  const dataTableColumnLabelId = useDataTableColumnLabelId();
@@ -10276,25 +10426,26 @@ const RadioGroup = forwardRef(function RadioGroup2({
10276
10426
  defaultValue ?? "",
10277
10427
  controlledValue
10278
10428
  );
10279
- const { controlId, codeId } = useSetFieldControl(
10429
+ const { generatedId, controlId, codeId } = useSetFieldControl(
10280
10430
  id,
10281
10431
  "DIV",
10282
10432
  codeProps?.id,
10283
- !!code,
10433
+ Boolean(code),
10284
10434
  required
10285
10435
  );
10436
+ const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
10286
10437
  const radioGroupRef = useRef(null);
10287
10438
  const isInTableCell = useIsInTableCell();
10288
10439
  inline ??= isInTableCell;
10289
10440
  variant ??= isInTableCell ? "cell" : "default";
10290
10441
  const handleValueChange = useCallback(
10291
10442
  (value2) => {
10292
- if (!readOnly) {
10443
+ if (!loading && !readOnly) {
10293
10444
  setValue(value2);
10294
10445
  onValueChange?.(value2);
10295
10446
  }
10296
10447
  },
10297
- [onValueChange, readOnly, setValue]
10448
+ [loading, onValueChange, readOnly, setValue]
10298
10449
  );
10299
10450
  const setFieldControlFocused = useSetFieldControlFocused();
10300
10451
  const handleControlFocus = useCallback(() => {
@@ -10313,7 +10464,7 @@ const RadioGroup = forwardRef(function RadioGroup2({
10313
10464
  handleValueChange("");
10314
10465
  radioGroupRef.current?.focus();
10315
10466
  }, [handleValueChange]);
10316
- 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);
10317
10468
  const handleKeyDown = useCallback(
10318
10469
  (evt) => {
10319
10470
  if (hasClearButton && (evt.code === "Delete" || evt.code === "Backspace")) {
@@ -10323,123 +10474,128 @@ const RadioGroup = forwardRef(function RadioGroup2({
10323
10474
  [handleClearButtonClick, hasClearButton]
10324
10475
  );
10325
10476
  const combinedRadioGroupRef = useCombinedRef(radioGroupRef, forwardedRef);
10326
- return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(ControlContext.Provider, { value: { variant, status, disabled, readOnly }, children: /* @__PURE__ */ jsxs(
10327
- RadioGroup$1.Root,
10477
+ return /* @__PURE__ */ jsx(ClearContexts, { children: /* @__PURE__ */ jsx(
10478
+ ControlContext.Provider,
10328
10479
  {
10329
- value,
10330
- onValueChange: handleValueChange,
10331
- id: controlId,
10332
- "data-status": status,
10333
- "data-accent": controlStatusToAccent(status),
10334
- "data-variant": variant,
10335
- required,
10336
- disabled,
10337
- className: cx(
10338
- prefix("radio-group"),
10339
- inline && prefix("radio-group--inline"),
10340
- className
10341
- ),
10342
- "aria-readonly": readOnly ? "true" : void 0,
10343
- "aria-labelledby": mergeAriaIds(
10344
- dataTableColumnLabelId,
10345
- labelId,
10346
- ariaLabelledBy
10347
- ),
10348
- "aria-describedby": mergeAriaIds(
10349
- codeId,
10350
- errorMessageIds,
10351
- descriptionIds,
10352
- ariaDescribedBy
10353
- ),
10354
- onFocus: combineEventHandlers(onFocus, handleControlFocus),
10355
- onBlur: combineEventHandlers(onBlur, handleControlBlur),
10356
- onKeyDown: combineEventHandlers(onKeyDown, handleKeyDown),
10357
- ...otherProps,
10358
- ref: combinedRadioGroupRef,
10359
- children: [
10360
- code && /* @__PURE__ */ jsx(
10361
- ControlCode,
10362
- {
10363
- status,
10364
- ...codeProps,
10365
- id: codeId,
10366
- className: cx(prefix("radio-group__code"), codeProps?.className),
10367
- children: code
10368
- }
10369
- ),
10370
- /* @__PURE__ */ jsx(
10371
- "div",
10372
- {
10373
- "data-status": status,
10374
- "data-variant": variant,
10375
- "data-disabled": boolDataAttr(disabled),
10376
- "data-readonly": boolDataAttr(readOnly),
10377
- ...containerProps,
10378
- className: cx(
10379
- prefix("radio-group__container"),
10380
- 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
+ }
10381
10522
  ),
10382
- children: /* @__PURE__ */ jsx(ClearContexts, { children })
10383
- }
10384
- ),
10385
- (hasClearButton || loading) && /* @__PURE__ */ jsxs(
10386
- "div",
10387
- {
10388
- "data-status": status,
10389
- "data-variant": variant,
10390
- "data-disabled": boolDataAttr(disabled),
10391
- "data-readonly": boolDataAttr(readOnly),
10392
- ...endContainerProps,
10393
- className: cx(
10394
- prefix("checkbox-group__end-container"),
10395
- 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
+ }
10396
10537
  ),
10397
- children: [
10398
- hasClearButton && /* @__PURE__ */ jsx(
10399
- CloseButton,
10400
- {
10401
- size: "sm",
10402
- label: clearButtonLabel,
10403
- tabIndex: -1,
10404
- circle: true,
10405
- ...clearButtonProps,
10406
- className: cx(
10407
- prefix("radio-group__clear-button"),
10408
- clearButtonProps?.className
10409
- ),
10410
- onClick: combineEventHandlers(
10411
- clearButtonProps?.onClick,
10412
- handleClearButtonClick,
10413
- { checkDefaultPrevented: true }
10414
- ),
10415
- onFocus: combineEventHandlers(
10416
- clearButtonProps?.onFocus,
10417
- 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
+ }
10418
10577
  ),
10419
- onBlur: combineEventHandlers(
10420
- clearButtonProps?.onBlur,
10421
- handleControlBlur
10422
- )
10423
- }
10424
- ),
10425
- loading && /* @__PURE__ */ jsx(
10426
- Spinner,
10427
- {
10428
- color: controlStatusToAccent(status, "neutral"),
10429
- "data-disabled": boolDataAttr(disabled),
10430
- ...spinnerProps,
10431
- className: cx(
10432
- prefix("checkbox-group__spinner"),
10433
- 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
+ }
10434
10589
  )
10435
- }
10436
- )
10437
- ]
10438
- }
10439
- )
10440
- ]
10590
+ ]
10591
+ }
10592
+ ),
10593
+ loadingDescriptionId && /* @__PURE__ */ jsx(VisuallyHidden, { id: loadingDescriptionId, children: loadingDescription })
10594
+ ]
10595
+ }
10596
+ )
10441
10597
  }
10442
- ) }) });
10598
+ ) });
10443
10599
  });
10444
10600
  const Separator = forwardRef(function Separator2({ className, ...otherProps }, forwardedRef) {
10445
10601
  const prefix = usePrefix();
@@ -10899,7 +11055,7 @@ function TabListScrollButton({ side, onClick }) {
10899
11055
  disabled,
10900
11056
  onClick,
10901
11057
  tabIndex: -1,
10902
- "aria-hidden": "true"
11058
+ "aria-hidden": true
10903
11059
  }
10904
11060
  );
10905
11061
  }
@@ -11088,7 +11244,7 @@ function useIntersectionObserver(element, onIntersectionEntryChange, options) {
11088
11244
  }
11089
11245
  }, [element, onIntersectionEntryChange, options]);
11090
11246
  }
11091
- const MONKEY_PATCHED_HISTORY = Symbol.for("ostack-ui.monkeyPatchedHistory");
11247
+ const MONKEY_PATCHED_HISTORY = /* @__PURE__ */ Symbol.for("ostack-ui.monkeyPatchedHistory");
11092
11248
  const HISTORY_EVENT_TYPES = [
11093
11249
  "popstate",
11094
11250
  "hashchange",
@@ -11375,6 +11531,7 @@ export {
11375
11531
  VisuallyHidden,
11376
11532
  boolDataAttr,
11377
11533
  buildErrorReport,
11534
+ combineAriaIds,
11378
11535
  combineEventHandlers,
11379
11536
  compare,
11380
11537
  compareNumericStrings,
@@ -11389,7 +11546,6 @@ export {
11389
11546
  ignoreFormControlsKeyboardShortcut,
11390
11547
  isNumericStringNegative,
11391
11548
  matchAgainstFilter,
11392
- mergeAriaIds,
11393
11549
  navigate,
11394
11550
  normalizeNumericString,
11395
11551
  numericStringFloatToInt,
@@ -11403,6 +11559,7 @@ export {
11403
11559
  registerKeyboardShortcut,
11404
11560
  setBoolDataAttr,
11405
11561
  setDefaultPrefix,
11562
+ setNativeProperty,
11406
11563
  stableSort,
11407
11564
  stringHash,
11408
11565
  useAlertDialog,