@aircall/ds 0.39.0 → 0.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -639,7 +639,7 @@ declare namespace AlertDialogCancel {
639
639
  * default `default`) sets the background, border, and icon colour scheme.
640
640
  */
641
641
  declare const alertVariants: (props?: ({
642
- variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
642
+ variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
643
643
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
644
644
  /**
645
645
  * Callout that draws attention to an important, contextual message.
@@ -1025,7 +1025,7 @@ declare namespace BadgeGroupCount {
1025
1025
  * edge gets the accent border.
1026
1026
  */
1027
1027
  declare const bannerVariants: (props?: ({
1028
- variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
1028
+ variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
1029
1029
  borderDirection?: "bottom" | "top" | null | undefined;
1030
1030
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1031
1031
  /**
@@ -6105,6 +6105,10 @@ declare namespace Slider {
6105
6105
  * next-themes and applying DS icons and variant styles (info / success / error / warning).
6106
6106
  * Mount once near the app root; trigger toasts via the exported `toast` function.
6107
6107
  *
6108
+ * Portals itself into `document.body` - see the note on the implementation below. That means
6109
+ * it can be mounted anywhere in the tree without its toasts being clipped or painted behind
6110
+ * a modal, so "near the app root" is a tidiness preference rather than a correctness one.
6111
+ *
6108
6112
  * @example
6109
6113
  * ```tsx
6110
6114
  * <Toaster position="bottom-right" />
@@ -6112,7 +6116,7 @@ declare namespace Slider {
6112
6116
  * toast.success('Saved');
6113
6117
  * ```
6114
6118
  */
6115
- declare const Toaster: (componentProps: Toaster.Props) => React.JSX.Element;
6119
+ declare const Toaster: (componentProps: Toaster.Props) => React.ReactPortal | null;
6116
6120
  declare namespace Toaster {
6117
6121
  type Props = ToasterProps;
6118
6122
  }
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ import { flip, offset, shift, useFloatingToolbar, useFloatingToolbarState } from
57
57
  import { ListStyleType } from "@platejs/list";
58
58
  import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
59
59
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
60
+ import { createPortal } from "react-dom";
60
61
  import { Toaster as Toaster$1, toast } from "sonner";
61
62
  import { Switch as Switch$1 } from "@base-ui/react/switch";
62
63
  import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
@@ -4318,6 +4319,7 @@ function DataCombobox(componentProps) {
4318
4319
  const { items, getItemValue, getItemLabel, renderItem, renderChip, getGroupKey, getGroupLabel, selectionMode = "single", selectedKeys, defaultSelectedKeys, onSelectionChange, onOpenChange, open, selectedItems, disabledKeys, loadingState, skeletonCount, onSearch, onFetchMore, hasMore = false, emptyState, trigger, searchable = true, placeholder, disabled = false, className, contentClassName, anchor, "aria-label": ariaLabel, listAriaLabel, showClear = true, estimateRowHeight } = componentProps;
4319
4320
  const multiple = selectionMode === "multiple";
4320
4321
  const isSearchable = resolveSearchable(searchable, !!onSearch, items.length);
4322
+ const clientFilter = !isSearchable || onSearch || onFetchMore && hasMore ? null : void 0;
4321
4323
  const autoVirtualizeLatch = React.useRef(false);
4322
4324
  if (!autoVirtualizeLatch.current) autoVirtualizeLatch.current = shouldAutoVirtualize(!!onFetchMore, items.length);
4323
4325
  const virtualizeRows = resolveVirtualizeRows(componentProps.virtualizeRows, autoVirtualizeLatch.current, !!getGroupKey);
@@ -4373,7 +4375,7 @@ function DataCombobox(componentProps) {
4373
4375
  onItemHighlighted: (_item, details) => scrollHighlightedRowIntoView(scrollRowIntoViewRef, details.index, details.reason),
4374
4376
  items: groups !== null && groups !== void 0 ? groups : items,
4375
4377
  disabled,
4376
- filter: onSearch || onFetchMore && hasMore ? null : void 0,
4378
+ filter: clientFilter,
4377
4379
  value: selectedObjects,
4378
4380
  onValueChange: commit,
4379
4381
  itemToStringValue: getItemValue,
@@ -4402,7 +4404,7 @@ function DataCombobox(componentProps) {
4402
4404
  onItemHighlighted: (_item, details) => scrollHighlightedRowIntoView(scrollRowIntoViewRef, details.index, details.reason),
4403
4405
  items: groups !== null && groups !== void 0 ? groups : items,
4404
4406
  disabled,
4405
- filter: onSearch || onFetchMore && hasMore ? null : void 0,
4407
+ filter: clientFilter,
4406
4408
  value: (_selectedObjects$ = selectedObjects[0]) !== null && _selectedObjects$ !== void 0 ? _selectedObjects$ : null,
4407
4409
  onValueChange: (next, details) => commit(next == null ? [] : [next], details),
4408
4410
  itemToStringValue: getItemValue,
@@ -12822,6 +12824,10 @@ Slider.displayName = "Slider";
12822
12824
  * next-themes and applying DS icons and variant styles (info / success / error / warning).
12823
12825
  * Mount once near the app root; trigger toasts via the exported `toast` function.
12824
12826
  *
12827
+ * Portals itself into `document.body` - see the note on the implementation below. That means
12828
+ * it can be mounted anywhere in the tree without its toasts being clipped or painted behind
12829
+ * a modal, so "near the app root" is a tidiness preference rather than a correctness one.
12830
+ *
12825
12831
  * @example
12826
12832
  * ```tsx
12827
12833
  * <Toaster position="bottom-right" />
@@ -12832,7 +12838,9 @@ Slider.displayName = "Slider";
12832
12838
  const Toaster = (componentProps) => {
12833
12839
  const props = _extends({}, (_objectDestructuringEmpty(componentProps), componentProps));
12834
12840
  const { theme = "system" } = useTheme$1();
12835
- return /* @__PURE__ */ jsx(Toaster$1, _objectSpread2({
12841
+ const portalContainer = typeof document === "undefined" ? null : document.body;
12842
+ if (!portalContainer) return null;
12843
+ return createPortal(/* @__PURE__ */ jsx(Toaster$1, _objectSpread2({
12836
12844
  theme,
12837
12845
  className: "toaster group !font-sans",
12838
12846
  icons: {
@@ -12857,7 +12865,7 @@ const Toaster = (componentProps) => {
12857
12865
  "--normal-text": "var(--popover-foreground)",
12858
12866
  "--normal-border": "var(--border)"
12859
12867
  }
12860
- }, props));
12868
+ }, props)), portalContainer);
12861
12869
  };
12862
12870
  //#endregion
12863
12871
  //#region src/components/stepper.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aircall/ds",
3
- "version": "0.39.0",
3
+ "version": "0.40.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "sideEffects": [
@@ -99,18 +99,18 @@
99
99
  "@tanstack/intent": "0.1.1",
100
100
  "@turbo/gen": "2.4.2",
101
101
  "@types/node": "24",
102
- "@types/react": "19",
103
- "@types/react-dom": "19",
102
+ "@types/react": "19.2.18",
103
+ "@types/react-dom": "19.2.5",
104
104
  "@vitest/browser-playwright": "4.0.17",
105
105
  "@vitest/coverage-v8": "4.0.17",
106
106
  "chromatic": "18.5.0",
107
107
  "date-fns": "4.1.0",
108
108
  "i18next": "23.11.5",
109
109
  "playwright": "1.57.0",
110
- "react": "19.2.3",
110
+ "react": "19.2.8",
111
111
  "react-compiler-runtime": "1.0.0",
112
112
  "react-day-picker": "9.14.0",
113
- "react-dom": "19.2.3",
113
+ "react-dom": "19.2.8",
114
114
  "storybook": "10.3.3",
115
115
  "storybook-addon-pseudo-states": "10.3.3",
116
116
  "tailwindcss": "4.1.18",