@heyramzi/ui 2.19.0 → 2.19.2

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,3 +1,4 @@
1
+ import "../../src/charts/chart-tokens.css";
1
2
  import "../../src/charts/charts.css";
2
3
  export { default as BarChart } from "../../src/charts/bar-chart.svelte";
3
4
  export { default as AreaChart } from "../../src/charts/area-chart.svelte";
@@ -1,5 +1,5 @@
1
1
  import { cubicInOut } from "svelte/easing";
2
- /** Mirrors `--chart-motion-reveal` in charts.css, for when no element is mounted to read it from. */
2
+ /** Mirrors `--chart-motion-reveal` in chart-tokens.css, for when no element is mounted to read it from. */
3
3
  export const REVEAL_MS = 1100;
4
4
  /** Rescales the axes when the data changes; the first render never animates. */
5
5
  export const DOMAIN_MOTION = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyramzi/ui",
3
- "version": "2.19.0",
3
+ "version": "2.19.2",
4
4
  "description": "Svelte 5 UI for apps: primitives, effects and animations, plus work (tasks and docs), charts, slides, an editor, onboarding and a canvas as subpaths.",
5
5
  "homepage": "https://ui.heyramzi.com",
6
6
  "license": "MIT",
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./area-chart.css";
6
7
  import { Area, Axis, Chart, Highlight, LinearGradient, Spline, Svg, Tooltip } from "layerchart";
7
8
  import { curveMonotoneX } from "d3-shape";
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./bar-chart.css";
6
7
  import { Axis, Bars, Chart, Highlight, Svg, Tooltip } from "layerchart";
7
8
  import { scaleBand } from "d3-scale";
@@ -0,0 +1,36 @@
1
+ /* Each chart imports these beside its own stylesheet, so a deep import such as
2
+ `@heyramzi/ui/charts/dashboard` keeps its card edge without the barrel. */
3
+
4
+ /* Shared chart tokens, held at zero specificity by `:where()`. The reveal pair
5
+ is the entrance every chart shares; motion.ts mirrors its duration. */
6
+ :where(
7
+ .hr-area-chart,
8
+ .hr-bar-chart,
9
+ .hr-line-chart,
10
+ .hr-sparkline,
11
+ .hr-number-chart,
12
+ .hr-stat-card,
13
+ .hr-legend,
14
+ .hr-ts-chart,
15
+ .hr-donut-chart,
16
+ .hr-ring,
17
+ .hr-gauge
18
+ ) {
19
+ --chart-label: var(--muted-foreground, oklch(0.5 0.01 286));
20
+ --chart-grid: color-mix(in srgb, var(--border, oklch(0.5 0.01 286)) 50%, transparent);
21
+ --chart-ease-out: var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1));
22
+ --chart-motion-fast: var(--duration-quick, 150ms);
23
+ --chart-motion: var(--duration-fast, 250ms);
24
+ --chart-motion-slow: 800ms;
25
+ --chart-motion-reveal: 1100ms;
26
+ --chart-ease-reveal: cubic-bezier(0.85, 0, 0.15, 1);
27
+ --chart-stagger: 30ms;
28
+ --chart-crosshair: color-mix(
29
+ in srgb,
30
+ var(--muted-foreground, oklch(0.5 0.01 286)) 60%,
31
+ transparent
32
+ );
33
+ /* The card step draws its own hairline, so a chart card carries no border of its own. */
34
+ --chart-card-shadow: var(--elev-card);
35
+ --chart-card-shadow-hover: var(--elev-card-hover);
36
+ }
@@ -67,38 +67,6 @@
67
67
  font-variant-numeric: tabular-nums;
68
68
  }
69
69
 
70
- /* Shared chart tokens, held at zero specificity by `:where()`. The reveal pair
71
- is the entrance every chart shares; motion.ts mirrors its duration. */
72
- :where(
73
- .hr-area-chart,
74
- .hr-bar-chart,
75
- .hr-line-chart,
76
- .hr-sparkline,
77
- .hr-number-chart,
78
- .hr-stat-card,
79
- .hr-legend,
80
- .hr-ts-chart,
81
- .hr-donut-chart,
82
- .hr-ring,
83
- .hr-gauge
84
- ) {
85
- --chart-label: var(--muted-foreground, oklch(0.5 0.01 286));
86
- --chart-grid: color-mix(in srgb, var(--border, oklch(0.5 0.01 286)) 65%, transparent);
87
- --chart-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
88
- --chart-motion-fast: 150ms;
89
- --chart-motion: 250ms;
90
- --chart-motion-slow: 800ms;
91
- --chart-motion-reveal: 1100ms;
92
- --chart-ease-reveal: cubic-bezier(0.85, 0, 0.15, 1);
93
- --chart-stagger: 30ms;
94
- --chart-crosshair: color-mix(
95
- in srgb,
96
- var(--muted-foreground, oklch(0.5 0.01 286)) 60%,
97
- transparent
98
- );
99
- --chart-card-shadow: 0 1px 2px 0 oklch(0 0 0 / 0.04), 0 1px 3px 0 oklch(0 0 0 / 0.06);
100
- }
101
-
102
70
  /* Axis labels, grid rules and hover highlights for every chart, defined once.
103
71
  `:where()` keeps specificity at 0 so a component can still override them. */
104
72
  :where(
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./donut-chart.css";
6
7
  import { Arc, Chart, Group, Pie, Svg, Text } from "layerchart";
7
8
  import { scaleOrdinal } from "d3-scale";
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./figure.css";
6
7
  import { cn } from "../lib/utils.js";
7
8
  import type { Snippet } from "svelte";
@@ -8,6 +8,7 @@
8
8
  // =========================
9
9
  // IMPORTS
10
10
  // =========================
11
+ import "./chart-tokens.css";
11
12
  import "./gauge-chart.css";
12
13
  import { cn } from "../lib/utils.js";
13
14
  import AnimatedValue from "./animated-value.svelte";
@@ -1,3 +1,4 @@
1
+ import "./chart-tokens.css";
1
2
  import "./charts.css";
2
3
 
3
4
  export { default as BarChart } from "./bar-chart.svelte";
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./legend.css";
6
7
  import { cn } from "../lib/utils.js";
7
8
 
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./line-chart.css";
6
7
  import {
7
8
  Area,
@@ -1,6 +1,6 @@
1
1
  import { cubicInOut } from "svelte/easing";
2
2
 
3
- /** Mirrors `--chart-motion-reveal` in charts.css, for when no element is mounted to read it from. */
3
+ /** Mirrors `--chart-motion-reveal` in chart-tokens.css, for when no element is mounted to read it from. */
4
4
  export const REVEAL_MS = 1100;
5
5
 
6
6
  /** Rescales the axes when the data changes; the first render never animates. */
@@ -13,6 +13,7 @@
13
13
  // =========================
14
14
  // IMPORTS
15
15
  // =========================
16
+ import "./chart-tokens.css";
16
17
  import "./number-chart.css";
17
18
  import { Minus, TrendDown, TrendUp } from "phosphor-svelte";
18
19
  import { cn } from "../lib/utils.js";
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./ring-chart.css";
6
7
  import type { Snippet } from "svelte";
7
8
  import { cn } from "../lib/utils.js";
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./sparkline.css";
6
7
  import { Area, Chart, Highlight, LinearGradient, Points, Spline, Svg, Tooltip } from "layerchart";
7
8
  import { curveMonotoneX } from "d3-shape";
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./stat-card.css";
6
7
  import { Area, Bars, Chart, Highlight, LinearGradient, Spline, Svg, Tooltip } from "layerchart";
7
8
  import { scaleBand } from "d3-scale";
@@ -2,6 +2,7 @@
2
2
  // =========================
3
3
  // IMPORTS
4
4
  // =========================
5
+ import "./chart-tokens.css";
5
6
  import "./time-series-chart.css";
6
7
  import { scaleTime } from "d3-scale";
7
8
  import { curveMonotoneX } from "d3-shape";
@@ -301,8 +301,9 @@
301
301
  {#if title}
302
302
  <h2 class="text-xs font-medium tracking-wide text-muted-foreground uppercase">{title}</h2>
303
303
  {/if}
304
+ <!-- Labels size to their text, capped at 45%; the dt's min-w-20 is the 5rem floor. min() can't take max-content, so a min() template is dropped whole. -->
304
305
  <dl
305
- class="grid grid-cols-[minmax(5rem,min(max-content,45%))_minmax(0,1fr)] items-start gap-x-4 gap-y-2.5"
306
+ class="grid grid-cols-[fit-content(45%)_minmax(0,1fr)] items-start gap-x-4 gap-y-2.5"
306
307
  >
307
308
  {#each shown as row, index (row.divider ? `divider-${index}` : keyOf(row))}
308
309
  {#if row.divider}
@@ -312,7 +313,7 @@
312
313
  {@const long = row.input === "longtext"}
313
314
  <dt
314
315
  class={cn(
315
- "flex min-h-7 min-w-0 items-center gap-2 text-sm [overflow-wrap:anywhere] text-muted-foreground",
316
+ "flex min-h-7 min-w-20 items-center gap-2 text-sm [overflow-wrap:anywhere] text-muted-foreground",
316
317
  long && "col-span-2 min-h-0",
317
318
  )}
318
319
  >