@heigin/ui 0.0.0-stage → 0.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +15 -0
  3. package/README.md +28 -2
  4. package/dist/base.css +44 -0
  5. package/dist/components/crm/activity-timeline.d.ts +23 -0
  6. package/dist/components/crm/activity-timeline.js +41 -0
  7. package/dist/components/crm/approval-card.d.ts +33 -0
  8. package/dist/components/crm/approval-card.js +101 -0
  9. package/dist/components/crm/channel-mark.d.ts +10 -0
  10. package/dist/components/crm/channel-mark.js +57 -0
  11. package/dist/components/crm/conversation-list-item.d.ts +23 -0
  12. package/dist/components/crm/conversation-list-item.js +62 -0
  13. package/dist/components/crm/crm.module.js +161 -0
  14. package/dist/components/crm/deal-stage.d.ts +13 -0
  15. package/dist/components/crm/deal-stage.js +27 -0
  16. package/dist/components/crm/detail-list.d.ts +17 -0
  17. package/dist/components/crm/detail-list.js +35 -0
  18. package/dist/components/crm/filter-chip.d.ts +16 -0
  19. package/dist/components/crm/filter-chip.js +45 -0
  20. package/dist/components/crm/filter-toolbar.d.ts +16 -0
  21. package/dist/components/crm/filter-toolbar.js +42 -0
  22. package/dist/components/crm/metric-card.d.ts +30 -0
  23. package/dist/components/crm/metric-card.js +61 -0
  24. package/dist/components/crm/money-value.d.ts +9 -0
  25. package/dist/components/crm/money-value.js +27 -0
  26. package/dist/components/crm/page-header.d.ts +11 -0
  27. package/dist/components/crm/page-header.js +28 -0
  28. package/dist/components/crm/record-header.d.ts +22 -0
  29. package/dist/components/crm/record-header.js +53 -0
  30. package/dist/components/crm/sidebar-nav.d.ts +33 -0
  31. package/dist/components/crm/sidebar-nav.js +53 -0
  32. package/dist/components/crm/sla-clock.d.ts +11 -0
  33. package/dist/components/crm/sla-clock.js +41 -0
  34. package/dist/components/crm/status-badge.d.ts +94 -0
  35. package/dist/components/crm/status-badge.js +106 -0
  36. package/dist/components/crm/task-row.d.ts +18 -0
  37. package/dist/components/crm/task-row.js +52 -0
  38. package/dist/components/crm/trust-rung-badge.d.ts +14 -0
  39. package/dist/components/crm/trust-rung-badge.js +35 -0
  40. package/dist/components/ui/alert-dialog.d.ts +22 -0
  41. package/dist/components/ui/alert-dialog.js +87 -0
  42. package/dist/components/ui/avatar.d.ts +13 -0
  43. package/dist/components/ui/avatar.js +38 -0
  44. package/dist/components/ui/avatar.module.js +17 -0
  45. package/dist/components/ui/badge.d.ts +12 -0
  46. package/dist/components/ui/badge.js +28 -0
  47. package/dist/components/ui/badge.module.js +25 -0
  48. package/dist/components/ui/button.d.ts +19 -0
  49. package/dist/components/ui/button.js +39 -0
  50. package/dist/components/ui/button.module.js +27 -0
  51. package/dist/components/ui/card.d.ts +19 -0
  52. package/dist/components/ui/card.js +35 -0
  53. package/dist/components/ui/card.module.js +23 -0
  54. package/dist/components/ui/checkbox.d.ts +11 -0
  55. package/dist/components/ui/checkbox.js +47 -0
  56. package/dist/components/ui/choice.module.js +28 -0
  57. package/dist/components/ui/dialog.d.ts +32 -0
  58. package/dist/components/ui/dialog.js +67 -0
  59. package/dist/components/ui/dialog.module.js +39 -0
  60. package/dist/components/ui/drawer.d.ts +20 -0
  61. package/dist/components/ui/drawer.js +44 -0
  62. package/dist/components/ui/dropdown-menu.d.ts +38 -0
  63. package/dist/components/ui/dropdown-menu.js +66 -0
  64. package/dist/components/ui/empty-state.d.ts +12 -0
  65. package/dist/components/ui/empty-state.js +33 -0
  66. package/dist/components/ui/empty-state.module.js +19 -0
  67. package/dist/components/ui/field.d.ts +38 -0
  68. package/dist/components/ui/field.js +77 -0
  69. package/dist/components/ui/field.module.js +17 -0
  70. package/dist/components/ui/icon-button.d.ts +9 -0
  71. package/dist/components/ui/icon-button.js +21 -0
  72. package/dist/components/ui/input.d.ts +8 -0
  73. package/dist/components/ui/input.js +23 -0
  74. package/dist/components/ui/input.module.js +25 -0
  75. package/dist/components/ui/kbd.d.ts +3 -0
  76. package/dist/components/ui/kbd.js +34 -0
  77. package/dist/components/ui/native-select.d.ts +10 -0
  78. package/dist/components/ui/native-select.js +26 -0
  79. package/dist/components/ui/pagination.d.ts +13 -0
  80. package/dist/components/ui/pagination.js +55 -0
  81. package/dist/components/ui/popover.d.ts +17 -0
  82. package/dist/components/ui/popover.js +41 -0
  83. package/dist/components/ui/popup.module.js +39 -0
  84. package/dist/components/ui/radio-group.d.ts +18 -0
  85. package/dist/components/ui/radio-group.js +50 -0
  86. package/dist/components/ui/search-input.d.ts +15 -0
  87. package/dist/components/ui/search-input.js +64 -0
  88. package/dist/components/ui/select.d.ts +27 -0
  89. package/dist/components/ui/select.js +71 -0
  90. package/dist/components/ui/skeleton.d.ts +12 -0
  91. package/dist/components/ui/skeleton.js +23 -0
  92. package/dist/components/ui/skeleton.module.js +15 -0
  93. package/dist/components/ui/spinner.d.ts +8 -0
  94. package/dist/components/ui/spinner.js +19 -0
  95. package/dist/components/ui/spinner.module.js +13 -0
  96. package/dist/components/ui/switch.d.ts +10 -0
  97. package/dist/components/ui/switch.js +35 -0
  98. package/dist/components/ui/table.d.ts +52 -0
  99. package/dist/components/ui/table.js +143 -0
  100. package/dist/components/ui/table.module.js +42 -0
  101. package/dist/components/ui/tabs.d.ts +25 -0
  102. package/dist/components/ui/tabs.js +47 -0
  103. package/dist/components/ui/tabs.module.js +21 -0
  104. package/dist/components/ui/textarea.d.ts +6 -0
  105. package/dist/components/ui/textarea.js +23 -0
  106. package/dist/components/ui/toast.d.ts +30 -0
  107. package/dist/components/ui/toast.js +81 -0
  108. package/dist/components/ui/toast.module.js +21 -0
  109. package/dist/components/ui/tooltip.d.ts +18 -0
  110. package/dist/components/ui/tooltip.js +30 -0
  111. package/dist/components/ui/visually-hidden.d.ts +3 -0
  112. package/dist/components/ui/visually-hidden.js +26 -0
  113. package/dist/index.d.ts +48 -0
  114. package/dist/index.js +50 -0
  115. package/dist/lib/cn.d.ts +2 -0
  116. package/dist/lib/cn.js +7 -0
  117. package/dist/lib/format.d.ts +6 -0
  118. package/dist/lib/format.js +33 -0
  119. package/dist/styles.css +2317 -0
  120. package/dist/tailwind.css +82 -0
  121. package/dist/tokens.css +131 -0
  122. package/dist/tokens.d.ts +339 -0
  123. package/dist/tokens.js +790 -0
  124. package/package.json +54 -4
@@ -0,0 +1,27 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import crm_module_default from "./crm.module.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/crm/deal-stage.tsx
5
+ /** Pipeline progress as segmented bars. Text conveys the position ("Stage 3 of 5: Proposal"). Server-component safe. */
6
+ function DealStage({ stages, current, lost = false, compact = false, className }) {
7
+ const index = Math.max(0, stages.indexOf(current));
8
+ const summary = `${lost ? "Lost at" : "Stage"} ${index + 1} of ${stages.length}: ${current}`;
9
+ return /* @__PURE__ */ jsx("div", {
10
+ className,
11
+ children: /* @__PURE__ */ jsx("ol", {
12
+ className: cn(crm_module_default.stages, compact && crm_module_default.stagesCompact),
13
+ "aria-label": summary,
14
+ title: compact ? summary : void 0,
15
+ children: stages.map((stage, i) => /* @__PURE__ */ jsxs("li", {
16
+ className: cn(crm_module_default.stage, i < index && crm_module_default.stageDone, i === index && (lost ? crm_module_default.stageLost : crm_module_default.stageCurrent)),
17
+ "aria-current": i === index ? "step" : void 0,
18
+ children: [/* @__PURE__ */ jsx("span", { className: crm_module_default.stageBar }), /* @__PURE__ */ jsx("span", {
19
+ className: crm_module_default.stageLabel,
20
+ children: stage
21
+ })]
22
+ }, stage))
23
+ })
24
+ });
25
+ }
26
+ //#endregion
27
+ export { DealStage };
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ export interface DetailItem {
3
+ label: string;
4
+ value: React.ReactNode;
5
+ /** Optional 14px Lucide icon before the label. */
6
+ icon?: React.ReactNode;
7
+ }
8
+ export interface DetailListProps extends Omit<React.HTMLAttributes<HTMLDListElement>, "children"> {
9
+ items: DetailItem[];
10
+ /** Label column width. Production uses 100px. */
11
+ labelWidth?: string;
12
+ }
13
+ /**
14
+ * Key/value facts for a record (production "Deal details" panel): 100px muted label column,
15
+ * 13px value, 12px row gap. A real <dl>, so pairs are announced together. Server-component safe.
16
+ */
17
+ export declare function DetailList({ items, labelWidth, className, style, ...props }: DetailListProps): React.JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import crm_module_default from "./crm.module.js";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/crm/detail-list.tsx
6
+ /**
7
+ * Key/value facts for a record (production "Deal details" panel): 100px muted label column,
8
+ * 13px value, 12px row gap. A real <dl>, so pairs are announced together. Server-component safe.
9
+ */
10
+ function DetailList({ items, labelWidth = "100px", className, style, ...props }) {
11
+ return /* @__PURE__ */ jsx("dl", {
12
+ className: cn(crm_module_default.details, className),
13
+ style: {
14
+ ["--detail-label-width"]: labelWidth,
15
+ ...style
16
+ },
17
+ ...props,
18
+ children: items.map((item) => /* @__PURE__ */ jsxs("div", {
19
+ className: crm_module_default.detailRow,
20
+ children: [/* @__PURE__ */ jsxs("dt", {
21
+ className: crm_module_default.detailLabel,
22
+ children: [item.icon && /* @__PURE__ */ jsx("span", {
23
+ "aria-hidden": "true",
24
+ className: crm_module_default.detailIcon,
25
+ children: item.icon
26
+ }), item.label]
27
+ }), /* @__PURE__ */ jsx("dd", {
28
+ className: crm_module_default.detailValue,
29
+ children: item.value
30
+ })]
31
+ }, item.label))
32
+ });
33
+ }
34
+ //#endregion
35
+ export { DetailList };
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ export interface FilterChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
3
+ /** Toggle chip: pressed state. Omit `pressed` and pass `onRemove` for an applied-filter chip. */
4
+ pressed?: boolean;
5
+ onPressedChange?: (pressed: boolean) => void;
6
+ /** Applied-filter chip: shows a remove button instead of toggling. */
7
+ onRemove?: () => void;
8
+ count?: number;
9
+ /** Accessible name for the remove button. Defaults to "Remove filter: <chip text>". */
10
+ removeLabel?: string;
11
+ }
12
+ /**
13
+ * Quick filter. Two modes: a toggle (aria-pressed) for preset filters such as "Hot" or "Unassigned",
14
+ * or a removable chip that shows an applied filter ("Owner: Meera S ×").
15
+ */
16
+ export declare const FilterChip: React.ForwardRefExoticComponent<FilterChipProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn } from "../../lib/cn.js";
4
+ import crm_module_default from "./crm.module.js";
5
+ import * as React from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { X } from "lucide-react";
8
+ //#region src/components/crm/filter-chip.tsx
9
+ /** Plain text of string/number children, e.g. ["Owner: ", "Meera S"] -> "Owner: Meera S". */
10
+ function textOf(children) {
11
+ return React.Children.toArray(children).filter((c) => typeof c === "string" || typeof c === "number").join("").trim();
12
+ }
13
+ /**
14
+ * Quick filter. Two modes: a toggle (aria-pressed) for preset filters such as "Hot" or "Unassigned",
15
+ * or a removable chip that shows an applied filter ("Owner: Meera S ×").
16
+ */
17
+ var FilterChip = React.forwardRef(function FilterChip({ pressed, onPressedChange, onRemove, count, removeLabel, className, children, ...props }, ref) {
18
+ if (onRemove) return /* @__PURE__ */ jsxs("span", {
19
+ className: cn(crm_module_default.chip, crm_module_default.chipStatic, className),
20
+ children: [children, /* @__PURE__ */ jsx("button", {
21
+ type: "button",
22
+ className: crm_module_default.chipRemove,
23
+ "aria-label": removeLabel ?? `Remove filter: ${textOf(children) || "filter"}`,
24
+ onClick: onRemove,
25
+ children: /* @__PURE__ */ jsx(X, {
26
+ strokeWidth: 2,
27
+ "aria-hidden": "true"
28
+ })
29
+ })]
30
+ });
31
+ return /* @__PURE__ */ jsxs("button", {
32
+ ref,
33
+ type: "button",
34
+ "aria-pressed": pressed ?? false,
35
+ className: cn(crm_module_default.chip, className),
36
+ onClick: () => onPressedChange?.(!pressed),
37
+ ...props,
38
+ children: [children, count !== void 0 && /* @__PURE__ */ jsx("span", {
39
+ className: crm_module_default.chipCount,
40
+ children: count
41
+ })]
42
+ });
43
+ });
44
+ //#endregion
45
+ export { FilterChip };
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ export interface FilterToolbarProps {
3
+ query: string;
4
+ onQueryChange: (query: string) => void;
5
+ searchLabel?: string;
6
+ searchPlaceholder?: string;
7
+ /** FilterChip elements. */
8
+ chips?: React.ReactNode;
9
+ /** Scope disclosure, e.g. "Showing 24 of 61 · your leads". Announced politely when it changes. */
10
+ scope?: React.ReactNode;
11
+ /** Right-aligned controls (view switcher, export). */
12
+ actions?: React.ReactNode;
13
+ className?: string;
14
+ }
15
+ /** Search + quick filters + scope line for list pages. */
16
+ export declare function FilterToolbar({ query, onQueryChange, searchLabel, searchPlaceholder, chips, scope, actions, className, }: FilterToolbarProps): React.JSX.Element;
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn } from "../../lib/cn.js";
4
+ import { SearchInput } from "../ui/search-input.js";
5
+ import crm_module_default from "./crm.module.js";
6
+ import "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/crm/filter-toolbar.tsx
9
+ /** Search + quick filters + scope line for list pages. */
10
+ function FilterToolbar({ query, onQueryChange, searchLabel = "Search", searchPlaceholder = "Search", chips, scope, actions, className }) {
11
+ return /* @__PURE__ */ jsxs("div", {
12
+ className: cn(crm_module_default.toolbar, className),
13
+ role: "search",
14
+ children: [
15
+ /* @__PURE__ */ jsx("div", {
16
+ className: crm_module_default.toolbarSearch,
17
+ children: /* @__PURE__ */ jsx(SearchInput, {
18
+ "aria-label": searchLabel,
19
+ placeholder: searchPlaceholder,
20
+ value: query,
21
+ onValueChange: onQueryChange
22
+ })
23
+ }),
24
+ chips && /* @__PURE__ */ jsx("div", {
25
+ className: crm_module_default.toolbarChips,
26
+ role: "group",
27
+ "aria-label": "Quick filters",
28
+ children: chips
29
+ }),
30
+ /* @__PURE__ */ jsxs("div", {
31
+ className: crm_module_default.toolbarEnd,
32
+ children: [scope && /* @__PURE__ */ jsx("span", {
33
+ className: crm_module_default.scope,
34
+ "aria-live": "polite",
35
+ children: scope
36
+ }), actions]
37
+ })
38
+ ]
39
+ });
40
+ }
41
+ //#endregion
42
+ export { FilterToolbar };
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ export interface MetricCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
3
+ label: string;
4
+ value: React.ReactNode;
5
+ /** Small context line under the value, e.g. "12 open deals". */
6
+ hint?: React.ReactNode;
7
+ /** 14–15px Lucide icon shown before the label. */
8
+ icon?: React.ReactNode;
9
+ /** Colour the value only when it needs attention (production: overdue tasks in danger). */
10
+ tone?: "default" | "danger" | "warning" | "success";
11
+ /** Optional change indicator. Direction is shown with an icon and words, not colour alone. */
12
+ trend?: {
13
+ direction: "up" | "down";
14
+ label: string;
15
+ good?: boolean;
16
+ };
17
+ }
18
+ /**
19
+ * One KPI: label, value and hint. On its own it renders as a bordered surface; inside a
20
+ * MetricGroup it becomes a cell of the production dashboard's single KPI strip. Server-component safe.
21
+ */
22
+ export declare function MetricCard({ label, value, hint, icon, tone, trend, className, ...props }: MetricCardProps): React.JSX.Element;
23
+ export interface MetricGroupProps extends React.HTMLAttributes<HTMLElement> {
24
+ /** Columns from 1024px up (2 below). Production dashboard uses 5. */
25
+ columns?: number;
26
+ /** Accessible name for the group, e.g. "Pipeline summary". */
27
+ label?: string;
28
+ }
29
+ /** Bordered KPI strip: MetricCards inside become divided cells. Server-component safe. */
30
+ export declare function MetricGroup({ columns, label, className, style, children, ...props }: MetricGroupProps): React.JSX.Element;
@@ -0,0 +1,61 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import crm_module_default from "./crm.module.js";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { TrendingDown, TrendingUp } from "lucide-react";
6
+ //#region src/components/crm/metric-card.tsx
7
+ /**
8
+ * One KPI: label, value and hint. On its own it renders as a bordered surface; inside a
9
+ * MetricGroup it becomes a cell of the production dashboard's single KPI strip. Server-component safe.
10
+ */
11
+ function MetricCard({ label, value, hint, icon, tone = "default", trend, className, ...props }) {
12
+ const toneClass = tone === "danger" ? crm_module_default.toneDanger : tone === "warning" ? crm_module_default.toneWarning : tone === "success" ? crm_module_default.toneSuccess : void 0;
13
+ const good = trend ? trend.good ?? trend.direction === "up" : false;
14
+ return /* @__PURE__ */ jsxs("div", {
15
+ className: cn(crm_module_default.metric, className),
16
+ ...props,
17
+ children: [
18
+ /* @__PURE__ */ jsxs("span", {
19
+ className: crm_module_default.metricLabel,
20
+ children: [icon && /* @__PURE__ */ jsx("span", {
21
+ "aria-hidden": "true",
22
+ style: { display: "inline-flex" },
23
+ children: icon
24
+ }), label]
25
+ }),
26
+ /* @__PURE__ */ jsx("span", {
27
+ className: cn(crm_module_default.metricValue, toneClass),
28
+ children: value
29
+ }),
30
+ (hint || trend) && /* @__PURE__ */ jsxs("span", {
31
+ className: crm_module_default.metricHint,
32
+ children: [trend && /* @__PURE__ */ jsxs("span", {
33
+ className: cn(crm_module_default.inlineMark, good ? crm_module_default.trendUp : crm_module_default.trendDown),
34
+ style: { marginRight: 6 },
35
+ children: [trend.direction === "up" ? /* @__PURE__ */ jsx(TrendingUp, {
36
+ strokeWidth: 1.6,
37
+ "aria-hidden": "true"
38
+ }) : /* @__PURE__ */ jsx(TrendingDown, {
39
+ strokeWidth: 1.6,
40
+ "aria-hidden": "true"
41
+ }), trend.label]
42
+ }), hint]
43
+ })
44
+ ]
45
+ });
46
+ }
47
+ /** Bordered KPI strip: MetricCards inside become divided cells. Server-component safe. */
48
+ function MetricGroup({ columns = 4, label, className, style, children, ...props }) {
49
+ return /* @__PURE__ */ jsx("section", {
50
+ "aria-label": label,
51
+ className: cn(crm_module_default.metricGroup, className),
52
+ style: {
53
+ ["--metric-columns"]: columns,
54
+ ...style
55
+ },
56
+ ...props,
57
+ children
58
+ });
59
+ }
60
+ //#endregion
61
+ export { MetricCard, MetricGroup };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ export interface MoneyValueProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
3
+ amount: number;
4
+ /** `full` = ₹8,49,600 · `compact` = ₹8.5L (full value exposed via title + accessible text). */
5
+ format?: "full" | "compact";
6
+ withPaise?: boolean;
7
+ }
8
+ /** The only sanctioned way to render money: Indian grouping and tabular numerals. Server-component safe. */
9
+ export declare function MoneyValue({ amount, format, withPaise, className, ...props }: MoneyValueProps): React.JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { VisuallyHidden } from "../ui/visually-hidden.js";
3
+ import { formatINR, formatINRCompact } from "../../lib/format.js";
4
+ import crm_module_default from "./crm.module.js";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/crm/money-value.tsx
8
+ /** The only sanctioned way to render money: Indian grouping and tabular numerals. Server-component safe. */
9
+ function MoneyValue({ amount, format = "full", withPaise = false, className, ...props }) {
10
+ const full = formatINR(amount, withPaise);
11
+ if (format === "compact") return /* @__PURE__ */ jsxs("span", {
12
+ className: cn(crm_module_default.money, className),
13
+ title: full,
14
+ ...props,
15
+ children: [/* @__PURE__ */ jsx("span", {
16
+ "aria-hidden": "true",
17
+ children: formatINRCompact(amount)
18
+ }), /* @__PURE__ */ jsx(VisuallyHidden, { children: full })]
19
+ });
20
+ return /* @__PURE__ */ jsx("span", {
21
+ className: cn(crm_module_default.money, className),
22
+ ...props,
23
+ children: full
24
+ });
25
+ }
26
+ //#endregion
27
+ export { MoneyValue };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
3
+ title: React.ReactNode;
4
+ description?: React.ReactNode;
5
+ /** Primary and secondary page actions, right-aligned (wraps below on narrow screens). */
6
+ actions?: React.ReactNode;
7
+ /** Heading level. Pages use the default h1; pass 2 when embedding the header inside another page. */
8
+ level?: 1 | 2;
9
+ }
10
+ /** Page title row: h1, one line of context, and the page's actions. Server-component safe. */
11
+ export declare function PageHeader({ title, description, actions, level, className, ...props }: PageHeaderProps): React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import crm_module_default from "./crm.module.js";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/crm/page-header.tsx
6
+ /** Page title row: h1, one line of context, and the page's actions. Server-component safe. */
7
+ function PageHeader({ title, description, actions, level = 1, className, ...props }) {
8
+ const Heading = level === 1 ? "h1" : "h2";
9
+ return /* @__PURE__ */ jsxs("header", {
10
+ className: cn(crm_module_default.pageHeader, className),
11
+ ...props,
12
+ children: [/* @__PURE__ */ jsxs("div", {
13
+ className: crm_module_default.pageHeaderText,
14
+ children: [/* @__PURE__ */ jsx(Heading, {
15
+ className: crm_module_default.pageTitle,
16
+ children: title
17
+ }), description && /* @__PURE__ */ jsx("p", {
18
+ className: crm_module_default.pageDescription,
19
+ children: description
20
+ })]
21
+ }), actions && /* @__PURE__ */ jsx("div", {
22
+ className: crm_module_default.pageActions,
23
+ children: actions
24
+ })]
25
+ });
26
+ }
27
+ //#endregion
28
+ export { PageHeader };
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ export interface Breadcrumb {
3
+ label: string;
4
+ href?: string;
5
+ }
6
+ export interface RecordHeaderProps {
7
+ /** Record name: person, company or deal. */
8
+ name: string;
9
+ /** Status next to the name (StatusBadge, TrustRungBadge). */
10
+ status?: React.ReactNode;
11
+ /** Short facts: owner, value, location, channel. */
12
+ meta?: React.ReactNode[];
13
+ breadcrumbs?: Breadcrumb[];
14
+ actions?: React.ReactNode;
15
+ showAvatar?: boolean;
16
+ avatarSrc?: string;
17
+ /** Heading level. Detail pages use the default h1; pass 2 when embedding. */
18
+ level?: 1 | 2;
19
+ className?: string;
20
+ }
21
+ /** Top of a record detail page: breadcrumbs, avatar, name, status, key facts and actions. Server-component safe. */
22
+ export declare function RecordHeader({ name, status, meta, breadcrumbs, actions, showAvatar, avatarSrc, level, className }: RecordHeaderProps): React.JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { Avatar } from "../ui/avatar.js";
3
+ import crm_module_default from "./crm.module.js";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/crm/record-header.tsx
7
+ /** Top of a record detail page: breadcrumbs, avatar, name, status, key facts and actions. Server-component safe. */
8
+ function RecordHeader({ name, status, meta, breadcrumbs, actions, showAvatar = true, avatarSrc, level = 1, className }) {
9
+ const Heading = level === 1 ? "h1" : "h2";
10
+ return /* @__PURE__ */ jsxs("header", {
11
+ className,
12
+ children: [breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx("nav", {
13
+ "aria-label": "Breadcrumb",
14
+ className: crm_module_default.breadcrumbs,
15
+ children: /* @__PURE__ */ jsx("ol", { children: breadcrumbs.map((b, i) => /* @__PURE__ */ jsx("li", { children: b.href ? /* @__PURE__ */ jsx("a", {
16
+ href: b.href,
17
+ children: b.label
18
+ }) : /* @__PURE__ */ jsx("span", {
19
+ "aria-current": "page",
20
+ children: b.label
21
+ }) }, `${b.label}-${i}`)) })
22
+ }), /* @__PURE__ */ jsxs("div", {
23
+ className: cn(crm_module_default.record),
24
+ children: [
25
+ showAvatar && /* @__PURE__ */ jsx(Avatar, {
26
+ name,
27
+ src: avatarSrc,
28
+ size: "lg",
29
+ decorative: true
30
+ }),
31
+ /* @__PURE__ */ jsxs("div", {
32
+ className: crm_module_default.recordText,
33
+ children: [/* @__PURE__ */ jsxs("div", {
34
+ className: crm_module_default.recordTitleRow,
35
+ children: [/* @__PURE__ */ jsx(Heading, {
36
+ className: crm_module_default.recordTitle,
37
+ children: name
38
+ }), status]
39
+ }), meta && meta.length > 0 && /* @__PURE__ */ jsx("ul", {
40
+ className: crm_module_default.recordMeta,
41
+ children: meta.map((m, i) => /* @__PURE__ */ jsx("li", { children: m }, i))
42
+ })]
43
+ }),
44
+ actions && /* @__PURE__ */ jsx("div", {
45
+ className: crm_module_default.pageActions,
46
+ children: actions
47
+ })
48
+ ]
49
+ })]
50
+ });
51
+ }
52
+ //#endregion
53
+ export { RecordHeader };
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ export interface SidebarNavItem {
3
+ label: string;
4
+ href: string;
5
+ icon?: React.ReactNode;
6
+ /** Badge count, e.g. unread conversations. */
7
+ count?: number;
8
+ }
9
+ export interface SidebarNavGroup {
10
+ /** Optional group heading ("Money", "Agent"). */
11
+ label?: string;
12
+ items: SidebarNavItem[];
13
+ }
14
+ export interface SidebarNavProps {
15
+ groups: SidebarNavGroup[];
16
+ /** `href` of the current page; gets aria-current="page". */
17
+ currentHref: string;
18
+ /** Accessible name for the <nav>. */
19
+ label?: string;
20
+ /**
21
+ * Custom link renderer for client-side routing, e.g. Next.js:
22
+ * renderLink={(props) => <Link {...props} />}
23
+ */
24
+ renderLink?: (props: React.AnchorHTMLAttributes<HTMLAnchorElement> & {
25
+ href: string;
26
+ }) => React.ReactNode;
27
+ className?: string;
28
+ }
29
+ /**
30
+ * App navigation rail content (place it inside your 240px sidebar, or a left Drawer on mobile).
31
+ * Server-component safe unless you pass a client-only renderLink.
32
+ */
33
+ export declare function SidebarNav({ groups, currentHref, label, renderLink, className }: SidebarNavProps): React.JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import crm_module_default from "./crm.module.js";
3
+ import "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/crm/sidebar-nav.tsx
6
+ /**
7
+ * App navigation rail content (place it inside your 240px sidebar, or a left Drawer on mobile).
8
+ * Server-component safe unless you pass a client-only renderLink.
9
+ */
10
+ function SidebarNav({ groups, currentHref, label = "Main", renderLink, className }) {
11
+ return /* @__PURE__ */ jsx("nav", {
12
+ "aria-label": label,
13
+ className: cn(crm_module_default.sidebar, className),
14
+ children: groups.map((group, gi) => {
15
+ const headingId = group.label ? `hg-nav-${gi}` : void 0;
16
+ return /* @__PURE__ */ jsxs("div", { children: [group.label && /* @__PURE__ */ jsx("p", {
17
+ id: headingId,
18
+ className: crm_module_default.navGroupLabel,
19
+ children: group.label
20
+ }), /* @__PURE__ */ jsx("ul", {
21
+ className: crm_module_default.navList,
22
+ "aria-labelledby": headingId,
23
+ children: group.items.map((item) => {
24
+ const current = item.href === currentHref;
25
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ item.icon && /* @__PURE__ */ jsx("span", {
27
+ "aria-hidden": "true",
28
+ style: { display: "inline-flex" },
29
+ children: item.icon
30
+ }),
31
+ /* @__PURE__ */ jsx("span", {
32
+ className: crm_module_default.navLabel,
33
+ children: item.label
34
+ }),
35
+ item.count !== void 0 && item.count > 0 && /* @__PURE__ */ jsx("span", {
36
+ className: crm_module_default.navCount,
37
+ children: item.count
38
+ })
39
+ ] });
40
+ const linkProps = {
41
+ href: item.href,
42
+ className: crm_module_default.navItem,
43
+ "aria-current": current ? "page" : void 0,
44
+ children: content
45
+ };
46
+ return /* @__PURE__ */ jsx("li", { children: renderLink ? renderLink(linkProps) : /* @__PURE__ */ jsx("a", { ...linkProps }) }, item.href);
47
+ })
48
+ })] }, group.label ?? gi);
49
+ })
50
+ });
51
+ }
52
+ //#endregion
53
+ export { SidebarNav };
@@ -0,0 +1,11 @@
1
+ export type SLAState = "on_track" | "due_soon" | "breached";
2
+ export interface SLAClockProps {
3
+ state: SLAState;
4
+ /** Human time string, e.g. "2h 10m left" or "20m over". Compute it in your app. */
5
+ time: string;
6
+ /** Show the state word visibly (default hidden, still announced). */
7
+ showLabel?: boolean;
8
+ className?: string;
9
+ }
10
+ /** First-reply SLA countdown. The state word and time carry meaning, not just colour. Server-component safe. */
11
+ export declare function SLAClock({ state, time, showLabel, className }: SLAClockProps): import("react").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { VisuallyHidden } from "../ui/visually-hidden.js";
3
+ import crm_module_default from "./crm.module.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Clock } from "lucide-react";
6
+ //#region src/components/crm/sla-clock.tsx
7
+ var STATE = {
8
+ on_track: {
9
+ className: crm_module_default.toneSuccess,
10
+ word: "On track"
11
+ },
12
+ due_soon: {
13
+ className: crm_module_default.toneWarning,
14
+ word: "Due soon"
15
+ },
16
+ breached: {
17
+ className: crm_module_default.toneDanger,
18
+ word: "Breached"
19
+ }
20
+ };
21
+ /** First-reply SLA countdown. The state word and time carry meaning, not just colour. Server-component safe. */
22
+ function SLAClock({ state, time, showLabel = false, className }) {
23
+ const { className: tone, word } = STATE[state];
24
+ return /* @__PURE__ */ jsxs("span", {
25
+ className: cn(crm_module_default.inlineMark, tone, className),
26
+ "data-state": state,
27
+ children: [
28
+ /* @__PURE__ */ jsx(Clock, {
29
+ strokeWidth: 1.6,
30
+ "aria-hidden": "true"
31
+ }),
32
+ showLabel ? /* @__PURE__ */ jsxs("span", { children: [word, " ·"] }) : /* @__PURE__ */ jsxs(VisuallyHidden, { children: [word, ":"] }),
33
+ /* @__PURE__ */ jsx("span", {
34
+ className: crm_module_default.tabular,
35
+ children: time
36
+ })
37
+ ]
38
+ });
39
+ }
40
+ //#endregion
41
+ export { SLAClock };