@geomak/ui 5.0.3 → 5.1.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/dist/index.d.cts CHANGED
@@ -339,6 +339,268 @@ interface PortalProps {
339
339
  */
340
340
  declare function Portal({ children, target }: PortalProps): React$1.ReactPortal;
341
341
 
342
+ type Spacing = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
343
+ type BoxBackground = 'none' | 'background' | 'surface' | 'surface-raised' | 'accent';
344
+ type BoxBorder = 'none' | 'border' | 'border-strong' | 'accent' | 'status-error';
345
+ type BoxRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
346
+ type BoxShadow = 'none' | 'sm' | 'md' | 'lg' | 'xl';
347
+ interface BoxProps {
348
+ as?: keyof React$1.JSX.IntrinsicElements;
349
+ /** Padding shorthand — applies to all sides. */
350
+ p?: Spacing;
351
+ /** Horizontal padding (left + right). */
352
+ px?: Spacing;
353
+ /** Vertical padding (top + bottom). */
354
+ py?: Spacing;
355
+ pt?: Spacing;
356
+ pr?: Spacing;
357
+ pb?: Spacing;
358
+ pl?: Spacing;
359
+ /** Margin shorthand. */
360
+ m?: Spacing;
361
+ mx?: Spacing;
362
+ my?: Spacing;
363
+ mt?: Spacing;
364
+ mr?: Spacing;
365
+ mb?: Spacing;
366
+ ml?: Spacing;
367
+ background?: BoxBackground;
368
+ border?: BoxBorder;
369
+ radius?: BoxRadius;
370
+ shadow?: BoxShadow;
371
+ /** Width via Tailwind class or CSS value. */
372
+ width?: string | number;
373
+ /** Height via Tailwind class or CSS value. */
374
+ height?: string | number;
375
+ /** Click handler — accepts any element-typed handler. */
376
+ onClick?: React$1.MouseEventHandler<HTMLElement>;
377
+ className?: string;
378
+ style?: React$1.CSSProperties;
379
+ children?: React$1.ReactNode;
380
+ }
381
+ /**
382
+ * A polymorphic layout primitive — a `<div>` (by default) styled via prop
383
+ * shortcuts to the design system's tokenised spacing, surface, border,
384
+ * radius, and shadow scales. Use it when you'd otherwise reach for a
385
+ * className-only `<div>` with `p-4 bg-surface border border-border rounded-lg`.
386
+ *
387
+ * The token shortcuts map straight to Tailwind classes under the hood, so
388
+ * Tailwind's content scanner sees the classes and JIT-emits the CSS. There
389
+ * is no runtime style cost beyond the className concatenation.
390
+ *
391
+ * Use `as` when the semantic element should differ (`<section>`, `<article>`).
392
+ *
393
+ * @example Padded card surface
394
+ * ```tsx
395
+ * <Box p="lg" background="surface" border="border" radius="lg" shadow="sm">
396
+ * <Typography variant="h3">Card title</Typography>
397
+ * </Box>
398
+ * ```
399
+ *
400
+ * @example Semantic section
401
+ * ```tsx
402
+ * <Box as="section" px="md" py="lg" background="background">
403
+ * <PageContent />
404
+ * </Box>
405
+ * ```
406
+ */
407
+ declare function Box({ as, p, px, py, pt, pr, pb, pl, m, mx, my, mt, mr, mb, ml, background, border, radius, shadow, width, height, onClick, className, style, children, }: BoxProps): react_jsx_runtime.JSX.Element;
408
+
409
+ type FlexDirection = 'row' | 'row-reverse' | 'col' | 'col-reverse';
410
+ type FlexAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
411
+ type FlexJustify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
412
+ type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
413
+ interface FlexProps extends BoxProps {
414
+ direction?: FlexDirection;
415
+ align?: FlexAlign;
416
+ justify?: FlexJustify;
417
+ wrap?: FlexWrap;
418
+ /** Gap between children — uses the same spacing token scale as Box. */
419
+ gap?: Spacing;
420
+ inline?: boolean;
421
+ }
422
+ /**
423
+ * `Box` with `display: flex` baked in. All Box props are accepted (padding,
424
+ * margin, background, border, etc.) plus flex-specific controls.
425
+ *
426
+ * @example Horizontal row, centred, with gap
427
+ * ```tsx
428
+ * <Flex direction="row" align="center" gap="md">
429
+ * <Avatar src={user.photo} alt={user.name} />
430
+ * <Typography variant="body">{user.name}</Typography>
431
+ * </Flex>
432
+ * ```
433
+ *
434
+ * @example Vertical stack
435
+ * ```tsx
436
+ * <Flex direction="col" gap="sm">
437
+ * <Typography variant="h3">Title</Typography>
438
+ * <Typography variant="body">Body text</Typography>
439
+ * </Flex>
440
+ * ```
441
+ */
442
+ declare function Flex({ direction, align, justify, wrap, gap, inline, className, ...boxProps }: FlexProps): react_jsx_runtime.JSX.Element;
443
+
444
+ interface GridProps extends BoxProps {
445
+ /**
446
+ * Number of columns (1–12) for the most common case, OR an explicit
447
+ * CSS grid-template-columns string for arbitrary layouts
448
+ * (e.g. `"200px 1fr"` or `"repeat(auto-fit, minmax(180px, 1fr))"`).
449
+ */
450
+ cols?: number | string;
451
+ /** Same as `cols` but for rows. */
452
+ rows?: number | string;
453
+ /** Uniform gap. Token scale, like Box's padding. */
454
+ gap?: Spacing;
455
+ /** Horizontal-only gap (overrides `gap`). */
456
+ gapX?: Spacing;
457
+ /** Vertical-only gap (overrides `gap`). */
458
+ gapY?: Spacing;
459
+ /** Cross-axis alignment of items within their cell. */
460
+ align?: 'start' | 'center' | 'end' | 'stretch';
461
+ /** Main-axis alignment of items within their cell. */
462
+ justify?: 'start' | 'center' | 'end' | 'stretch';
463
+ }
464
+ /**
465
+ * `Box` with `display: grid` baked in. Use `cols` / `rows` as numbers for
466
+ * the common "N equal tracks" case, or pass any CSS grid-template-* string
467
+ * for arbitrary layouts (auto-fit grids, fixed-width sidebars, etc.).
468
+ *
469
+ * @example 3-column grid with medium gap
470
+ * ```tsx
471
+ * <Grid cols={3} gap="md">
472
+ * <Card />
473
+ * <Card />
474
+ * <Card />
475
+ * </Grid>
476
+ * ```
477
+ *
478
+ * @example Auto-fit responsive grid
479
+ * ```tsx
480
+ * <Grid cols="repeat(auto-fit, minmax(220px, 1fr))" gap="lg">
481
+ * {items.map((it) => <Card key={it.id} {...it} />)}
482
+ * </Grid>
483
+ * ```
484
+ */
485
+ declare function Grid({ cols, rows, gap, gapX, gapY, align, justify, className, style, ...boxProps }: GridProps): react_jsx_runtime.JSX.Element;
486
+
487
+ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
488
+ type AvatarShape = 'circle' | 'square';
489
+ type AvatarStatus = 'online' | 'offline' | 'away' | 'busy';
490
+ interface AvatarProps {
491
+ /** Image URL. If missing or fails to load, `fallback` renders instead. */
492
+ src?: string;
493
+ /** Alt text — required when `src` is provided for screen readers. */
494
+ alt?: string;
495
+ /**
496
+ * Fallback rendered when the image is unavailable. Pass either:
497
+ * - a string (e.g. user initials like "JD") — rendered with semi-bold weight
498
+ * - any ReactNode (icon, emoji)
499
+ * - omit entirely — a generic "person" silhouette is used
500
+ */
501
+ fallback?: React$1.ReactNode;
502
+ /** Size preset. Default `'md'`. */
503
+ size?: AvatarSize;
504
+ /** Circle (default) or rounded square. */
505
+ shape?: AvatarShape;
506
+ /**
507
+ * Optional presence indicator dot in the bottom-right corner.
508
+ * `'online' | 'offline' | 'away' | 'busy'`.
509
+ */
510
+ status?: AvatarStatus;
511
+ className?: string;
512
+ }
513
+ /**
514
+ * Circular (or rounded-square) user avatar built on `@radix-ui/react-avatar`.
515
+ * Radix handles the image-load lifecycle: it tries to load `src`, falls back
516
+ * to the `fallback` slot after a short delay if the image is missing or fails
517
+ * to decode, and re-attempts on `src` change.
518
+ *
519
+ * **Fallback strategy** (in order):
520
+ * 1. `fallback` prop if provided (string or ReactNode)
521
+ * 2. Two-character initials extracted from `alt` if `alt` is provided
522
+ * 3. A generic "person" silhouette SVG
523
+ *
524
+ * **Status dot** is an optional presence indicator in the bottom-right —
525
+ * online (green), away (amber), busy (red), offline (grey).
526
+ *
527
+ * @example Basic with image
528
+ * ```tsx
529
+ * <Avatar src="/users/jd.jpg" alt="Jane Doe" />
530
+ * ```
531
+ *
532
+ * @example Fallback to initials
533
+ * ```tsx
534
+ * <Avatar alt="Jane Doe" size="lg" />
535
+ * ```
536
+ *
537
+ * @example Online presence + square shape
538
+ * ```tsx
539
+ * <Avatar src={user.photo} alt={user.name} status="online" shape="square" />
540
+ * ```
541
+ */
542
+ declare function Avatar({ src, alt, fallback, size, shape, status, className, }: AvatarProps): react_jsx_runtime.JSX.Element;
543
+
544
+ type TypographyVariant = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'subtitle' | 'body' | 'caption' | 'overline' | 'code';
545
+ type TypographyColor = 'foreground' | 'foreground-secondary' | 'foreground-muted' | 'accent' | 'status-error' | 'status-warning' | 'status-success' | 'status-info' | 'inherit';
546
+ type TypographyWeight = 'normal' | 'medium' | 'semibold' | 'bold';
547
+ type TypographyAlign = 'left' | 'center' | 'right' | 'justify';
548
+ interface TypographyProps {
549
+ /** Visual scale variant. */
550
+ variant?: TypographyVariant;
551
+ /**
552
+ * Element to render. Defaults are sensible per variant
553
+ * (e.g. h1 → `<h1>`, body → `<p>`, code → `<code>`). Override
554
+ * with `as` when the semantic element should differ from the visual
555
+ * style (e.g. a styled-as-h1 product card heading rendered as `<div>`).
556
+ */
557
+ as?: keyof React$1.JSX.IntrinsicElements;
558
+ color?: TypographyColor;
559
+ weight?: TypographyWeight;
560
+ align?: TypographyAlign;
561
+ /** Truncate to one line with ellipsis. */
562
+ truncate?: boolean;
563
+ /** Render the text with reduced opacity (useful for disabled states). */
564
+ muted?: boolean;
565
+ className?: string;
566
+ style?: React$1.CSSProperties;
567
+ children?: React$1.ReactNode;
568
+ }
569
+ /**
570
+ * Polymorphic typography primitive. `variant` picks a visual scale; `as`
571
+ * controls the rendered element when it should differ from the default
572
+ * for that variant (e.g. a styled-as-h2 card title rendered as `<div>`).
573
+ *
574
+ * **Variants** map to the design-system text scale:
575
+ * - `display`: hero headlines
576
+ * - `h1` – `h4`: section / subsection headings
577
+ * - `subtitle`: emphasised lead text
578
+ * - `body` (default): paragraph text
579
+ * - `caption`: small label / hint text
580
+ * - `overline`: uppercase eyebrow text
581
+ * - `code`: inline code samples
582
+ *
583
+ * **Colour** accepts any semantic token; defaults to `inherit` so the
584
+ * parent's text colour flows through (useful when nesting Typography
585
+ * inside a coloured surface like an accent badge).
586
+ *
587
+ * @example Section heading
588
+ * ```tsx
589
+ * <Typography variant="h2">Vessel performance</Typography>
590
+ * ```
591
+ *
592
+ * @example Styled as h1 but rendered as div (for SEO-neutral cards)
593
+ * ```tsx
594
+ * <Typography variant="h1" as="div">Card title</Typography>
595
+ * ```
596
+ *
597
+ * @example Error message
598
+ * ```tsx
599
+ * <Typography variant="caption" color="status-error">{errorText}</Typography>
600
+ * ```
601
+ */
602
+ declare function Typography({ variant, as, color, weight, align, truncate, muted, className, style, children, }: TypographyProps): react_jsx_runtime.JSX.Element;
603
+
342
604
  type IconButtonVariant = 'primary' | 'bordered';
343
605
  interface IconButtonProps {
344
606
  icon?: React.ReactNode;
@@ -699,25 +961,71 @@ interface FadingBaseProps {
699
961
  declare function FadingBase({ className, isMounted, children, }: FadingBaseProps): react_jsx_runtime.JSX.Element;
700
962
 
701
963
  interface ListItem {
964
+ /** Stable key for React reconciliation + active-key matching. */
702
965
  key: string | number;
966
+ /** Main item text (title). Required. */
703
967
  label: React$1.ReactNode;
968
+ /** Optional description rendered below the label, in foreground-secondary. */
969
+ description?: React$1.ReactNode;
970
+ /**
971
+ * Optional leading slot, typically an Avatar. Anything React-renderable
972
+ * is accepted (icon, image, status badge…).
973
+ */
974
+ avatar?: React$1.ReactNode;
975
+ /** Optional trailing slot, e.g. a badge, count, or action icon. */
976
+ trailing?: React$1.ReactNode;
977
+ /** Disable interaction for this item only. */
978
+ disabled?: boolean;
704
979
  }
705
980
  interface ListProps {
706
981
  items: ListItem[];
707
982
  onItemClick: (item: ListItem) => void;
708
983
  activeKey?: string | number;
984
+ /**
985
+ * Visual density. `'compact'` for dense reference lists,
986
+ * `'comfortable'` (default) for typical UI, `'spacious'` for hero rows.
987
+ */
988
+ density?: 'compact' | 'comfortable' | 'spacious';
709
989
  }
710
990
  /**
711
- * Vertical clickable list with active-item highlight.
991
+ * Vertical clickable list with optional avatar / description / trailing
992
+ * slots per item. Built on `role="listbox"` + `role="option"` so screen
993
+ * readers announce it as a selectable list. Keyboard activation works on
994
+ * Enter and Space.
712
995
  *
713
- * @example
996
+ * **When to use this** over a Table:
997
+ * - When the dataset is a simple sequence of records that the user
998
+ * browses + picks one of (sidebar nav, contact list, vessel chooser).
999
+ * - When each row's primary signal is a 1–2-line summary, not a tabular
1000
+ * breakdown.
1001
+ *
1002
+ * Use Table when comparing rows across multiple columns matters more than
1003
+ * picking one.
1004
+ *
1005
+ * @example Plain
1006
+ * ```tsx
714
1007
  * <List
715
- * items={vessels.map(v => ({ key: v.imo, label: v.name }))}
716
- * activeKey={selectedImo}
717
- * onItemClick={(item) => setSelected(item.key)}
1008
+ * items={[{ key: 1, label: 'Aurora' }, { key: 2, label: 'Beacon' }]}
1009
+ * activeKey={2}
1010
+ * onItemClick={(it) => setSelected(it.key)}
718
1011
  * />
1012
+ * ```
1013
+ *
1014
+ * @example With avatars + descriptions
1015
+ * ```tsx
1016
+ * <List
1017
+ * items={crew.map((c) => ({
1018
+ * key: c.id,
1019
+ * label: c.name,
1020
+ * description: c.rank,
1021
+ * avatar: <Avatar src={c.photo} alt={c.name} status={c.status} />,
1022
+ * trailing: <Badge count={c.unread} />,
1023
+ * }))}
1024
+ * onItemClick={(it) => navigate(`/crew/${it.key}`)}
1025
+ * />
1026
+ * ```
719
1027
  */
720
- declare function List({ items, onItemClick, activeKey }: ListProps): react_jsx_runtime.JSX.Element;
1028
+ declare function List({ items, onItemClick, activeKey, density, }: ListProps): react_jsx_runtime.JSX.Element;
721
1029
 
722
1030
  interface ScalableContainerProps {
723
1031
  /** Resting width. Any CSS length / percent. Default `'100%'`. */
@@ -1980,4 +2288,4 @@ type TemporalPickerProps = DatePickerProps;
1980
2288
  */
1981
2289
  declare function DatePicker({ value, onChange, label, placeholder, htmlFor, name: _name, layout, disabled, errorMessage, min, max, style, format, weekStartsOn, clearable, }: DatePickerProps): react_jsx_runtime.JSX.Element;
1982
2290
 
1983
- 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, 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, 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, DatePicker as 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 };
2291
+ export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, 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, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, 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, type Spacing, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, DatePicker as 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, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, Wizard, type WizardProps, type WizardStep, useNotification };