@almanaclabs/blaze-ui 0.15.0 → 0.15.1

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 +1 @@
1
- {"version":3,"file":"metric-tile.d.ts","sourceRoot":"","sources":["../../../src/components/metric-tile/metric-tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,kBAAkB;;8EAiBtB,CAAA;AAEF,QAAA,MAAM,uBAAuB;;8EAU3B,CAAA;AAEF,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;IACpB,gEAAgE;IAChE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;IAC9B,0DAA0D;IAC1D,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,MAAM,WAAW,eACf,SACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,EAC7C,YAAY,CAAC,OAAO,kBAAkB,CAAC,EACvC,YAAY,CAAC,OAAO,uBAAuB,CAAC;IAC9C,mFAAmF;IACnF,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,qEAAqE;IACrE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,4CAA4C;IAC5C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,uDAAuD;IACvD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,gEAAgE;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACxB;AAED,gFAAgF;AAChF,iB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AAA;IACtB,gEAAgE;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACxB;AAED,gFAAgF;AAChF,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBA8HjB;AAED,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,77 +1,88 @@
1
1
  import { cn as e } from "../../lib/utils.js";
2
2
  import "react";
3
3
  import { cva as t } from "class-variance-authority";
4
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { IconArrowDownRight as i, IconArrowUpRight as a } from "@tabler/icons-react";
4
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { IconArrowDownRight as a, IconArrowUpRight as o } from "@tabler/icons-react";
6
6
  //#region src/components/metric-tile/metric-tile.tsx
7
- var o = t("flex min-w-0 flex-col", {
7
+ var s = t("flex min-w-0 flex-col", {
8
8
  variants: { variant: {
9
9
  subtle: "rounded-xl bg-surface-subtle px-4 py-3",
10
10
  plain: "",
11
11
  card: "@container/metric-tile relative gap-1 rounded-lg border border-border-subtle bg-card px-[18px] pt-4 pb-3.5"
12
12
  } },
13
13
  defaultVariants: { variant: "subtle" }
14
- }), s = t("tabular-nums", {
14
+ }), c = t("tabular-nums", {
15
15
  variants: { size: {
16
16
  lg: "type-page-title",
17
17
  md: "type-metric"
18
18
  } },
19
19
  defaultVariants: { size: "lg" }
20
20
  });
21
- function c({ label: t, icon: c, value: l, unit: u, delta: d, note: f, chart: p, variant: m, size: h, className: g, ..._ }) {
22
- let v = m === "card", y = d?.tone ?? (d?.trend === "down" ? "negative" : "positive"), b = d?.trend === "down" ? i : a, x = d ? /* @__PURE__ */ r("p", {
21
+ function l({ label: t, icon: l, value: u, unit: d, delta: f, note: p, chart: m, variant: h, size: g, className: _, ...v }) {
22
+ let y = h === "card", b = f?.tone ?? (f?.trend === "down" ? "negative" : "positive"), x = f?.trend === "down" ? a : o, S = f ? /* @__PURE__ */ i("p", {
23
23
  "data-slot": "metric-tile-delta",
24
- "data-trend": d.trend,
25
- className: e("type-meta flex items-center gap-1", v ? e("mt-0.5 w-fit gap-0.5 self-start rounded-[6px] px-[7px] py-px font-medium whitespace-nowrap tabular-nums", y === "positive" ? "bg-success-soft text-success" : "bg-destructive-soft text-destructive") : "mt-0.5 text-muted-foreground"),
24
+ "data-trend": f.trend,
25
+ className: e("type-meta flex items-center gap-1", y ? e("mt-0.5 w-fit max-w-full gap-0.5 self-start rounded-[6px] px-[7px] py-px font-medium tabular-nums", b === "positive" ? "bg-success-soft text-success" : "bg-destructive-soft text-destructive") : "mt-0.5 text-muted-foreground"),
26
26
  children: [
27
- /* @__PURE__ */ n(b, {
27
+ /* @__PURE__ */ r(x, {
28
28
  "aria-hidden": "true",
29
- className: e("shrink-0", v ? "icon-optical-12 text-current" : y === "positive" ? "icon-optical-14 text-success" : "icon-optical-14 text-warning")
29
+ className: e("shrink-0", y ? "icon-optical-12 text-current" : b === "positive" ? "icon-optical-14 text-success" : "icon-optical-14 text-warning")
30
30
  }),
31
- /* @__PURE__ */ r("span", {
31
+ /* @__PURE__ */ i("span", {
32
32
  className: "sr-only",
33
- children: [d.trend === "up" ? "Up" : "Down", ", "]
33
+ children: [f.trend === "up" ? "Up" : "Down", ", "]
34
34
  }),
35
- d.label
35
+ f.label
36
36
  ]
37
- }) : null, S = f ? /* @__PURE__ */ n("div", {
37
+ }) : null, C = p ? /* @__PURE__ */ r("div", {
38
38
  "data-slot": "metric-tile-note",
39
- className: e(v ? "type-label min-w-0 truncate font-normal text-muted-foreground" : "type-meta text-muted-foreground", v && p && "@min-[11rem]/metric-tile:pr-24"),
40
- children: f
39
+ className: e(y ? "type-label min-w-0 truncate font-normal text-muted-foreground" : "type-meta text-muted-foreground"),
40
+ children: p
41
41
  }) : null;
42
- return /* @__PURE__ */ r("div", {
42
+ return /* @__PURE__ */ i("div", {
43
43
  "data-slot": "metric-tile",
44
- "data-variant": m ?? "subtle",
45
- className: e(o({ variant: m }), g),
46
- ..._,
44
+ "data-variant": h ?? "subtle",
45
+ className: e(s({ variant: h }), _),
46
+ ...v,
47
47
  children: [
48
- c ? /* @__PURE__ */ r("p", {
48
+ l ? /* @__PURE__ */ i("p", {
49
49
  "data-slot": "metric-tile-label",
50
50
  className: "type-label flex items-center gap-2 font-medium",
51
- children: [c, t]
52
- }) : /* @__PURE__ */ n("p", {
51
+ children: [l, t]
52
+ }) : /* @__PURE__ */ r("p", {
53
53
  "data-slot": "metric-tile-label",
54
- className: e(v ? "type-label font-normal" : "type-meta", "text-muted-foreground"),
54
+ className: e(y ? "type-label font-normal" : "type-meta", "text-muted-foreground"),
55
55
  children: t
56
56
  }),
57
- /* @__PURE__ */ n("p", {
57
+ /* @__PURE__ */ r("p", {
58
58
  "data-slot": "metric-tile-value",
59
- className: e(v ? "type-stat tabular-nums" : s({ size: h }), c ? "mt-5" : !v && h === "md" && "mt-0.5"),
60
- children: l
59
+ className: e(y ? "type-stat tabular-nums" : c({ size: g }), l ? "mt-5" : !y && g === "md" && "mt-0.5"),
60
+ children: u
61
61
  }),
62
- u ? /* @__PURE__ */ n("div", {
62
+ d ? /* @__PURE__ */ r("div", {
63
63
  className: "type-meta text-muted-foreground",
64
- children: u
64
+ children: d
65
65
  }) : null,
66
- x,
67
- S,
68
- p ? /* @__PURE__ */ n("div", {
66
+ y ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ i("div", {
67
+ className: e("flex min-w-0 flex-col gap-1", m && "@min-[11rem]/metric-tile:pr-24"),
68
+ children: [S, C]
69
+ }), m ? /* @__PURE__ */ r("div", {
69
70
  "data-slot": "metric-tile-chart",
70
- className: e("self-end", v && "mt-1 @min-[11rem]/metric-tile:absolute @min-[11rem]/metric-tile:right-4 @min-[11rem]/metric-tile:bottom-3.5 @min-[11rem]/metric-tile:mt-0"),
71
- children: p
72
- }) : null
71
+ className: "mt-1 self-end @min-[11rem]/metric-tile:absolute @min-[11rem]/metric-tile:right-4 @min-[11rem]/metric-tile:bottom-3.5 @min-[11rem]/metric-tile:mt-0",
72
+ children: m
73
+ }) : null] }) : m ? /* @__PURE__ */ i("div", {
74
+ className: "flex flex-wrap items-end justify-between gap-x-3 gap-y-1",
75
+ children: [/* @__PURE__ */ i("div", {
76
+ className: "min-w-0",
77
+ children: [S, C]
78
+ }), /* @__PURE__ */ r("div", {
79
+ "data-slot": "metric-tile-chart",
80
+ className: "flex-none pb-0.5",
81
+ children: m
82
+ })]
83
+ }) : /* @__PURE__ */ i(n, { children: [S, C] })
73
84
  ]
74
85
  });
75
86
  }
76
87
  //#endregion
77
- export { c as MetricTile, o as metricTileVariants };
88
+ export { l as MetricTile, s as metricTileVariants };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almanaclabs/blaze-ui",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Shared React components and design tokens for Blaze",
5
5
  "type": "module",
6
6
  "sideEffects": [