@geomak/ui 1.6.2 → 1.7.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.cts CHANGED
@@ -250,18 +250,107 @@ declare const Icon: {
250
250
  }) => react_jsx_runtime.JSX.Element;
251
251
  };
252
252
 
253
+ interface PortalProps {
254
+ /** Content to render at the target node. */
255
+ children: React$1.ReactNode;
256
+ /**
257
+ * Where to mount the portal.
258
+ * - omitted / `undefined` → `document.body` (the safe default for viewport-anchored UI)
259
+ * - `HTMLElement` → that exact node
260
+ * - `() => HTMLElement | null` → resolved at mount time (lets you query the DOM after layout)
261
+ * - `null` → portal is disabled; nothing renders
262
+ */
263
+ target?: HTMLElement | (() => HTMLElement | null) | null;
264
+ }
265
+ /**
266
+ * SSR-safe DOM relocator. Renders `children` at a detached DOM node — by
267
+ * default `document.body` — so that any `position: fixed` descendant resolves
268
+ * against the real viewport, never against a transformed, filtered, or
269
+ * contained ancestor.
270
+ *
271
+ * ## Why this exists
272
+ *
273
+ * Per the CSS spec, **any ancestor with `transform`, `filter`, `perspective`,
274
+ * `will-change`, or `contain: layout|paint|strict` creates a new containing
275
+ * block for `position: fixed` descendants**. The fixed element then resolves
276
+ * its coordinates against that ancestor, not the viewport — silently breaking
277
+ * full-screen overlays, toast viewports, mobile drawers, and loading screens
278
+ * whenever a consumer wraps the component in:
279
+ *
280
+ * - a page-transition library (Framer Motion, view transitions)
281
+ * - a modal or drawer (Storybook's centered-layout wrapper hits this too)
282
+ * - a card with `contain: layout` or `will-change: transform`
283
+ * - a CSS filter (`backdrop-blur`, `drop-shadow`)
284
+ *
285
+ * Portaling to `document.body` makes the element **immune** to any styling
286
+ * its consumer applies to ancestor nodes. This is the same pattern Radix UI
287
+ * uses internally for every overlay primitive (`Dialog.Portal`,
288
+ * `Tooltip.Portal`, `Popover.Portal`, etc.).
289
+ *
290
+ * ## When to use it
291
+ *
292
+ * Wrap any element that uses `position: fixed` to anchor itself to the
293
+ * viewport — full-screen overlays, toast viewports, drawers, loading screens,
294
+ * command palettes, lightboxes.
295
+ *
296
+ * If you're already using a Radix primitive, prefer its built-in `*.Portal`
297
+ * component (they're equivalent but lifecycle-aware for that primitive).
298
+ *
299
+ * ## When NOT to use it
300
+ *
301
+ * - For inline elements that already flow naturally with the document — Portal
302
+ * is for **fixed/absolute escape**, not general layout.
303
+ * - For SSR-critical content that must appear before hydration — Portal renders
304
+ * `null` on the server and the first client render.
305
+ * - For accessibility-critical content that depends on DOM proximity (form
306
+ * labels, ARIA `aria-controls` targets) — escaping the tree can break focus
307
+ * order and assistive-tech navigation.
308
+ *
309
+ * ## SSR / hydration
310
+ *
311
+ * `document.body` isn't available during SSR or the first client render.
312
+ * `Portal` renders `null` until `useEffect` resolves the target post-mount,
313
+ * then re-renders with the portal in place. Content that needs to appear
314
+ * immediately on mount paints one frame later — acceptable for overlays
315
+ * (the trigger interaction is what kicks them off anyway).
316
+ *
317
+ * @example Full-screen loading overlay
318
+ * ```tsx
319
+ * <Portal>
320
+ * <div className="fixed inset-0 bg-black/40 z-overlay flex items-center justify-center">
321
+ * <Spinner />
322
+ * </div>
323
+ * </Portal>
324
+ * ```
325
+ *
326
+ * @example Mount to a specific element
327
+ * ```tsx
328
+ * <Portal target={() => document.getElementById('app-root')}>
329
+ * <Drawer />
330
+ * </Portal>
331
+ * ```
332
+ *
333
+ * @example Conditionally disable (render inline)
334
+ * ```tsx
335
+ * <Portal target={shouldPortal ? undefined : null}>
336
+ * <Banner />
337
+ * </Portal>
338
+ * ```
339
+ */
340
+ declare function Portal({ children, target }: PortalProps): React$1.ReactPortal;
341
+
342
+ type IconButtonVariant = 'primary' | 'bordered';
253
343
  interface IconButtonProps {
254
344
  icon?: React.ReactNode;
255
345
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
256
- /** 'primary' | 'bordered' */
257
- type?: string;
346
+ /** Visual style. Defaults to `'primary'`. */
347
+ type?: IconButtonVariant;
258
348
  buttonType?: 'button' | 'submit' | 'reset';
259
349
  disabled?: boolean;
260
350
  size?: 'sm' | 'lg';
261
351
  loading?: boolean;
262
352
  loadingIcon?: React.ReactNode;
263
353
  title?: string;
264
- [key: string]: any;
265
354
  }
266
355
  /**
267
356
  * Square icon-only button.
@@ -276,8 +365,13 @@ interface ModalProps {
276
365
  /**
277
366
  * Max width of the modal panel in pixels (default 600).
278
367
  * On narrow viewports the panel fills the screen minus 1 rem on each side.
279
- * Height is always content-driven `size[1]` is accepted for backwards
280
- * compatibility but is no longer used; remove it when convenient.
368
+ * Height is always content-driven (max 90 dvh).
369
+ */
370
+ width?: number;
371
+ /**
372
+ * @deprecated Use `width` instead. The second tuple value (height) was
373
+ * never honoured and is silently ignored. Kept for backwards
374
+ * compatibility — will be removed in a future major version.
281
375
  */
282
376
  size?: [number, number] | [number];
283
377
  isOpen?: boolean;
@@ -302,7 +396,7 @@ interface ModalProps {
302
396
  * Are you sure you want to delete this item?
303
397
  * </Modal>
304
398
  */
305
- declare function Modal({ size, isOpen, onClose, onOk, onCancel, okText, cancelText, hasFooter, title, children, }: ModalProps): react_jsx_runtime.JSX.Element;
399
+ declare function Modal({ width, size, isOpen, onClose, onOk, onCancel, okText, cancelText, hasFooter, title, children, }: ModalProps): react_jsx_runtime.JSX.Element;
306
400
 
307
401
  interface DrawerProps {
308
402
  isOpen?: boolean;
@@ -1596,4 +1690,4 @@ declare const Temporal: {
1596
1690
  TemporalPicker: typeof TemporalPickerBase;
1597
1691
  };
1598
1692
 
1599
- export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };
1693
+ export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };
package/dist/index.d.ts CHANGED
@@ -250,18 +250,107 @@ declare const Icon: {
250
250
  }) => react_jsx_runtime.JSX.Element;
251
251
  };
252
252
 
253
+ interface PortalProps {
254
+ /** Content to render at the target node. */
255
+ children: React$1.ReactNode;
256
+ /**
257
+ * Where to mount the portal.
258
+ * - omitted / `undefined` → `document.body` (the safe default for viewport-anchored UI)
259
+ * - `HTMLElement` → that exact node
260
+ * - `() => HTMLElement | null` → resolved at mount time (lets you query the DOM after layout)
261
+ * - `null` → portal is disabled; nothing renders
262
+ */
263
+ target?: HTMLElement | (() => HTMLElement | null) | null;
264
+ }
265
+ /**
266
+ * SSR-safe DOM relocator. Renders `children` at a detached DOM node — by
267
+ * default `document.body` — so that any `position: fixed` descendant resolves
268
+ * against the real viewport, never against a transformed, filtered, or
269
+ * contained ancestor.
270
+ *
271
+ * ## Why this exists
272
+ *
273
+ * Per the CSS spec, **any ancestor with `transform`, `filter`, `perspective`,
274
+ * `will-change`, or `contain: layout|paint|strict` creates a new containing
275
+ * block for `position: fixed` descendants**. The fixed element then resolves
276
+ * its coordinates against that ancestor, not the viewport — silently breaking
277
+ * full-screen overlays, toast viewports, mobile drawers, and loading screens
278
+ * whenever a consumer wraps the component in:
279
+ *
280
+ * - a page-transition library (Framer Motion, view transitions)
281
+ * - a modal or drawer (Storybook's centered-layout wrapper hits this too)
282
+ * - a card with `contain: layout` or `will-change: transform`
283
+ * - a CSS filter (`backdrop-blur`, `drop-shadow`)
284
+ *
285
+ * Portaling to `document.body` makes the element **immune** to any styling
286
+ * its consumer applies to ancestor nodes. This is the same pattern Radix UI
287
+ * uses internally for every overlay primitive (`Dialog.Portal`,
288
+ * `Tooltip.Portal`, `Popover.Portal`, etc.).
289
+ *
290
+ * ## When to use it
291
+ *
292
+ * Wrap any element that uses `position: fixed` to anchor itself to the
293
+ * viewport — full-screen overlays, toast viewports, drawers, loading screens,
294
+ * command palettes, lightboxes.
295
+ *
296
+ * If you're already using a Radix primitive, prefer its built-in `*.Portal`
297
+ * component (they're equivalent but lifecycle-aware for that primitive).
298
+ *
299
+ * ## When NOT to use it
300
+ *
301
+ * - For inline elements that already flow naturally with the document — Portal
302
+ * is for **fixed/absolute escape**, not general layout.
303
+ * - For SSR-critical content that must appear before hydration — Portal renders
304
+ * `null` on the server and the first client render.
305
+ * - For accessibility-critical content that depends on DOM proximity (form
306
+ * labels, ARIA `aria-controls` targets) — escaping the tree can break focus
307
+ * order and assistive-tech navigation.
308
+ *
309
+ * ## SSR / hydration
310
+ *
311
+ * `document.body` isn't available during SSR or the first client render.
312
+ * `Portal` renders `null` until `useEffect` resolves the target post-mount,
313
+ * then re-renders with the portal in place. Content that needs to appear
314
+ * immediately on mount paints one frame later — acceptable for overlays
315
+ * (the trigger interaction is what kicks them off anyway).
316
+ *
317
+ * @example Full-screen loading overlay
318
+ * ```tsx
319
+ * <Portal>
320
+ * <div className="fixed inset-0 bg-black/40 z-overlay flex items-center justify-center">
321
+ * <Spinner />
322
+ * </div>
323
+ * </Portal>
324
+ * ```
325
+ *
326
+ * @example Mount to a specific element
327
+ * ```tsx
328
+ * <Portal target={() => document.getElementById('app-root')}>
329
+ * <Drawer />
330
+ * </Portal>
331
+ * ```
332
+ *
333
+ * @example Conditionally disable (render inline)
334
+ * ```tsx
335
+ * <Portal target={shouldPortal ? undefined : null}>
336
+ * <Banner />
337
+ * </Portal>
338
+ * ```
339
+ */
340
+ declare function Portal({ children, target }: PortalProps): React$1.ReactPortal;
341
+
342
+ type IconButtonVariant = 'primary' | 'bordered';
253
343
  interface IconButtonProps {
254
344
  icon?: React.ReactNode;
255
345
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
256
- /** 'primary' | 'bordered' */
257
- type?: string;
346
+ /** Visual style. Defaults to `'primary'`. */
347
+ type?: IconButtonVariant;
258
348
  buttonType?: 'button' | 'submit' | 'reset';
259
349
  disabled?: boolean;
260
350
  size?: 'sm' | 'lg';
261
351
  loading?: boolean;
262
352
  loadingIcon?: React.ReactNode;
263
353
  title?: string;
264
- [key: string]: any;
265
354
  }
266
355
  /**
267
356
  * Square icon-only button.
@@ -276,8 +365,13 @@ interface ModalProps {
276
365
  /**
277
366
  * Max width of the modal panel in pixels (default 600).
278
367
  * On narrow viewports the panel fills the screen minus 1 rem on each side.
279
- * Height is always content-driven `size[1]` is accepted for backwards
280
- * compatibility but is no longer used; remove it when convenient.
368
+ * Height is always content-driven (max 90 dvh).
369
+ */
370
+ width?: number;
371
+ /**
372
+ * @deprecated Use `width` instead. The second tuple value (height) was
373
+ * never honoured and is silently ignored. Kept for backwards
374
+ * compatibility — will be removed in a future major version.
281
375
  */
282
376
  size?: [number, number] | [number];
283
377
  isOpen?: boolean;
@@ -302,7 +396,7 @@ interface ModalProps {
302
396
  * Are you sure you want to delete this item?
303
397
  * </Modal>
304
398
  */
305
- declare function Modal({ size, isOpen, onClose, onOk, onCancel, okText, cancelText, hasFooter, title, children, }: ModalProps): react_jsx_runtime.JSX.Element;
399
+ declare function Modal({ width, size, isOpen, onClose, onOk, onCancel, okText, cancelText, hasFooter, title, children, }: ModalProps): react_jsx_runtime.JSX.Element;
306
400
 
307
401
  interface DrawerProps {
308
402
  isOpen?: boolean;
@@ -1596,4 +1690,4 @@ declare const Temporal: {
1596
1690
  TemporalPicker: typeof TemporalPickerBase;
1597
1691
  };
1598
1692
 
1599
- export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };
1693
+ export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };