@almadar/ui 5.3.1 → 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>;
@@ -3930,6 +3930,15 @@ var shadowStyles2 = {
3930
3930
  md: "shadow",
3931
3931
  lg: "shadow-elevation-dialog"
3932
3932
  };
3933
+ var lookStyles = {
3934
+ elevated: "",
3935
+ "flat-bordered": "shadow-none border-[length:var(--border-width)] border-border",
3936
+ "borderless-divider": "shadow-none border-0 border-b border-border rounded-none",
3937
+ ticket: "shadow-none border-dashed border-[length:var(--border-width)] border-border",
3938
+ invoice: "shadow-none border-[length:var(--border-width-thick)] border-border rounded-sm",
3939
+ chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3940
+ "tile-image-first": "p-0 overflow-hidden"
3941
+ };
3933
3942
  var Card = React7__default.default.forwardRef(
3934
3943
  ({
3935
3944
  className,
@@ -3938,6 +3947,7 @@ var Card = React7__default.default.forwardRef(
3938
3947
  title,
3939
3948
  subtitle,
3940
3949
  shadow,
3950
+ look = "elevated",
3941
3951
  children,
3942
3952
  ...props
3943
3953
  }, ref) => {
@@ -3950,6 +3960,7 @@ var Card = React7__default.default.forwardRef(
3950
3960
  "transition-all duration-[var(--transition-normal)]",
3951
3961
  variantStyles3[variant],
3952
3962
  paddingStyles2[padding],
3963
+ lookStyles[look],
3953
3964
  shadow && shadowStyles2[shadow],
3954
3965
  className
3955
3966
  ),
@@ -228,6 +228,11 @@ interface IconProps {
228
228
  declare const Icon: React.FC<IconProps>;
229
229
 
230
230
  type CardShadow = "none" | "sm" | "md" | "lg";
231
+ /**
232
+ * Layer 2 visual treatment for the card pattern — orthogonal to the semantic
233
+ * `variant` (which conveys role / state).
234
+ */
235
+ type CardLook = "elevated" | "flat-bordered" | "borderless-divider" | "ticket" | "invoice" | "chip" | "tile-image-first";
231
236
  interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
232
237
  variant?: "default" | "bordered" | "elevated" | "interactive";
233
238
  padding?: "none" | "sm" | "md" | "lg";
@@ -237,6 +242,8 @@ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
237
242
  subtitle?: string;
238
243
  /** Shadow size override */
239
244
  shadow?: CardShadow;
245
+ /** Layer 2 visual treatment — orthogonal to the semantic variant. */
246
+ look?: CardLook;
240
247
  /** Card content */
241
248
  children?: React.ReactNode;
242
249
  }
@@ -3903,6 +3903,15 @@ var shadowStyles2 = {
3903
3903
  md: "shadow",
3904
3904
  lg: "shadow-elevation-dialog"
3905
3905
  };
3906
+ var lookStyles = {
3907
+ elevated: "",
3908
+ "flat-bordered": "shadow-none border-[length:var(--border-width)] border-border",
3909
+ "borderless-divider": "shadow-none border-0 border-b border-border rounded-none",
3910
+ ticket: "shadow-none border-dashed border-[length:var(--border-width)] border-border",
3911
+ invoice: "shadow-none border-[length:var(--border-width-thick)] border-border rounded-sm",
3912
+ chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3913
+ "tile-image-first": "p-0 overflow-hidden"
3914
+ };
3906
3915
  var Card = React7.forwardRef(
3907
3916
  ({
3908
3917
  className,
@@ -3911,6 +3920,7 @@ var Card = React7.forwardRef(
3911
3920
  title,
3912
3921
  subtitle,
3913
3922
  shadow,
3923
+ look = "elevated",
3914
3924
  children,
3915
3925
  ...props
3916
3926
  }, ref) => {
@@ -3923,6 +3933,7 @@ var Card = React7.forwardRef(
3923
3933
  "transition-all duration-[var(--transition-normal)]",
3924
3934
  variantStyles3[variant],
3925
3935
  paddingStyles2[padding],
3936
+ lookStyles[look],
3926
3937
  shadow && shadowStyles2[shadow],
3927
3938
  className
3928
3939
  ),
@@ -4014,6 +4014,15 @@ var shadowStyles2 = {
4014
4014
  md: "shadow",
4015
4015
  lg: "shadow-elevation-dialog"
4016
4016
  };
4017
+ var lookStyles = {
4018
+ elevated: "",
4019
+ "flat-bordered": "shadow-none border-[length:var(--border-width)] border-border",
4020
+ "borderless-divider": "shadow-none border-0 border-b border-border rounded-none",
4021
+ ticket: "shadow-none border-dashed border-[length:var(--border-width)] border-border",
4022
+ invoice: "shadow-none border-[length:var(--border-width-thick)] border-border rounded-sm",
4023
+ chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
4024
+ "tile-image-first": "p-0 overflow-hidden"
4025
+ };
4017
4026
  var Card = React8__default.default.forwardRef(
4018
4027
  ({
4019
4028
  className,
@@ -4022,6 +4031,7 @@ var Card = React8__default.default.forwardRef(
4022
4031
  title,
4023
4032
  subtitle,
4024
4033
  shadow,
4034
+ look = "elevated",
4025
4035
  children,
4026
4036
  ...props
4027
4037
  }, ref) => {
@@ -4034,6 +4044,7 @@ var Card = React8__default.default.forwardRef(
4034
4044
  "transition-all duration-[var(--transition-normal)]",
4035
4045
  variantStyles4[variant],
4036
4046
  paddingStyles2[padding],
4047
+ lookStyles[look],
4037
4048
  shadow && shadowStyles2[shadow],
4038
4049
  className
4039
4050
  ),
@@ -250,6 +250,11 @@ interface IconProps {
250
250
  declare const Icon: React.FC<IconProps>;
251
251
 
252
252
  type CardShadow = "none" | "sm" | "md" | "lg";
253
+ /**
254
+ * Layer 2 visual treatment for the card pattern — orthogonal to the semantic
255
+ * `variant` (which conveys role / state).
256
+ */
257
+ type CardLook = "elevated" | "flat-bordered" | "borderless-divider" | "ticket" | "invoice" | "chip" | "tile-image-first";
253
258
  interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
254
259
  variant?: "default" | "bordered" | "elevated" | "interactive";
255
260
  padding?: "none" | "sm" | "md" | "lg";
@@ -259,6 +264,8 @@ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
259
264
  subtitle?: string;
260
265
  /** Shadow size override */
261
266
  shadow?: CardShadow;
267
+ /** Layer 2 visual treatment — orthogonal to the semantic variant. */
268
+ look?: CardLook;
262
269
  /** Card content */
263
270
  children?: React.ReactNode;
264
271
  }
@@ -3987,6 +3987,15 @@ var shadowStyles2 = {
3987
3987
  md: "shadow",
3988
3988
  lg: "shadow-elevation-dialog"
3989
3989
  };
3990
+ var lookStyles = {
3991
+ elevated: "",
3992
+ "flat-bordered": "shadow-none border-[length:var(--border-width)] border-border",
3993
+ "borderless-divider": "shadow-none border-0 border-b border-border rounded-none",
3994
+ ticket: "shadow-none border-dashed border-[length:var(--border-width)] border-border",
3995
+ invoice: "shadow-none border-[length:var(--border-width-thick)] border-border rounded-sm",
3996
+ chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3997
+ "tile-image-first": "p-0 overflow-hidden"
3998
+ };
3990
3999
  var Card = React8.forwardRef(
3991
4000
  ({
3992
4001
  className,
@@ -3995,6 +4004,7 @@ var Card = React8.forwardRef(
3995
4004
  title,
3996
4005
  subtitle,
3997
4006
  shadow,
4007
+ look = "elevated",
3998
4008
  children,
3999
4009
  ...props
4000
4010
  }, ref) => {
@@ -4007,6 +4017,7 @@ var Card = React8.forwardRef(
4007
4017
  "transition-all duration-[var(--transition-normal)]",
4008
4018
  variantStyles4[variant],
4009
4019
  paddingStyles2[padding],
4020
+ lookStyles[look],
4010
4021
  shadow && shadowStyles2[shadow],
4011
4022
  className
4012
4023
  ),