@almadar/ui 5.4.0 → 5.5.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.
@@ -7,6 +7,11 @@
7
7
  */
8
8
  import React from 'react';
9
9
  export type ButtonGroupVariant = 'default' | 'segmented' | 'toggle';
10
+ /**
11
+ * Layer 2 visual treatment for the action-cluster (form-actions) pattern —
12
+ * orthogonal to the semantic `variant` (which conveys grouping shape).
13
+ */
14
+ export type ActionClusterLook = 'right-aligned-buttons' | 'floating-bar' | 'inline-row' | 'dropdown-menu' | 'command-palette-trigger';
10
15
  /** Action button config for form-actions pattern */
11
16
  export interface ActionButton {
12
17
  label: string;
@@ -63,5 +68,10 @@ export interface ButtonGroupProps {
63
68
  * Filter definitions for filter-group pattern
64
69
  */
65
70
  filters?: readonly FilterDefinition[];
71
+ /**
72
+ * Layer 2 visual treatment for the action-cluster (form-actions) pattern.
73
+ * @default 'right-aligned-buttons'
74
+ */
75
+ look?: ActionClusterLook;
66
76
  }
67
77
  export declare const ButtonGroup: React.FC<ButtonGroupProps>;
@@ -102,6 +102,11 @@ export interface DataGridProps<T extends EntityRow = EntityRow> extends DataDndP
102
102
  renderItem?: (item: T, index: number) => React.ReactNode;
103
103
  /** Max items to show before "Show More" button. Defaults to 0 (disabled). */
104
104
  pageSize?: number;
105
+ /**
106
+ * Layer 2 visual treatment — mirrors the `entity-table` look enum so
107
+ * data-grid / data-list / entity-table share one knob name from authors.
108
+ */
109
+ look?: "dense" | "spacious" | "striped" | "borderless" | "card-rows";
105
110
  }
106
111
  export declare function DataGrid<T extends EntityRow = EntityRow>({ entity, fields, columns, itemActions, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, }: DataGridProps<T>): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
107
112
  export declare namespace DataGrid {
@@ -116,6 +116,11 @@ export interface DataListProps<T extends EntityRow = EntityRow> extends DataDndP
116
116
  renderItem?: (item: T, index: number) => React.ReactNode;
117
117
  /** Max items to show before "Show More" button. Defaults to 5. Set to 0 to disable. */
118
118
  pageSize?: number;
119
+ /**
120
+ * Layer 2 visual treatment — mirrors the `entity-table` look enum so
121
+ * data-grid / data-list / entity-table share one knob name from authors.
122
+ */
123
+ look?: "dense" | "spacious" | "striped" | "borderless" | "card-rows";
119
124
  }
120
125
  export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, columns, itemActions, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, }: DataListProps<T>): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
121
126
  export declare namespace DataList {
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { EventEmit } from "@almadar/core";
3
3
  import type { LucideIcon } from "lucide-react";
4
+ export type EmptyStateLook = "illustrated" | "icon-only" | "text-only" | "mascot";
4
5
  export interface EmptyStateProps {
5
6
  /**
6
7
  * Icon to display. Accepts either:
@@ -22,5 +23,7 @@ export interface EmptyStateProps {
22
23
  variant?: "default" | "success" | "error" | "warning" | "info";
23
24
  /** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
24
25
  actionEvent?: EventEmit<Record<string, never>>;
26
+ /** Layer 2 visual treatment — orthogonal to the semantic variant (which carries status color). */
27
+ look?: EmptyStateLook;
25
28
  }
26
29
  export declare const EmptyState: React.FC<EmptyStateProps>;
@@ -12,6 +12,11 @@
12
12
  * Supports Query Singleton pattern via `query` prop for std/Filter behavior.
13
13
  */
14
14
  import React from "react";
15
+ /**
16
+ * Layer 2 visual treatment for the filter-group pattern — orthogonal to the
17
+ * semantic `variant` (which conveys layout / role).
18
+ */
19
+ export type FilterGroupLook = "toolbar" | "chips" | "pills" | "popover-trigger" | "inline-column-header";
15
20
  /** Filter definition from schema */
16
21
  export interface FilterDefinition {
17
22
  field: string;
@@ -46,6 +51,8 @@ export interface FilterGroupProps {
46
51
  query?: string;
47
52
  /** Loading state indicator */
48
53
  isLoading?: boolean;
54
+ /** Layer 2 visual treatment — orthogonal to the semantic variant. */
55
+ look?: FilterGroupLook;
49
56
  }
50
57
  /**
51
58
  * FilterGroup - Renders filter controls for entity data
@@ -7,6 +7,11 @@
7
7
  import React from "react";
8
8
  import type { EventEmit } from "@almadar/core";
9
9
  export type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
10
+ /**
11
+ * Layer 2 visual treatment for the modal pattern — orthogonal to the semantic
12
+ * `size` (which conveys content scale).
13
+ */
14
+ export type ModalLook = "centered-card" | "top-sheet" | "side-drawer" | "full-screen";
10
15
  export interface ModalProps {
11
16
  /** Whether the modal is open (defaults to true when rendered by slot wrapper) */
12
17
  isOpen?: boolean;
@@ -25,5 +30,7 @@ export interface ModalProps {
25
30
  closeEvent?: EventEmit<Record<string, never>>;
26
31
  /** Enable swipe-down-to-close on mobile bottom sheet (default: true) */
27
32
  swipeDownToClose?: boolean;
33
+ /** Layer 2 visual treatment — orthogonal to the semantic variant. */
34
+ look?: ModalLook;
28
35
  }
29
36
  export declare const Modal: React.FC<ModalProps>;
@@ -6,6 +6,7 @@
6
6
  * No entity prop, no data fetching, no hooks beyond icon resolution.
7
7
  */
8
8
  import React from 'react';
9
+ export type StatDisplayLook = 'elevated' | 'flat' | 'progress-backed' | 'gauge' | 'sparkline';
9
10
  export interface StatDisplayProps {
10
11
  /** Display label (e.g., "Total", "Remaining") */
11
12
  label: string;
@@ -43,6 +44,8 @@ export interface StatDisplayProps {
43
44
  variant?: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
44
45
  /** Compact mode (inline, no card wrapper) */
45
46
  compact?: boolean;
47
+ /** Layer 2 visual treatment. */
48
+ look?: StatDisplayLook;
46
49
  /** Additional CSS classes */
47
50
  className?: string;
48
51
  /** Loading state */
@@ -16,6 +16,23 @@
16
16
  */
17
17
  import React from "react";
18
18
  export type ChartType = "bar" | "line" | "pie" | "area" | "donut" | "scatter" | "histogram";
19
+ /**
20
+ * Layer 2 visual treatment for the chart pattern — drives the chart
21
+ * sub-renderer (bar / line / pie / etc.). The chart "look" axis is the chart
22
+ * KIND, not pure visual styling. `look` is the primary surface; the legacy
23
+ * `chartType` prop remains as an alias.
24
+ *
25
+ * Mapping to `chartType`:
26
+ * - `bar-vertical` ↔ `bar` (default)
27
+ * - `bar-horizontal` ↔ (new) renders bars laid out horizontally
28
+ * - `line` ↔ `line`
29
+ * - `area` ↔ `area`
30
+ * - `pie` ↔ `pie`
31
+ * - `donut` ↔ `donut`
32
+ * - `scatter` ↔ `scatter`
33
+ * - `histogram` ↔ `histogram`
34
+ */
35
+ export type ChartLook = "bar-vertical" | "bar-horizontal" | "line" | "area" | "pie" | "donut" | "scatter" | "histogram";
19
36
  export type ChartStackMode = "none" | "stack" | "normalize";
20
37
  export interface ChartDataPoint {
21
38
  label: string;
@@ -46,8 +63,10 @@ export interface ChartProps {
46
63
  title?: string;
47
64
  /** Chart subtitle / description */
48
65
  subtitle?: string;
49
- /** Chart type */
66
+ /** Chart type (legacy alias for `look`). */
50
67
  chartType?: ChartType;
68
+ /** Layer 2 visual treatment — drives the chart sub-renderer (bar / line / pie / etc.). */
69
+ look?: ChartLook;
51
70
  /** Multi-series data */
52
71
  series?: readonly ChartSeries[];
53
72
  /** Simple single-series shorthand (bar/line/pie/area/donut/histogram) */
@@ -3,6 +3,7 @@ import type { EventKey } from "@almadar/core";
3
3
  import { LucideIcon } from "lucide-react";
4
4
  import { EntityDisplayProps } from "./types";
5
5
  import type { EntityRow } from "@almadar/core";
6
+ export type EntityTableLook = "dense" | "spacious" | "striped" | "borderless" | "card-rows";
6
7
  export interface Column<T> {
7
8
  key: keyof T | string;
8
9
  header: string;
@@ -60,10 +61,12 @@ export interface DataTableProps<T extends EntityRow & {
60
61
  headerActions?: React.ReactNode;
61
62
  /** Show total count in pagination */
62
63
  showTotal?: boolean;
64
+ /** Layer 2 visual treatment — orthogonal to the semantic variant. */
65
+ look?: EntityTableLook;
63
66
  }
64
67
  export declare function DataTable<T extends EntityRow & {
65
68
  id: string | number;
66
- }>({ fields, columns, entity, itemActions, isLoading, error, emptyIcon, emptyTitle, emptyDescription, emptyAction, selectable, selectedIds, sortBy, sortDirection, searchable, searchValue, searchPlaceholder, page, pageSize, totalCount, rowActions: externalRowActions, bulkActions, headerActions, showTotal, className, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
69
+ }>({ fields, columns, entity, itemActions, isLoading, error, emptyIcon, emptyTitle, emptyDescription, emptyAction, selectable, selectedIds, sortBy, sortDirection, searchable, searchValue, searchPlaceholder, page, pageSize, totalCount, rowActions: externalRowActions, bulkActions, headerActions, showTotal, className, look, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
67
70
  export declare namespace DataTable {
68
71
  var displayName: string;
69
72
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import React from "react";
8
8
  import type { LucideIcon } from "lucide-react";
9
+ export type HeaderLook = "hero" | "compact-bar" | "breadcrumb" | "contextual" | "editorial-banner";
9
10
  export interface HeaderProps {
10
11
  /**
11
12
  * Logo/Brand content
@@ -86,6 +87,8 @@ export interface HeaderProps {
86
87
  * @default 'mobile'
87
88
  */
88
89
  variant?: "mobile" | "desktop";
90
+ /** Layer 2 visual treatment — orthogonal to the structural variant (which currently flips mobile vs desktop). */
91
+ look?: HeaderLook;
89
92
  /**
90
93
  * Callback when logo/brand is clicked
91
94
  */
@@ -15,6 +15,11 @@ import type { EventKey } from "@almadar/core";
15
15
  import type { EntityRow } from "@almadar/core";
16
16
  import type { LucideIcon } from "lucide-react";
17
17
  export type TimelineItemStatus = "complete" | "active" | "pending" | "error";
18
+ /**
19
+ * Layer 2 visual treatment for the timeline pattern — orthogonal to the
20
+ * semantic status conveyed by per-item style.
21
+ */
22
+ export type TimelineLook = "vertical-compact" | "vertical-spacious" | "horizontal" | "swimlane";
18
23
  export interface TimelineItem {
19
24
  /** Unique identifier */
20
25
  id: string;
@@ -59,5 +64,7 @@ export interface TimelineProps {
59
64
  fields: readonly string[];
60
65
  /** Actions per item */
61
66
  itemActions?: readonly TimelineAction[];
67
+ /** Layer 2 visual treatment. */
68
+ look?: TimelineLook;
62
69
  }
63
70
  export declare const Timeline: React.FC<TimelineProps>;