@rafal.lemieszewski/tide-ui 0.12.6 → 0.12.7

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.
package/dist/index.es.js CHANGED
@@ -21268,7 +21268,7 @@ const Ha = {
21268
21268
  "#CC0000"
21269
21269
  // High contrast red
21270
21270
  ]
21271
- }, b1 = ({ active: e, payload: t, label: n, config: r, tooltipMaxWidth: a = "max-w-xs" }) => !e || !t || !t.length ? null : /* @__PURE__ */ G(
21271
+ }, b1 = ({ active: e, payload: t, label: n, config: r, tooltipMaxWidth: a = "max-w-xs", chartType: o }) => !e || !t || !t.length ? null : /* @__PURE__ */ G(
21272
21272
  "div",
21273
21273
  {
21274
21274
  className: `rounded-md border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] p-[var(--space-sm)] shadow-md ${a}`,
@@ -21276,29 +21276,56 @@ const Ha = {
21276
21276
  "aria-label": "Chart data tooltip",
21277
21277
  children: [
21278
21278
  /* @__PURE__ */ k("p", { className: "text-body-sm font-medium mb-[var(--space-xsm)] text-[var(--color-text-primary)]", children: n }),
21279
- t.map((o, i) => {
21280
- const c = r[o.dataKey];
21281
- let s;
21282
- if (c?.type === "range-area" && o.payload) {
21283
- const l = o.payload[o.dataKey];
21284
- Array.isArray(l) && l.length === 2 ? s = `${l[0].toLocaleString()} – ${l[1].toLocaleString()}` : s = typeof o.value == "number" ? o.value.toLocaleString() : o.value;
21279
+ t.map((i, c) => {
21280
+ const s = r[i.dataKey];
21281
+ let l;
21282
+ if (s?.type === "range-area" && i.payload) {
21283
+ const h = i.payload[i.dataKey];
21284
+ Array.isArray(h) && h.length === 2 ? l = `${h[0].toLocaleString()} – ${h[1].toLocaleString()}` : l = typeof i.value == "number" ? i.value.toLocaleString() : i.value;
21285
21285
  } else
21286
- s = typeof o.value == "number" ? o.value.toLocaleString() : o.value;
21286
+ l = typeof i.value == "number" ? i.value.toLocaleString() : i.value;
21287
21287
  return /* @__PURE__ */ G("div", { className: "flex items-center gap-[var(--space-xsm)] text-body-sm", children: [
21288
- /* @__PURE__ */ k(
21289
- "div",
21290
- {
21291
- className: "w-3 h-3 rounded-full flex-shrink-0",
21292
- style: { backgroundColor: o.color },
21293
- "aria-hidden": "true"
21288
+ (() => {
21289
+ switch (o) {
21290
+ case "line":
21291
+ return /* @__PURE__ */ k(
21292
+ "div",
21293
+ {
21294
+ className: "w-3 h-0.5 flex-shrink-0",
21295
+ style: { backgroundColor: i.color },
21296
+ "aria-hidden": "true"
21297
+ }
21298
+ );
21299
+ case "scatter":
21300
+ return /* @__PURE__ */ k(
21301
+ "div",
21302
+ {
21303
+ className: "w-2 h-2 rounded-full flex-shrink-0",
21304
+ style: { backgroundColor: i.color },
21305
+ "aria-hidden": "true"
21306
+ }
21307
+ );
21308
+ case "bar":
21309
+ case "horizontal-bar":
21310
+ case "area":
21311
+ case "composed":
21312
+ default:
21313
+ return /* @__PURE__ */ k(
21314
+ "div",
21315
+ {
21316
+ className: "w-2 h-2 flex-shrink-0",
21317
+ style: { backgroundColor: i.color },
21318
+ "aria-hidden": "true"
21319
+ }
21320
+ );
21294
21321
  }
21295
- ),
21322
+ })(),
21296
21323
  /* @__PURE__ */ G("span", { className: "text-[var(--color-text-secondary)] min-w-0 break-words", children: [
21297
- c?.label || o.dataKey,
21324
+ s?.label || i.dataKey,
21298
21325
  ":"
21299
21326
  ] }),
21300
- /* @__PURE__ */ k("span", { className: "font-medium text-[var(--color-text-primary)] ml-auto", children: s })
21301
- ] }, i);
21327
+ /* @__PURE__ */ k("span", { className: "font-medium text-[var(--color-text-primary)] ml-auto", children: l })
21328
+ ] }, c);
21302
21329
  })
21303
21330
  ]
21304
21331
  }
@@ -21496,7 +21523,7 @@ function zve({
21496
21523
  p && /* @__PURE__ */ k(
21497
21524
  g1,
21498
21525
  {
21499
- content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I }),
21526
+ content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I, chartType: e }),
21500
21527
  cursor: {
21501
21528
  stroke: "var(--color-border-primary)",
21502
21529
  strokeWidth: 1,
@@ -21544,7 +21571,7 @@ function zve({
21544
21571
  p && /* @__PURE__ */ k(
21545
21572
  g1,
21546
21573
  {
21547
- content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I }),
21574
+ content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I, chartType: e }),
21548
21575
  cursor: {
21549
21576
  stroke: "var(--color-border-primary)",
21550
21577
  strokeWidth: 1,
@@ -21589,7 +21616,7 @@ function zve({
21589
21616
  p && /* @__PURE__ */ k(
21590
21617
  g1,
21591
21618
  {
21592
- content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I }),
21619
+ content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I, chartType: e }),
21593
21620
  position: { x: void 0, y: void 0 },
21594
21621
  offset: 10,
21595
21622
  animationDuration: 0
@@ -21639,7 +21666,7 @@ function zve({
21639
21666
  p && /* @__PURE__ */ k(
21640
21667
  g1,
21641
21668
  {
21642
- content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I }),
21669
+ content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I, chartType: e }),
21643
21670
  position: { x: void 0, y: void 0 },
21644
21671
  offset: 10,
21645
21672
  animationDuration: 0
@@ -21678,7 +21705,7 @@ function zve({
21678
21705
  p && /* @__PURE__ */ k(
21679
21706
  g1,
21680
21707
  {
21681
- content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I }),
21708
+ content: (A) => /* @__PURE__ */ k(b1, { ...A, config: n, tooltipMaxWidth: I, chartType: e }),
21682
21709
  position: { x: void 0, y: void 0 },
21683
21710
  offset: 10,
21684
21711
  animationDuration: 0