@nanisoft/prism-ui 1.2.0 → 1.3.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 (29) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/blocks/site-footer/site-footer.d.ts +23 -8
  3. package/dist/blocks/site-footer/site-footer.d.ts.map +1 -1
  4. package/dist/blocks/site-footer/site-footer.js +10 -4
  5. package/dist/blocks/site-navbar/index.d.ts +1 -1
  6. package/dist/blocks/site-navbar/index.d.ts.map +1 -1
  7. package/dist/blocks/site-navbar/mobile-nav.d.ts +25 -4
  8. package/dist/blocks/site-navbar/mobile-nav.d.ts.map +1 -1
  9. package/dist/blocks/site-navbar/mobile-nav.js +11 -4
  10. package/dist/blocks/site-navbar/nav-menu.d.ts +50 -0
  11. package/dist/blocks/site-navbar/nav-menu.d.ts.map +1 -0
  12. package/dist/blocks/site-navbar/nav-menu.js +44 -0
  13. package/dist/blocks/site-navbar/navbar-controls.d.ts +9 -3
  14. package/dist/blocks/site-navbar/navbar-controls.d.ts.map +1 -1
  15. package/dist/blocks/site-navbar/site-navbar.d.ts +54 -13
  16. package/dist/blocks/site-navbar/site-navbar.d.ts.map +1 -1
  17. package/dist/blocks/site-navbar/site-navbar.js +45 -10
  18. package/dist/components/ui/calendar.d.ts.map +1 -1
  19. package/dist/components/ui/calendar.js +7 -2
  20. package/dist/components/ui/mini-calendar.js +1 -1
  21. package/dist/components/ui/product-mark.d.ts +26 -7
  22. package/dist/components/ui/product-mark.d.ts.map +1 -1
  23. package/dist/components/ui/product-mark.js +6 -4
  24. package/dist/components/ui/pulse-series.d.ts.map +1 -1
  25. package/dist/components/ui/pulse-series.js +1 -1
  26. package/dist/components/ui/sparkline.d.ts.map +1 -1
  27. package/dist/components/ui/sparkline.js +1 -2
  28. package/dist/styles.css +13 -0
  29. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { PackId } from '../../theming/index.js';
2
3
  /**
3
4
  * The three sizes a product mark is drawn at: the mark's diameter and the name
@@ -32,10 +33,11 @@ export type ProductMarkSize = keyof typeof SIZES;
32
33
  * The props a ProductMark takes.
33
34
  *
34
35
  * There is no product directory in this package. A product's identity is the
35
- * consumer's data, so the Component takes the three facts the mark is drawn
36
- * from and owns none of them: `id` for the markup, `name` for the second part,
37
- * and `pack` for the hue. Where the set of products is published is the
38
- * consumer's decision, and Prism ships the mark rather than a list of products.
36
+ * consumer's data, so the Component takes the facts the mark is drawn from and
37
+ * owns none of them: `id` for the markup, `name` for the second part, `pack`
38
+ * for the hue, and `mark` for the drawing itself when the identity has one.
39
+ * Where the set of products is published is the consumer's decision, and Prism
40
+ * ships the mark rather than a list of products.
39
41
  */
40
42
  export type ProductMarkProps = {
41
43
  /**
@@ -63,6 +65,21 @@ export type ProductMarkProps = {
63
65
  * core resolves the base pack's `primary` from the page.
64
66
  */
65
67
  pack?: PackId | null;
68
+ /**
69
+ * The product's drawn mark, when its identity includes one: the logo in
70
+ * place of the disc. The node is the consumer's drawing and this Component
71
+ * owns none of it, exactly as it owns none of the name; it is drawn inside
72
+ * the sized slot the disc occupies, so a `viewBox` drawing that fills its
73
+ * box arrives at every drawn size from one node. Ink strokes drawn in
74
+ * `currentColor` and accents drawn through a token class keep the drawing
75
+ * reachable by the cascade and by a pack boundary the same way the disc is.
76
+ *
77
+ * The drawing is hidden from assistive technology, as the disc is: the name
78
+ * is the mark's announced half either way. Omit it for the two-colour disc,
79
+ * which remains the mark of a product whose identity is a hue rather than a
80
+ * drawing.
81
+ */
82
+ mark?: ReactNode;
66
83
  /**
67
84
  * Which of the three drawn sizes to use. @defaultValue 'md'
68
85
  */
@@ -75,8 +92,10 @@ export type ProductMarkProps = {
75
92
  className?: string;
76
93
  };
77
94
  /**
78
- * A product's two-part colour mark: a hairline ring in the brand ink around a
79
- * core in the pack's own fill, beside the product's name in the brand ink.
95
+ * A product's two-part mark: the shape, beside the product's name in the brand
96
+ * ink. The shape is a disc by default, a hairline ring in the brand ink around
97
+ * a core in the pack's own fill, and it is the product's own drawing when
98
+ * `mark` carries one.
80
99
  *
81
100
  * Two parts, and both colours come from tokens, which is the whole reason this
82
101
  * is promoted out of the two hand-written copies it replaces. The ring is
@@ -110,6 +129,6 @@ export type ProductMarkProps = {
110
129
  * The disc is `aria-hidden` and the name is not, so the mark adds a shape beside
111
130
  * the word rather than a second reading of it.
112
131
  */
113
- declare function ProductMark({ id, name, pack, size, className }: ProductMarkProps): import("react").JSX.Element;
132
+ declare function ProductMark({ id, name, pack, mark, size, className }: ProductMarkProps): import("react").JSX.Element;
114
133
  export { ProductMark };
115
134
  //# sourceMappingURL=product-mark.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-mark.d.ts","sourceRoot":"","sources":["../../../src/components/ui/product-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AA2B3C;;;;;;;;GAQG;AACH,QAAA,MAAM,KAAK;;;;;;;;;;;;;CAID,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,KAAK,CAAA;AAEhD;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,iBAAS,WAAW,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BA2BhF;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"product-mark.d.ts","sourceRoot":"","sources":["../../../src/components/ui/product-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AA2B3C;;;;;;;;GAQG;AACH,QAAA,MAAM,KAAK;;;;;;;;;;;;;CAID,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,KAAK,CAAA;AAEhD;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,iBAAS,WAAW,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAsCtF;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -36,8 +36,10 @@ const SIZES = {
36
36
  lg: { mark: 'size-6', name: 'text-base' },
37
37
  };
38
38
  /**
39
- * A product's two-part colour mark: a hairline ring in the brand ink around a
40
- * core in the pack's own fill, beside the product's name in the brand ink.
39
+ * A product's two-part mark: the shape, beside the product's name in the brand
40
+ * ink. The shape is a disc by default, a hairline ring in the brand ink around
41
+ * a core in the pack's own fill, and it is the product's own drawing when
42
+ * `mark` carries one.
41
43
  *
42
44
  * Two parts, and both colours come from tokens, which is the whole reason this
43
45
  * is promoted out of the two hand-written copies it replaces. The ring is
@@ -71,12 +73,12 @@ const SIZES = {
71
73
  * The disc is `aria-hidden` and the name is not, so the mark adds a shape beside
72
74
  * the word rather than a second reading of it.
73
75
  */
74
- function ProductMark({ id, name, pack, size = 'md', className }) {
76
+ function ProductMark({ id, name, pack, mark, size = 'md', className }) {
75
77
  const drawn = SIZES[size];
76
78
  // `default` is the absence of a pack id, spelled the way the token build
77
79
  // spells it, so a base-pack product resolves `primary` from the page rather
78
80
  // than from an attribute that matches no emitted rule.
79
81
  const boundary = pack && pack !== 'default' ? pack : undefined;
80
- return (_jsxs("span", { "data-slot": "product-mark", "data-pack": boundary, className: cn('inline-flex items-center gap-2', className), children: [_jsx("span", { "data-slot": "product-mark-disc", "data-product": id, "aria-hidden": true, className: cn('inline-block shrink-0 rounded-full border border-brand-ink', drawn.mark, pack ? 'bg-primary' : SPECTRUM) }), _jsx("span", { "data-slot": "product-mark-name", className: cn('font-medium text-brand-ink', drawn.name), children: name })] }));
82
+ return (_jsxs("span", { "data-slot": "product-mark", "data-pack": boundary, className: cn('inline-flex items-center gap-2', className), children: [mark ? (_jsx("span", { "data-slot": "product-mark-drawn", "data-product": id, "aria-hidden": true, className: cn('inline-block shrink-0', drawn.mark), children: mark })) : (_jsx("span", { "data-slot": "product-mark-disc", "data-product": id, "aria-hidden": true, className: cn('inline-block shrink-0 rounded-full border border-brand-ink', drawn.mark, pack ? 'bg-primary' : SPECTRUM) })), _jsx("span", { "data-slot": "product-mark-name", className: cn('font-medium text-brand-ink', drawn.name), children: name })] }));
81
83
  }
82
84
  export { ProductMark };
@@ -1 +1 @@
1
- {"version":3,"file":"pulse-series.d.ts","sourceRoot":"","sources":["../../../src/components/ui/pulse-series.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAA;IACV,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;;;;;GAOG;AACH,KAAK,iBAAiB,GAClB;IACE;;;;OAIG;IACH,UAAU,EAAE,IAAI,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GACD;IACE,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,CAAA;AAEL,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG;IACjD;;;;OAIG;IACD,IAAI,EAAE,SAAS,QAAQ,EAAE,CAAA;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAoCH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,iBAAS,WAAW,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,IAAY,EACZ,KAAK,EACL,UAAkB,EAClB,SAAS,GACV,EAAE,gBAAgB,+BAsIlB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"pulse-series.d.ts","sourceRoot":"","sources":["../../../src/components/ui/pulse-series.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAA;IACV,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;;;;;GAOG;AACH,KAAK,iBAAiB,GAClB;IACE;;;;OAIG;IACH,UAAU,EAAE,IAAI,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GACD;IACE,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,CAAA;AAEL,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG;IACjD;;;;OAIG;IACD,IAAI,EAAE,SAAS,QAAQ,EAAE,CAAA;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAoCH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,iBAAS,WAAW,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,IAAY,EACZ,KAAK,EACL,UAAkB,EAClB,SAAS,GACV,EAAE,gBAAgB,+BAiJlB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -81,7 +81,7 @@ function PulseSeries({ bars, baseline, scan = false, label, decorative = false,
81
81
  const tallest = Math.max(...bars.map((bar) => bar.value), 0);
82
82
  const slot = bars.length ? roomX / bars.length : roomX;
83
83
  const barWidth = Math.max(2, Math.min(MAX_BAR_WIDTH, slot * (1 / (1 + BAR_GAP))));
84
- return (_jsxs("svg", { "data-slot": "pulse-series", "data-columns": bars.length, "data-scan": scan || undefined, viewBox: `0 0 ${CANVAS_WIDTH} ${CANVAS_HEIGHT}`, xmlns: "http://www.w3.org/2000/svg", role: decorative ? undefined : 'img', "aria-label": decorative ? undefined : label, "aria-hidden": decorative || undefined, className: cn('h-auto w-full', className), children: [scan ? (_jsx("g", { "data-slot": "pulse-series-scan", "aria-hidden": true, children: _jsxs("g", { className: "prism-ambient-scan", style: { '--ambient-scan-distance': `${roomX + slot}px` }, children: [_jsx("rect", { "data-slot": "pulse-series-scan-wash", x: PADDING - slot, y: PADDING_TOP - 12, width: slot, height: roomY + 12, className: "fill-brand-ink/10" }), _jsx("line", { "data-slot": "pulse-series-scan-line", x1: 0, y1: PADDING_TOP - 12, x2: 0, y2: baselineY, strokeWidth: 1, className: "stroke-brand-ink/60" })] }) })) : null, bars.map((bar, index) => {
84
+ return (_jsxs("svg", { "data-slot": "pulse-series", "data-columns": bars.length, "data-scan": scan || undefined, viewBox: `0 0 ${CANVAS_WIDTH} ${CANVAS_HEIGHT}`, xmlns: "http://www.w3.org/2000/svg", role: decorative ? undefined : 'img', "aria-label": decorative ? undefined : label, "aria-hidden": decorative || undefined, className: cn('h-auto w-full', className), children: [scan ? (_jsx("g", { "data-slot": "pulse-series-scan", "aria-hidden": true, transform: `translate(${PADDING} 0)`, children: _jsxs("g", { className: "prism-ambient-scan", style: { '--ambient-scan-distance': `${roomX}px` }, children: [_jsx("rect", { "data-slot": "pulse-series-scan-wash", x: -slot / 2, y: PADDING_TOP - 12, width: slot, height: baselineY - PADDING_TOP + 12, className: "fill-brand-ink/10" }), _jsx("line", { "data-slot": "pulse-series-scan-line", x1: 0, y1: PADDING_TOP - 12, x2: 0, y2: baselineY, strokeWidth: 1, className: "stroke-brand-ink/60" })] }) })) : null, bars.map((bar, index) => {
85
85
  const centre = PADDING + slot * (index + 0.5);
86
86
  // A column of value zero is drawn as a hairline rather than as nothing,
87
87
  // because a gap in a series is a missing reading and a missing reading
@@ -1 +1 @@
1
- {"version":3,"file":"sparkline.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sparkline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AA2C/C,uCAAuC;AACvC,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAChF;;;;;;;;OAQG;IACH,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB;;;;;;;;;OASG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,MAAM,EACN,KAAK,EACL,IAAgB,EAChB,KAAU,EACV,MAAW,EACX,aAAqB,EACrB,GAAG,KAAK,EACT,EAAE,cAAc,+BA6FhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"sparkline.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sparkline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AA0C/C,uCAAuC;AACvC,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAChF;;;;;;;;OAQG;IACH,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB;;;;;;;;;OASG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,MAAM,EACN,KAAK,EACL,IAAgB,EAChB,KAAU,EACV,MAAW,EACX,aAAqB,EACrB,GAAG,KAAK,EACT,EAAE,cAAc,+BAoGhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Table, TableBody, TableCaption, TableCell, TableHead, TableRow } from './table.js';
3
2
  import { cn } from '../../lib/utils.js';
4
3
  /** The fill a series mark is drawn in, from the role the caller assigned it. */
5
4
  const FILL = {
@@ -108,6 +107,6 @@ function Sparkline({ className, values, label, tone = 'chart-1', width = 96, hei
108
107
  const at = (index) => (index / (values.length - 1)) * 100;
109
108
  const up = (value) => INSET + (1 - (value - lowest) / span) * (100 - INSET * 2);
110
109
  const last = values.length - 1;
111
- return (_jsxs("figure", { "data-slot": "sparkline", "aria-label": label, className: cn('inline-flex shrink-0 flex-col', className), style: { width, height }, ...props, children: [_jsxs("span", { "data-slot": "sparkline-plot", "aria-hidden": "true", className: "relative block size-full", children: [_jsx("svg", { className: "pointer-events-none absolute inset-0 size-full overflow-visible", children: values.slice(1).map((value, index) => (_jsx("line", { x1: `${at(index)}%`, y1: `${up(values[index])}%`, x2: `${at(index + 1)}%`, y2: `${up(value)}%`, className: STROKE[tone], strokeWidth: 1.5, strokeLinecap: "round" }, index))) }), emphasizeLast ? (_jsx("span", { "data-slot": "sparkline-last", className: cn('absolute size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full', FILL[tone]), style: { left: `${at(last)}%`, top: `${up(values[last])}%` } })) : null] }), _jsx("div", { "data-slot": "sparkline-table", className: "sr-only", children: _jsxs(Table, { children: [_jsx(TableCaption, { children: label }), _jsx(TableBody, { children: values.map((value, index) => (_jsxs(TableRow, { children: [_jsx(TableHead, { scope: "row", className: "font-medium tabular-nums", children: index + 1 }), _jsx(TableCell, { className: "tabular-nums", children: value })] }, index))) })] }) })] }));
110
+ return (_jsxs("figure", { "data-slot": "sparkline", "aria-label": label, className: cn('inline-flex shrink-0 flex-col', className), style: { width, height }, ...props, children: [_jsxs("span", { "data-slot": "sparkline-plot", "aria-hidden": "true", className: "relative block size-full", children: [_jsx("svg", { className: "pointer-events-none absolute inset-0 size-full overflow-visible", children: values.slice(1).map((value, index) => (_jsx("line", { x1: `${at(index)}%`, y1: `${up(values[index])}%`, x2: `${at(index + 1)}%`, y2: `${up(value)}%`, className: STROKE[tone], strokeWidth: 1.5, strokeLinecap: "round" }, index))) }), emphasizeLast ? (_jsx("span", { "data-slot": "sparkline-last", className: cn('absolute size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full', FILL[tone]), style: { left: `${at(last)}%`, top: `${up(values[last])}%` } })) : null] }), _jsx("div", { "data-slot": "sparkline-table", className: "sr-only", children: _jsxs("table", { children: [_jsx("caption", { children: label }), _jsx("tbody", { children: values.map((value, index) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: index + 1 }), _jsx("td", { children: value })] }, index))) })] }) })] }));
112
111
  }
113
112
  export { Sparkline };
package/dist/styles.css CHANGED
@@ -944,6 +944,9 @@
944
944
  .min-w-40 {
945
945
  min-width: calc(var(--spacing) * 40);
946
946
  }
947
+ .min-w-44 {
948
+ min-width: calc(var(--spacing) * 44);
949
+ }
947
950
  .min-w-48 {
948
951
  min-width: calc(var(--spacing) * 48);
949
952
  }
@@ -2868,6 +2871,16 @@
2868
2871
  .data-\[checked\]\:text-primary-foreground[data-checked] {
2869
2872
  color: var(--primary-foreground);
2870
2873
  }
2874
+ .data-\[current\]\:bg-accent[data-current] {
2875
+ background-color: var(--accent);
2876
+ }
2877
+ .data-\[current\]\:font-medium[data-current] {
2878
+ --tw-font-weight: var(--font-weight-medium);
2879
+ font-weight: var(--font-weight-medium);
2880
+ }
2881
+ .data-\[current\]\:text-accent-foreground[data-current] {
2882
+ color: var(--accent-foreground);
2883
+ }
2871
2884
  .data-\[disabled\]\:pointer-events-none[data-disabled] {
2872
2885
  pointer-events: none;
2873
2886
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanisoft/prism-ui",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "description": "Prism's React component, block and page library.",
6
6
  "license": "MIT",