@pattern-stack/frontend-patterns 0.2.0-alpha.15 → 0.2.0-alpha.18

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 (28) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/atoms/components/data/Duration/Duration.d.ts +11 -0
  3. package/dist/atoms/components/data/Duration/Duration.d.ts.map +1 -0
  4. package/dist/atoms/components/data/Duration/index.d.ts +2 -0
  5. package/dist/atoms/components/data/Duration/index.d.ts.map +1 -0
  6. package/dist/atoms/components/data/LiveIndicator/LiveIndicator.d.ts +12 -0
  7. package/dist/atoms/components/data/LiveIndicator/LiveIndicator.d.ts.map +1 -0
  8. package/dist/atoms/components/data/LiveIndicator/index.d.ts +2 -0
  9. package/dist/atoms/components/data/LiveIndicator/index.d.ts.map +1 -0
  10. package/dist/atoms/components/data/Sparkline/Sparkline.d.ts +16 -0
  11. package/dist/atoms/components/data/Sparkline/Sparkline.d.ts.map +1 -0
  12. package/dist/atoms/components/data/Sparkline/index.d.ts +2 -0
  13. package/dist/atoms/components/data/Sparkline/index.d.ts.map +1 -0
  14. package/dist/atoms/components/data/Timestamp/Timestamp.d.ts +13 -0
  15. package/dist/atoms/components/data/Timestamp/Timestamp.d.ts.map +1 -0
  16. package/dist/atoms/components/data/Timestamp/index.d.ts +2 -0
  17. package/dist/atoms/components/data/Timestamp/index.d.ts.map +1 -0
  18. package/dist/atoms/components/data/index.d.ts +4 -0
  19. package/dist/atoms/components/data/index.d.ts.map +1 -1
  20. package/dist/atoms/types/navigation.d.ts +9 -2
  21. package/dist/atoms/types/navigation.d.ts.map +1 -1
  22. package/dist/index.es.js +239 -22
  23. package/dist/index.es.js.map +1 -1
  24. package/dist/index.js +239 -22
  25. package/dist/index.js.map +1 -1
  26. package/dist/molecules/layout/Sidebar.d.ts.map +1 -1
  27. package/dist/templates/factory.d.ts.map +1 -1
  28. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.0-alpha.17]
11
+
12
+ ### Fixed
13
+ - **`SidebarButton` label no longer wraps mid-animation**: added `whitespace-nowrap` to the label `<span>` so the text stays on one line during the Sidebar's `w-16 ↔ w-64` expand/collapse width transition, instead of briefly wrapping onto two lines.
14
+
15
+ ## [0.2.0-alpha.16]
16
+
17
+ ### Added
18
+ - **`Sidebar` renders `navigation.logo`**: the previously unused `NavigationConfig.logo` field now appears at the top of the sidebar when expanded. Strings render in a small semibold label (`text-sm font-semibold text-foreground truncate`); `ReactNode` values render as-is so consumers can pass an `<img>`, SVG, or composed branding element. The collapse toggle moves to the right of the logo when expanded; when collapsed, the toggle remains centered alone (unchanged behavior).
19
+
20
+ ### Changed
21
+ - **`NavigationConfig.logo` widened to `string | ReactNode | undefined`** so consumers can pass arbitrary branding nodes, not just strings.
22
+
10
23
  ## [0.2.0-alpha.15]
11
24
 
12
25
  ### Fixed
@@ -0,0 +1,11 @@
1
+ export interface DurationProps {
2
+ ms: number;
3
+ precision?: "auto" | "s" | "ms";
4
+ className?: string;
5
+ }
6
+ /**
7
+ * Duration — renders a millisecond value as a compact, human-readable span
8
+ * with an accessible spoken label (e.g. 1500 → "1.5s", aria-label "1.5 seconds").
9
+ */
10
+ export declare function Duration({ ms, precision, className }: DurationProps): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=Duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Duration.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/Duration/Duration.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6CD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,EAAE,SAAkB,EAAE,SAAS,EAAE,EAAE,aAAa,2CAgB5E"}
@@ -0,0 +1,2 @@
1
+ export { Duration, type DurationProps } from "./Duration";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/Duration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface LiveIndicatorProps {
2
+ active: boolean;
3
+ label?: string;
4
+ className?: string;
5
+ }
6
+ /**
7
+ * LiveIndicator — a small status pill with a pulsing dot signalling a live /
8
+ * connected state (e.g. real-time sync, streaming). Announces its state via
9
+ * role="status" + aria-live for assistive tech.
10
+ */
11
+ export declare function LiveIndicator({ active, label, className, }: LiveIndicatorProps): import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=LiveIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/LiveIndicator/LiveIndicator.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,KAAc,EACd,SAAS,GACV,EAAE,kBAAkB,2CAuBpB"}
@@ -0,0 +1,2 @@
1
+ export { LiveIndicator, type LiveIndicatorProps } from "./LiveIndicator";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/LiveIndicator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface SparklineProps {
2
+ data: number[];
3
+ width?: number;
4
+ height?: number;
5
+ color?: string;
6
+ fill?: string;
7
+ strokeWidth?: number;
8
+ markLast?: boolean;
9
+ }
10
+ /**
11
+ * Sparkline — a tiny inline trend chart drawn as a single SVG polyline.
12
+ * Lightweight alternative to <Chart> for in-cell / in-row sparklines.
13
+ * Renders an empty (aria-hidden) svg when given fewer than 2 points.
14
+ */
15
+ export declare function Sparkline({ data, width, height, color, fill, strokeWidth, markLast, }: SparklineProps): import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=Sparkline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/Sparkline/Sparkline.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,KAAW,EACX,MAAW,EACX,KAAsC,EACtC,IAAI,EACJ,WAAiB,EACjB,QAAgB,GACjB,EAAE,cAAc,2CAyDhB"}
@@ -0,0 +1,2 @@
1
+ export { Sparkline, type SparklineProps } from "./Sparkline";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/Sparkline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,13 @@
1
+ export interface TimestampProps {
2
+ value: string | Date | number;
3
+ format?: "relative" | "absolute" | "both";
4
+ tz?: string;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Timestamp — renders a date/time value as a semantic <time> element.
9
+ * In "relative" / "both" modes it self-updates every 30s. "both" shows the
10
+ * absolute time with the relative time on hover.
11
+ */
12
+ export declare function Timestamp({ value, format, tz, className, }: TimestampProps): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=Timestamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timestamp.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/Timestamp/Timestamp.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmCD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAmB,EACnB,EAAE,EACF,SAAS,GACV,EAAE,cAAc,2CA0BhB"}
@@ -0,0 +1,2 @@
1
+ export { Timestamp, type TimestampProps } from "./Timestamp";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/Timestamp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -9,6 +9,10 @@ export { ProgressBar, type ProgressBarProps } from "./ProgressBar";
9
9
  export { ListCard, type ListCardProps } from "./ListCard";
10
10
  export { EntityIcon, type EntityIconProps } from "./EntityIcon";
11
11
  export { TruncatedText, type TruncatedTextProps } from "./TruncatedText";
12
+ export { Duration, type DurationProps } from "./Duration";
13
+ export { Timestamp, type TimestampProps } from "./Timestamp";
14
+ export { Sparkline, type SparklineProps } from "./Sparkline";
15
+ export { LiveIndicator, type LiveIndicatorProps } from "./LiveIndicator";
12
16
  export { ActivityFeed, type ActivityFeedProps, type ActivityItem, type ActivityType, type ActivityVariant, } from "./ActivityFeed";
13
17
  export { ConnectionStatus, type ConnectionStatusProps, } from "../../composed/ConnectionStatus";
14
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/atoms/components/data/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,WAAW,EACX,KAAK,UAAU,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/atoms/components/data/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,WAAW,EACX,KAAK,UAAU,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,iCAAiC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from "react";
1
2
  export type IconName = "Palette" | "Menu" | "X" | "Shield" | "Users" | "BarChart" | "BarChart2" | "BarChart3" | "BarChart4" | "LineChart" | "AreaChart" | "PieChart" | "Database" | "TrendingUp" | "TrendingDown" | "Activity" | "Layout" | "Home" | "Settings" | "Bell" | "Search" | "Plus" | "Edit" | "Trash2" | "Eye" | "Download" | "Upload" | "Share" | "Lock" | "Unlock" | "Mail" | "Phone" | "Calendar" | "Clock" | "MapPin" | "Map" | "Star" | "Heart" | "Bookmark" | "Tag" | "Flag" | "File" | "Folder" | "Image" | "Video" | "Music" | "ChevronRight" | "ChevronDown" | "ChevronLeft" | "ChevronUp" | "ArrowRight" | "ArrowLeft" | "ArrowUp" | "ArrowDown" | "Check" | "AlertCircle" | "Info" | "HelpCircle" | "Building" | "Truck" | "Handshake" | "User" | "Brain" | "Calculator" | "ShoppingCart" | "Utensils" | "Car" | "Zap" | "Film" | "ShoppingBag" | "Wrench" | "CreditCard" | "Wallet" | "PiggyBank" | "Receipt" | "DollarSign" | "Percent" | "Gift" | "Package" | "Coffee" | "Plane" | "Bus" | "Fuel" | "Sparkles" | "Scissors" | "Dumbbell" | "Pill" | "Stethoscope" | "GraduationCap" | "Book" | "BookOpen" | "Gamepad2" | "Tv" | "Wifi" | "Droplets" | "Flame" | "TreePine" | "Dog" | "Baby" | "Shirt" | "Sofa" | "Hammer" | "Paintbrush" | "Lightbulb";
2
3
  export interface NavigationItem {
3
4
  /** Unique identifier for the navigation item */
@@ -22,8 +23,14 @@ export interface NavigationConfig {
22
23
  items: NavigationItem[];
23
24
  /** Whether to show the default showcase navigation as fallback */
24
25
  showDefaultNavigation?: boolean;
25
- /** Custom logo or title for the sidebar header */
26
- logo?: string;
26
+ /**
27
+ * Custom logo or title for the sidebar header. Renders at the top of the
28
+ * Sidebar (left of the collapse toggle) when the sidebar is expanded; hidden
29
+ * when collapsed. A `string` is rendered inside a small semibold label;
30
+ * a `ReactNode` is rendered as-is so consumers can pass an `<img>`, SVG,
31
+ * or composed branding element.
32
+ */
33
+ logo?: string | ReactNode;
27
34
  /** Whether the sidebar starts expanded */
28
35
  defaultExpanded?: boolean;
29
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/navigation.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,MAAM,GACN,GAAG,GACH,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,UAAU,GACV,YAAY,GACZ,cAAc,GACd,UAAU,GACV,QAAQ,GACR,MAAM,GACN,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,QAAQ,GACR,KAAK,GACL,UAAU,GACV,QAAQ,GACR,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,OAAO,GACP,QAAQ,GACR,KA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C9C,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,kEAAkE;IAClE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/navigation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,MAAM,GACN,GAAG,GACH,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,UAAU,GACV,YAAY,GACZ,cAAc,GACd,UAAU,GACV,QAAQ,GACR,MAAM,GACN,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,QAAQ,GACR,KAAK,GACL,UAAU,GACV,QAAQ,GACR,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,OAAO,GACP,QAAQ,GACR,KAAK,GACL,MAAM,GACN,OAAO,GACP,UAAU,GACV,KAAK,GACL,MAAM,GACN,MAAM,GACN,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,cAAc,GACd,aAAa,GACb,aAAa,GACb,WAAW,GACX,YAAY,GACZ,WAAW,GACX,SAAS,GACT,WAAW,GACX,OAAO,GACP,aAAa,GACb,MAAM,GACN,YAAY,GACZ,UAAU,GACV,OAAO,GACP,WAAW,GACX,MAAM,GACN,OAAO,GACP,YAAY,GAEZ,cAAc,GACd,UAAU,GACV,KAAK,GACL,KAAK,GACL,MAAM,GACN,aAAa,GACb,Q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7752
7752
  };
7753
+ function formatAuto(ms) {
7754
+ if (ms < 1e3) {
7755
+ return { visible: `${ms}ms`, spoken: `${ms} milliseconds` };
7756
+ }
7757
+ if (ms < 6e4) {
7758
+ const secs = ms / 1e3;
7759
+ return {
7760
+ visible: `${secs.toFixed(1)}s`,
7761
+ spoken: `${secs.toFixed(1)} seconds`
7762
+ };
7763
+ }
7764
+ if (ms < 36e5) {
7765
+ const m = Math.floor(ms / 6e4);
7766
+ const s = Math.round(ms % 6e4 / 1e3);
7767
+ return { visible: `${m}m ${s}s`, spoken: `${m} minutes ${s} seconds` };
7768
+ }
7769
+ if (ms < 864e5) {
7770
+ const h2 = Math.floor(ms / 36e5);
7771
+ const m = Math.round(ms % 36e5 / 6e4);
7772
+ return { visible: `${h2}h ${m}m`, spoken: `${h2} hours ${m} minutes` };
7773
+ }
7774
+ const d = Math.floor(ms / 864e5);
7775
+ const h = Math.round(ms % 864e5 / 36e5);
7776
+ return { visible: `${d}d ${h}h`, spoken: `${d} days ${h} hours` };
7777
+ }
7778
+ function formatS(ms) {
7779
+ const secs = ms / 1e3;
7780
+ return {
7781
+ visible: `${secs.toFixed(1)}s`,
7782
+ spoken: `${secs.toFixed(1)} seconds`
7783
+ };
7784
+ }
7785
+ function formatMs(ms) {
7786
+ return { visible: `${ms}ms`, spoken: `${ms} milliseconds` };
7787
+ }
7788
+ function Duration({ ms, precision = "auto", className }) {
7789
+ const { visible, spoken } = precision === "s" ? formatS(ms) : precision === "ms" ? formatMs(ms) : formatAuto(ms);
7790
+ return /* @__PURE__ */ jsx(
7791
+ "span",
7792
+ {
7793
+ "aria-label": spoken,
7794
+ className: cn("font-mono text-xs text-muted-foreground", className),
7795
+ children: visible
7796
+ }
7797
+ );
7798
+ }
7799
+ function toDate(v) {
7800
+ return v instanceof Date ? v : new Date(v);
7801
+ }
7802
+ function formatRelative(date, now) {
7803
+ const diffMs = now.getTime() - date.getTime();
7804
+ const abs = Math.abs(diffMs);
7805
+ const suffix = diffMs >= 0 ? "ago" : "from now";
7806
+ if (abs < 6e4) return "just now";
7807
+ if (abs < 36e5) {
7808
+ const m = Math.floor(abs / 6e4);
7809
+ return `${m}m ${suffix}`;
7810
+ }
7811
+ if (abs < 864e5) {
7812
+ const h = Math.floor(abs / 36e5);
7813
+ return `${h}h ${suffix}`;
7814
+ }
7815
+ if (abs < 6048e5) {
7816
+ const d = Math.floor(abs / 864e5);
7817
+ return d === 1 ? "yesterday" : `${d}d ${suffix}`;
7818
+ }
7819
+ return date.toLocaleDateString(void 0);
7820
+ }
7821
+ function formatAbsolute(date, tz) {
7822
+ return date.toLocaleString(void 0, {
7823
+ dateStyle: "short",
7824
+ timeStyle: "short",
7825
+ timeZone: tz
7826
+ });
7827
+ }
7828
+ function Timestamp({
7829
+ value,
7830
+ format = "relative",
7831
+ tz,
7832
+ className
7833
+ }) {
7834
+ const date = toDate(value);
7835
+ const iso = date.toISOString();
7836
+ const [now, setNow] = useState(() => /* @__PURE__ */ new Date());
7837
+ useEffect(() => {
7838
+ if (format === "absolute") return;
7839
+ const id = setInterval(() => setNow(/* @__PURE__ */ new Date()), 3e4);
7840
+ return () => clearInterval(id);
7841
+ }, [format]);
7842
+ const absolute = formatAbsolute(date, tz);
7843
+ const relative = formatRelative(date, now);
7844
+ const display = format === "relative" ? relative : absolute;
7845
+ const title = format === "both" ? relative : void 0;
7846
+ return /* @__PURE__ */ jsx(
7847
+ "time",
7848
+ {
7849
+ dateTime: iso,
7850
+ title,
7851
+ className: cn("font-mono text-xs text-muted-foreground", className),
7852
+ children: display
7853
+ }
7854
+ );
7855
+ }
7856
+ function Sparkline({
7857
+ data,
7858
+ width = 140,
7859
+ height = 28,
7860
+ color = "hsl(var(--muted-foreground))",
7861
+ fill,
7862
+ strokeWidth = 1.2,
7863
+ markLast = false
7864
+ }) {
7865
+ if (data.length < 2) {
7866
+ return /* @__PURE__ */ jsx("svg", { width, height, "aria-hidden": true });
7867
+ }
7868
+ const min = Math.min(...data);
7869
+ const max = Math.max(...data);
7870
+ const range = max - min || 1;
7871
+ const pad = strokeWidth;
7872
+ const innerW = width - pad * 2;
7873
+ const innerH = height - pad * 2;
7874
+ const points = data.map((v, i) => {
7875
+ const x = pad + i / (data.length - 1) * innerW;
7876
+ const y = pad + innerH - (v - min) / range * innerH;
7877
+ return [x, y];
7878
+ });
7879
+ const polyline = points.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`).join(" ");
7880
+ const firstPt = points[0];
7881
+ const lastPt = points[points.length - 1];
7882
+ let fillPath;
7883
+ if (fill) {
7884
+ fillPath = [
7885
+ `${firstPt[0].toFixed(2)},${(pad + innerH).toFixed(2)}`,
7886
+ ...points.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`),
7887
+ `${lastPt[0].toFixed(2)},${(pad + innerH).toFixed(2)}`
7888
+ ].join(" ");
7889
+ }
7890
+ return /* @__PURE__ */ jsxs(
7891
+ "svg",
7892
+ {
7893
+ width,
7894
+ height,
7895
+ viewBox: `0 0 ${width} ${height}`,
7896
+ "aria-hidden": true,
7897
+ style: { display: "block", overflow: "visible" },
7898
+ children: [
7899
+ fillPath && /* @__PURE__ */ jsx("polygon", { points: fillPath, fill, stroke: "none" }),
7900
+ /* @__PURE__ */ jsx(
7901
+ "polyline",
7902
+ {
7903
+ points: polyline,
7904
+ fill: "none",
7905
+ stroke: color,
7906
+ strokeWidth,
7907
+ strokeLinejoin: "round",
7908
+ strokeLinecap: "round"
7909
+ }
7910
+ ),
7911
+ markLast && /* @__PURE__ */ jsx("circle", { cx: lastPt[0], cy: lastPt[1], r: strokeWidth * 2, fill: color })
7912
+ ]
7913
+ }
7914
+ );
7915
+ }
7916
+ function LiveIndicator({
7917
+ active,
7918
+ label = "Live",
7919
+ className
7920
+ }) {
7921
+ const ariaLabel = active ? `${label} — connected` : `${label} — paused`;
7922
+ return /* @__PURE__ */ jsxs(
7923
+ "span",
7924
+ {
7925
+ role: "status",
7926
+ "aria-live": "polite",
7927
+ "aria-label": ariaLabel,
7928
+ className: cn(
7929
+ "inline-flex items-center gap-2 text-xs font-mono",
7930
+ active ? "text-primary" : "text-muted-foreground",
7931
+ className
7932
+ ),
7933
+ children: [
7934
+ /* @__PURE__ */ jsx(
7935
+ "span",
7936
+ {
7937
+ className: cn(
7938
+ "inline-block w-2 h-2 rounded-full",
7939
+ active ? "bg-primary animate-pulse" : "bg-muted-foreground/40"
7940
+ )
7941
+ }
7942
+ ),
7943
+ label
7944
+ ]
7945
+ }
7946
+ );
7947
+ }
7753
7948
  const defaultActivityIconMap = {
7754
7949
  user: {
7755
7950
  icon: Users,
@@ -10601,7 +10796,7 @@ const SidebarButton = ({
10601
10796
  "span",
10602
10797
  {
10603
10798
  className: cn(
10604
- "text-sm font-medium flex-1 text-left",
10799
+ "text-sm font-medium flex-1 text-left whitespace-nowrap",
10605
10800
  active ? `text-category-${category}` : "text-foreground"
10606
10801
  ),
10607
10802
  children: label
@@ -10684,23 +10879,43 @@ const Sidebar = ({
10684
10879
  "data-component-name": "Sidebar",
10685
10880
  "data-collapsed": !isExpanded,
10686
10881
  children: [
10687
- /* @__PURE__ */ jsx("div", { className: "flex justify-center p-3 pt-4", children: /* @__PURE__ */ jsx(
10688
- "button",
10882
+ /* @__PURE__ */ jsxs(
10883
+ "div",
10689
10884
  {
10690
- onClick: toggleSidebar,
10691
10885
  className: cn(
10692
- "w-7 h-7 rounded-md",
10693
- "bg-muted/50 text-muted-foreground",
10694
- "flex items-center justify-center",
10695
- "hover:bg-muted hover:text-foreground",
10696
- "active:scale-95",
10697
- "transition-all duration-150 ease-out"
10886
+ "flex items-center p-3 pt-4",
10887
+ isExpanded ? "justify-between gap-2" : "justify-center"
10698
10888
  ),
10699
- "data-component-name": "SidebarToggle",
10700
- title: !isExpanded ? "Expand sidebar" : "Collapse sidebar",
10701
- children: !isExpanded ? /* @__PURE__ */ jsx(Menu, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" })
10889
+ "data-component-name": "SidebarHeader",
10890
+ children: [
10891
+ isExpanded && (navigation == null ? void 0 : navigation.logo) != null && /* @__PURE__ */ jsx(
10892
+ "div",
10893
+ {
10894
+ className: "flex-1 min-w-0 flex items-center",
10895
+ "data-component-name": "SidebarLogo",
10896
+ children: typeof navigation.logo === "string" ? /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground truncate", children: navigation.logo }) : navigation.logo
10897
+ }
10898
+ ),
10899
+ /* @__PURE__ */ jsx(
10900
+ "button",
10901
+ {
10902
+ onClick: toggleSidebar,
10903
+ className: cn(
10904
+ "w-7 h-7 rounded-md shrink-0",
10905
+ "bg-muted/50 text-muted-foreground",
10906
+ "flex items-center justify-center",
10907
+ "hover:bg-muted hover:text-foreground",
10908
+ "active:scale-95",
10909
+ "transition-all duration-150 ease-out"
10910
+ ),
10911
+ "data-component-name": "SidebarToggle",
10912
+ title: !isExpanded ? "Expand sidebar" : "Collapse sidebar",
10913
+ children: !isExpanded ? /* @__PURE__ */ jsx(Menu, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" })
10914
+ }
10915
+ )
10916
+ ]
10702
10917
  }
10703
- ) }),
10918
+ ),
10704
10919
  /* @__PURE__ */ jsx("nav", { className: "flex-1 p-3 space-y-2", "data-component-name": "SidebarNav", children: items.map((item) => {
10705
10920
  const [itemBasePath, itemQuery] = item.path.split("?");
10706
10921
  const currentPath = location.pathname;
@@ -15677,14 +15892,12 @@ function createReactApp(config) {
15677
15892
  if (enableRouting) {
15678
15893
  tree = /* @__PURE__ */ jsx(NavigationProvider, { initialNavigation: navigation, children: /* @__PURE__ */ jsx(SidebarProvider, { children: tree }) });
15679
15894
  }
15680
- if (enableAuth) {
15681
- const authMode = (auth == null ? void 0 : auth.mode) || "pattern-stack";
15682
- if (authMode === "none") {
15683
- setGlobalAuthService(null);
15684
- tree = /* @__PURE__ */ jsx(NoAuthProvider, { children: tree });
15685
- } else {
15686
- tree = /* @__PURE__ */ jsx(AuthProvider, { config: auth, children: tree });
15687
- }
15895
+ const authMode = (auth == null ? void 0 : auth.mode) || "pattern-stack";
15896
+ if (enableAuth && authMode !== "none") {
15897
+ tree = /* @__PURE__ */ jsx(AuthProvider, { config: auth, children: tree });
15898
+ } else {
15899
+ setGlobalAuthService(null);
15900
+ tree = /* @__PURE__ */ jsx(NoAuthProvider, { children: tree });
15688
15901
  }
15689
15902
  if (enableQuery) {
15690
15903
  tree = /* @__PURE__ */ jsxs(QueryClientProvider, { client: queryClient, children: [
@@ -19151,6 +19364,7 @@ export {
19151
19364
  DropdownMenuSubContent,
19152
19365
  DropdownMenuSubTrigger,
19153
19366
  DropdownMenuTrigger,
19367
+ Duration,
19154
19368
  EmptyState,
19155
19369
  EnhancedDataTemplate,
19156
19370
  EntityIcon,
@@ -19170,6 +19384,7 @@ export {
19170
19384
  ListCard,
19171
19385
  ListPageTemplate,
19172
19386
  ListToolbar,
19387
+ LiveIndicator,
19173
19388
  Loading,
19174
19389
  LoginForm,
19175
19390
  LogoutButton,
@@ -19214,6 +19429,7 @@ export {
19214
19429
  SkeletonButton,
19215
19430
  SkeletonCard,
19216
19431
  SkeletonText,
19432
+ Sparkline,
19217
19433
  Spinner,
19218
19434
  StatCard,
19219
19435
  StyleGuide,
@@ -19231,6 +19447,7 @@ export {
19231
19447
  TabsContent,
19232
19448
  TabsList,
19233
19449
  TabsTrigger,
19450
+ Timestamp,
19234
19451
  Toast,
19235
19452
  ToastContainer,
19236
19453
  Tooltip,