@almadar/ui 4.25.0 → 4.27.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.
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { LucideIcon } from "lucide-react";
3
- import type { EventEmit } from "@almadar/core";
3
+ import type { EventEmit, EventKey } from "@almadar/core";
4
4
  export interface NavItem {
5
5
  label: string;
6
6
  href: string;
@@ -20,6 +20,25 @@ export interface NotificationItem {
20
20
  /** Optional flag — bell badge counts items where read !== true. */
21
21
  read?: boolean;
22
22
  }
23
+ /** A generic top-bar action button. Domain-agnostic — consumers wire any
24
+ * combination (cart icon, profile, help, custom). Each entry renders as
25
+ * an icon button between the search bar and the notifications bell;
26
+ * click dispatches the configured event onto the bus. */
27
+ export interface TopBarAction {
28
+ /** Lucide icon name (e.g. "shopping-cart", "user", "help-circle"). */
29
+ icon: string;
30
+ /** Optional aria-label / tooltip. Falls back to `icon`. */
31
+ label?: string;
32
+ /** Bus event fired on click. Dispatched as `UI:{event}` with empty payload.
33
+ * Typed as `EventKey` so the pattern-sync detector marks `topBarActions`
34
+ * as `event-list` and the validator checks references against trait
35
+ * emit/listen sets. */
36
+ event: EventKey;
37
+ /** Optional badge — number or string rendered in the corner of the icon. */
38
+ badge?: number | string;
39
+ /** Visual variant. Default `"default"`. */
40
+ variant?: "default" | "primary" | "danger";
41
+ }
23
42
  export interface DashboardLayoutProps {
24
43
  /** App name shown in sidebar */
25
44
  appName?: string;
@@ -49,6 +68,12 @@ export interface DashboardLayoutProps {
49
68
  /** React-side search submit callback. Used when the host wires the
50
69
  * layout directly (not via render-ui pattern resolution). */
51
70
  onSearchSubmit?: (value: string) => void;
71
+ /** Generic top-bar action buttons rendered between the search bar and
72
+ * the notifications bell. Each entry: `{icon, label?, event, badge?, variant?}`.
73
+ * Domain-agnostic — consumers add a cart icon, profile button, help-bubble,
74
+ * or any other top-bar action by appending entries. Empty array (default)
75
+ * renders nothing. */
76
+ topBarActions?: TopBarAction[];
52
77
  /** Notification list. Pass an empty array to show the bell with no
53
78
  * badge; omit / pass null to hide the bell entirely. */
54
79
  notifications?: NotificationItem[] | null;
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
27
27
  var React5__default = /*#__PURE__*/_interopDefault(React5);
28
28
  var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
29
29
 
30
- // node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
30
+ // node_modules/clsx/dist/clsx.mjs
31
31
  function r(e) {
32
32
  var t, f, n = "";
33
33
  if ("string" == typeof e || "number" == typeof e) n += e;
@@ -42,7 +42,7 @@ function clsx() {
42
42
  return n;
43
43
  }
44
44
 
45
- // node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
45
+ // node_modules/tailwind-merge/dist/bundle-mjs.mjs
46
46
  var CLASS_PART_SEPARATOR = "-";
47
47
  var createClassGroupUtils = (config) => {
48
48
  const classMap = createClassMap(config);
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import * as LucideIcons from 'lucide-react';
4
4
  import { Loader2, ChevronDown, X } from 'lucide-react';
5
5
 
6
- // node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
6
+ // node_modules/clsx/dist/clsx.mjs
7
7
  function r(e) {
8
8
  var t, f, n = "";
9
9
  if ("string" == typeof e || "number" == typeof e) n += e;
@@ -18,7 +18,7 @@ function clsx() {
18
18
  return n;
19
19
  }
20
20
 
21
- // node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
21
+ // node_modules/tailwind-merge/dist/bundle-mjs.mjs
22
22
  var CLASS_PART_SEPARATOR = "-";
23
23
  var createClassGroupUtils = (config) => {
24
24
  const classMap = createClassMap(config);
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
27
27
  var React6__default = /*#__PURE__*/_interopDefault(React6);
28
28
  var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
29
29
 
30
- // node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
30
+ // node_modules/clsx/dist/clsx.mjs
31
31
  function r(e) {
32
32
  var t, f3, n = "";
33
33
  if ("string" == typeof e || "number" == typeof e) n += e;
@@ -42,7 +42,7 @@ function clsx() {
42
42
  return n;
43
43
  }
44
44
 
45
- // node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
45
+ // node_modules/tailwind-merge/dist/bundle-mjs.mjs
46
46
  var CLASS_PART_SEPARATOR = "-";
47
47
  var createClassGroupUtils = (config) => {
48
48
  const classMap = createClassMap(config);
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import * as LucideIcons from 'lucide-react';
4
4
  import { Loader2, Check, User } from 'lucide-react';
5
5
 
6
- // node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
6
+ // node_modules/clsx/dist/clsx.mjs
7
7
  function r(e) {
8
8
  var t, f3, n = "";
9
9
  if ("string" == typeof e || "number" == typeof e) n += e;
@@ -18,7 +18,7 @@ function clsx() {
18
18
  return n;
19
19
  }
20
20
 
21
- // node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
21
+ // node_modules/tailwind-merge/dist/bundle-mjs.mjs
22
22
  var CLASS_PART_SEPARATOR = "-";
23
23
  var createClassGroupUtils = (config) => {
24
24
  const classMap = createClassMap(config);