@indico-data/design-system 3.16.1 → 3.18.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indico-data/design-system",
3
- "version": "3.16.1",
3
+ "version": "3.18.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "lib/index.js",
@@ -85,6 +85,20 @@ const meta: Meta<typeof FloatUI> = {
85
85
  },
86
86
  },
87
87
  },
88
+ disableAutoUpdate: {
89
+ control: 'boolean',
90
+ description:
91
+ 'Disables automatic position updates when the reference element moves. Escape hatch for very performance-critical scenarios.',
92
+ table: {
93
+ category: 'Props',
94
+ type: {
95
+ summary: 'boolean',
96
+ },
97
+ defaultValue: {
98
+ summary: 'false',
99
+ },
100
+ },
101
+ },
88
102
  },
89
103
  decorators: [
90
104
  (Story: React.ComponentType) => (
@@ -13,6 +13,7 @@ import {
13
13
  useDismiss,
14
14
  ReferenceType,
15
15
  VirtualElement,
16
+ autoUpdate,
16
17
  } from '@floating-ui/react';
17
18
  import { FloatUIProps } from './types';
18
19
 
@@ -32,6 +33,7 @@ export function FloatUI({
32
33
  className,
33
34
  hover = false,
34
35
  onOpenChange,
36
+ disableAutoUpdate = false,
35
37
  }: FloatUIProps) {
36
38
  const [internalIsOpen, setInternalIsOpen] = useState(false);
37
39
 
@@ -65,6 +67,9 @@ export function FloatUI({
65
67
  setIsOpen(isOpen);
66
68
  onOpenChange?.(isOpen);
67
69
  },
70
+ whileElementsMounted: disableAutoUpdate
71
+ ? undefined
72
+ : (floatingOptions.whileElementsMounted ?? autoUpdate),
68
73
  elements: {
69
74
  reference: referenceElement as Element | null,
70
75
  },
@@ -23,4 +23,6 @@ export type FloatUIProps = {
23
23
  hover?: boolean;
24
24
  /** Callback function to be called when the FloatUI is opened or closed. */
25
25
  onOpenChange?: (isOpen: boolean) => void;
26
+ /** If true, disables automatic position updates when the reference element moves (e.g., due to layout shifts). Defaults to false. */
27
+ disableAutoUpdate?: boolean;
26
28
  };
@@ -13,6 +13,8 @@
13
13
  .rdp-root {
14
14
  --rdp-accent-color: var(--pf-semantic-font-link);
15
15
  --rdp-font-family: var(--pf-font-family-base);
16
+ --rdp-day-height: 35px;
17
+ --rdp-day-width: 35px;
16
18
 
17
19
  // range
18
20
  --rdp-range_middle-background-color: var(--pf-semantic-page-background);