@eduardoalvarez/arrecife 0.5.1 → 0.7.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.
- package/CHANGELOG.md +114 -0
- package/README.md +868 -467
- package/dist/brand/index.cjs +112 -95
- package/dist/brand/index.d.cts +40 -39
- package/dist/brand/index.d.ts +40 -39
- package/dist/brand/index.js +5 -4
- package/dist/catalog-D13txprv.d.cts +78 -0
- package/dist/catalog-D13txprv.d.ts +78 -0
- package/dist/chart/index.cjs +100 -83
- package/dist/chart/index.d.cts +66 -66
- package/dist/chart/index.d.ts +66 -66
- package/dist/chart/index.js +14 -12
- package/dist/chunk-2WPWEIMD.js +27 -0
- package/dist/chunk-45HVCTB7.js +70 -0
- package/dist/{chunk-ZEOQKRQ7.js → chunk-727HCBD4.js} +1 -1
- package/dist/chunk-CKRSQPTX.js +36 -0
- package/dist/chunk-E6KFUSKB.js +144 -0
- package/dist/chunk-GCRII2KQ.js +86 -0
- package/dist/{chunk-YZ2SDOVZ.js → chunk-JN3IS5OS.js} +30 -30
- package/dist/chunk-ODBFN44D.js +45 -0
- package/dist/chunk-OMKSESQB.js +300 -0
- package/dist/{chunk-VPT32GPG.js → chunk-TA7TLWW4.js} +2 -2
- package/dist/chunk-WGNIRIN7.js +42 -0
- package/dist/doctor.mjs +166 -0
- package/dist/form/index.cjs +109 -92
- package/dist/form/index.d.cts +43 -42
- package/dist/form/index.d.ts +43 -42
- package/dist/form/index.js +25 -23
- package/dist/icons/index.cjs +149 -0
- package/dist/icons/index.d.cts +94 -0
- package/dist/icons/index.d.ts +94 -0
- package/dist/icons/index.js +28 -0
- package/dist/index-DlAO2JZs.d.cts +47 -0
- package/dist/index-DlAO2JZs.d.ts +47 -0
- package/dist/index.cjs +1292 -983
- package/dist/index.d.cts +927 -806
- package/dist/index.d.ts +927 -806
- package/dist/index.js +809 -778
- package/dist/{label-DuTvJGxD.d.ts → label-MgHFKnFy.d.cts} +3 -3
- package/dist/{label-DuTvJGxD.d.cts → label-MgHFKnFy.d.ts} +3 -3
- package/dist/og/index.cjs +133 -132
- package/dist/og/index.d.cts +93 -89
- package/dist/og/index.d.ts +93 -89
- package/dist/og/index.js +106 -106
- package/dist/shiki/index.cjs +28 -30
- package/dist/shiki/index.d.cts +4 -4
- package/dist/shiki/index.d.ts +4 -4
- package/dist/shiki/index.js +12 -12
- package/dist/social/index.cjs +67 -0
- package/dist/social/index.d.cts +2 -0
- package/dist/social/index.d.ts +2 -0
- package/dist/social/index.js +2 -0
- package/dist/theme/index.cjs +97 -0
- package/dist/theme/index.d.cts +144 -0
- package/dist/theme/index.d.ts +144 -0
- package/dist/theme/index.js +2 -0
- package/dist/tokens/index.cjs +159 -88
- package/dist/tokens/index.d.cts +277 -165
- package/dist/tokens/index.d.ts +277 -165
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/theme.css +165 -100
- package/dist/variants/index.cjs +195 -0
- package/dist/variants/index.d.cts +195 -0
- package/dist/variants/index.d.ts +195 -0
- package/dist/variants/index.js +3 -0
- package/llms.txt +1145 -746
- package/package.json +42 -11
- package/dist/catalogo-Du5ID-Hi.d.cts +0 -77
- package/dist/catalogo-Du5ID-Hi.d.ts +0 -77
- package/dist/chunk-E3OMP2DL.js +0 -36
- package/dist/chunk-KPZNNMV5.js +0 -83
- package/dist/chunk-NHS7ETKJ.js +0 -27
- package/dist/chunk-TSPJOM6K.js +0 -229
- package/dist/chunk-UOWIDFCB.js +0 -81
- package/dist/tema/index.cjs +0 -94
- package/dist/tema/index.d.cts +0 -110
- package/dist/tema/index.d.ts +0 -110
- package/dist/tema/index.js +0 -2
package/dist/chart/index.d.cts
CHANGED
|
@@ -3,93 +3,93 @@ import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
3
3
|
import { Legend, Tooltip } from 'recharts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* The chassis for charts: container, tooltip and legend in the system's
|
|
7
|
+
* vocabulary. Recharts paints; this decides how it looks.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* It is published at `@eduardoalvarez/arrecife/chart` and NOT at the root.
|
|
10
|
+
* Recharts is heavy, and only one of the five projects draws metrics: hanging it
|
|
11
|
+
* off the main index would force the other four to install it just so their
|
|
12
|
+
* bundler could resolve an import they never execute. It is an OPTIONAL peer
|
|
13
|
+
* dependency, by the same criterion that keeps `./og` and `./shiki` React-free.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* What this layer adds — and what was lost by copying shadcn's `chart.tsx` into
|
|
16
|
+
* each project — are three things that drift on their own:
|
|
17
17
|
*
|
|
18
|
-
* 1.
|
|
19
|
-
*
|
|
20
|
-
* 2.
|
|
21
|
-
*
|
|
22
|
-
* 3.
|
|
23
|
-
*
|
|
18
|
+
* 1. The series palette comes from `tokens.series` and follows the mode. There
|
|
19
|
+
* are four and they are told apart by hue, not by lightness.
|
|
20
|
+
* 2. The grid, the axes and the cursor use `hairline` and `textMuted`, not
|
|
21
|
+
* Recharts' default greys, which are not part of this identity.
|
|
22
|
+
* 3. The tooltip appears where it will stay: `isAnimationActive` is off
|
|
23
|
+
* everywhere, because the system does not animate position.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* The data pieces — `BarChart`, `Line`, `XAxis` — are NOT re-exported. They are
|
|
26
|
+
* Recharts' API, the project already knows it, and wrapping them would be a
|
|
27
|
+
* layer of names to keep in sync with the library's version.
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* The color of series `index`, as a custom property.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* It returns `var(--color-series-N)` and not the hexadecimal: read in JS, the
|
|
33
|
+
* hex would be the one from whichever mode was active when the component
|
|
34
|
+
* mounted, and it would not change when the theme is toggled. The variable is
|
|
35
|
+
* resolved by the browser on every paint.
|
|
35
36
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* It wraps around past four. Two series sharing a color is a visible failure,
|
|
38
|
+
* and that is the correct signal: the chart has more categories than this
|
|
39
|
+
* identity can tell apart, and what to do is group them into «otros».
|
|
39
40
|
*/
|
|
40
|
-
declare function
|
|
41
|
-
/**
|
|
42
|
-
declare const
|
|
41
|
+
declare function seriesColor(index: number): string;
|
|
42
|
+
/** All four, in order, to hand to a `Pie` with `Cell` in one go. */
|
|
43
|
+
declare const SERIES_COLORS: string[];
|
|
43
44
|
type ChartContainerProps = Omit<ComponentPropsWithoutRef<'figure'>, 'title'> & {
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* What the chart shows, in one sentence. Mandatory, like `Progress`'s `label`:
|
|
47
|
+
* a bar `<svg>` with no accessible name is not «a chart without a label», it
|
|
48
|
+
* is an empty region.
|
|
48
49
|
*/
|
|
49
50
|
label: string;
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
-
* visualmente.
|
|
52
|
+
* What the chart says, in words. It goes in a visually hidden `figcaption`.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* caída en mayo
|
|
54
|
+
* It does not replace the chart: Recharts' accessibility layer already lets
|
|
55
|
+
* you walk the points with the keyboard. It is the headline — «sube de 24 a 52
|
|
56
|
+
* con una caída en mayo» — that no point-by-point walk gives you.
|
|
57
57
|
*/
|
|
58
58
|
summary?: ReactNode;
|
|
59
|
-
/**
|
|
59
|
+
/** Height in pixels. Recharts needs a concrete one to measure itself. */
|
|
60
60
|
height?: number;
|
|
61
61
|
children: ReactNode;
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* Wraps the chart in a `<figure>` with an accessible name and gives Recharts the
|
|
65
|
+
* concrete height it needs to measure itself.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
67
|
+
* The `<figure>` carries NO `role`: it already has its implicit one, and putting
|
|
68
|
+
* `group` on top of it is a role not allowed for the element — axe flags it.
|
|
69
|
+
* What it does carry is `aria-label`, which is what names it.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
71
|
+
* And the content is NOT `aria-hidden`. That was the first thing tried, with the
|
|
72
|
+
* argument that announcing every tick does not tell what the chart tells, and it
|
|
73
|
+
* is wrong for two reasons: Recharts' accessibility layer makes the chart
|
|
74
|
+
* walkable with the keyboard, and hiding a subtree containing focusable elements
|
|
75
|
+
* is a violation in itself — focus lands on something that does not exist for
|
|
76
|
+
* whoever is listening. The summary adds to that, it does not replace it.
|
|
77
77
|
*/
|
|
78
78
|
declare function ChartContainer({ label, summary, height, className, children, ...props }: ChartContainerProps): react.JSX.Element;
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
80
|
+
* Recharts' `Tooltip` with the system's defaults: no animation, and the cursor
|
|
81
|
+
* tinted `surfaceRaised`.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
83
|
+
* You pass `content={<ChartTooltipContent />}` for the box.
|
|
84
84
|
*/
|
|
85
85
|
declare function ChartTooltip(props: ComponentPropsWithoutRef<typeof Tooltip>): react.JSX.Element;
|
|
86
86
|
declare function ChartLegend(props: ComponentPropsWithoutRef<typeof Legend>): react.JSX.Element;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* What Recharts passes to a `content`, declared here in short form.
|
|
89
89
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
90
|
+
* Recharts' types for this are open and drag in generics that add nothing at the
|
|
91
|
+
* call site; `any` is banned in this repo, so what is actually read is declared
|
|
92
|
+
* and the value is treated as `unknown`.
|
|
93
93
|
*/
|
|
94
94
|
type ChartPayloadItem = {
|
|
95
95
|
name?: string | number | undefined;
|
|
@@ -101,27 +101,27 @@ type ChartTooltipContentProps = {
|
|
|
101
101
|
active?: boolean | undefined;
|
|
102
102
|
payload?: readonly ChartPayloadItem[] | undefined;
|
|
103
103
|
label?: ReactNode;
|
|
104
|
-
/**
|
|
105
|
-
formatter?: ((
|
|
106
|
-
/**
|
|
104
|
+
/** Formats the value. Without it, it is printed as is: the library imposes no locale. */
|
|
105
|
+
formatter?: ((value: unknown, item: ChartPayloadItem) => ReactNode) | undefined;
|
|
106
|
+
/** Hides the header, for a single-category chart. */
|
|
107
107
|
hideLabel?: boolean;
|
|
108
108
|
className?: string;
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
111
|
+
* The tooltip's box. It is a system card — `surface`, control border, standard
|
|
112
|
+
* shadow — and not Recharts' white box, which in dark mode is a white rectangle
|
|
113
|
+
* on top of a dark panel.
|
|
114
114
|
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
115
|
+
* The color swatch is an 8px square, not a circle: it is the same mark the
|
|
116
|
+
* legend uses, and at 8 pixels a circle and a square are harder to tell apart
|
|
117
|
+
* from each other than two colors of the palette are.
|
|
118
118
|
*/
|
|
119
119
|
declare function ChartTooltipContent({ active, payload, label, formatter, hideLabel, className, }: ChartTooltipContentProps): react.JSX.Element | null;
|
|
120
120
|
type ChartLegendContentProps = {
|
|
121
121
|
payload?: readonly ChartPayloadItem[] | undefined;
|
|
122
122
|
className?: string;
|
|
123
123
|
};
|
|
124
|
-
/**
|
|
124
|
+
/** The legend, with the tooltip's same square swatch and the `label` scale. */
|
|
125
125
|
declare function ChartLegendContent({ payload, className }: ChartLegendContentProps): react.JSX.Element | null;
|
|
126
126
|
|
|
127
|
-
export {
|
|
127
|
+
export { ChartContainer, type ChartContainerProps, ChartLegend, ChartLegendContent, type ChartLegendContentProps, type ChartPayloadItem, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, SERIES_COLORS, seriesColor };
|
package/dist/chart/index.d.ts
CHANGED
|
@@ -3,93 +3,93 @@ import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
3
3
|
import { Legend, Tooltip } from 'recharts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* The chassis for charts: container, tooltip and legend in the system's
|
|
7
|
+
* vocabulary. Recharts paints; this decides how it looks.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* It is published at `@eduardoalvarez/arrecife/chart` and NOT at the root.
|
|
10
|
+
* Recharts is heavy, and only one of the five projects draws metrics: hanging it
|
|
11
|
+
* off the main index would force the other four to install it just so their
|
|
12
|
+
* bundler could resolve an import they never execute. It is an OPTIONAL peer
|
|
13
|
+
* dependency, by the same criterion that keeps `./og` and `./shiki` React-free.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* What this layer adds — and what was lost by copying shadcn's `chart.tsx` into
|
|
16
|
+
* each project — are three things that drift on their own:
|
|
17
17
|
*
|
|
18
|
-
* 1.
|
|
19
|
-
*
|
|
20
|
-
* 2.
|
|
21
|
-
*
|
|
22
|
-
* 3.
|
|
23
|
-
*
|
|
18
|
+
* 1. The series palette comes from `tokens.series` and follows the mode. There
|
|
19
|
+
* are four and they are told apart by hue, not by lightness.
|
|
20
|
+
* 2. The grid, the axes and the cursor use `hairline` and `textMuted`, not
|
|
21
|
+
* Recharts' default greys, which are not part of this identity.
|
|
22
|
+
* 3. The tooltip appears where it will stay: `isAnimationActive` is off
|
|
23
|
+
* everywhere, because the system does not animate position.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* The data pieces — `BarChart`, `Line`, `XAxis` — are NOT re-exported. They are
|
|
26
|
+
* Recharts' API, the project already knows it, and wrapping them would be a
|
|
27
|
+
* layer of names to keep in sync with the library's version.
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* The color of series `index`, as a custom property.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* It returns `var(--color-series-N)` and not the hexadecimal: read in JS, the
|
|
33
|
+
* hex would be the one from whichever mode was active when the component
|
|
34
|
+
* mounted, and it would not change when the theme is toggled. The variable is
|
|
35
|
+
* resolved by the browser on every paint.
|
|
35
36
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* It wraps around past four. Two series sharing a color is a visible failure,
|
|
38
|
+
* and that is the correct signal: the chart has more categories than this
|
|
39
|
+
* identity can tell apart, and what to do is group them into «otros».
|
|
39
40
|
*/
|
|
40
|
-
declare function
|
|
41
|
-
/**
|
|
42
|
-
declare const
|
|
41
|
+
declare function seriesColor(index: number): string;
|
|
42
|
+
/** All four, in order, to hand to a `Pie` with `Cell` in one go. */
|
|
43
|
+
declare const SERIES_COLORS: string[];
|
|
43
44
|
type ChartContainerProps = Omit<ComponentPropsWithoutRef<'figure'>, 'title'> & {
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* What the chart shows, in one sentence. Mandatory, like `Progress`'s `label`:
|
|
47
|
+
* a bar `<svg>` with no accessible name is not «a chart without a label», it
|
|
48
|
+
* is an empty region.
|
|
48
49
|
*/
|
|
49
50
|
label: string;
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
-
* visualmente.
|
|
52
|
+
* What the chart says, in words. It goes in a visually hidden `figcaption`.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* caída en mayo
|
|
54
|
+
* It does not replace the chart: Recharts' accessibility layer already lets
|
|
55
|
+
* you walk the points with the keyboard. It is the headline — «sube de 24 a 52
|
|
56
|
+
* con una caída en mayo» — that no point-by-point walk gives you.
|
|
57
57
|
*/
|
|
58
58
|
summary?: ReactNode;
|
|
59
|
-
/**
|
|
59
|
+
/** Height in pixels. Recharts needs a concrete one to measure itself. */
|
|
60
60
|
height?: number;
|
|
61
61
|
children: ReactNode;
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* Wraps the chart in a `<figure>` with an accessible name and gives Recharts the
|
|
65
|
+
* concrete height it needs to measure itself.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
67
|
+
* The `<figure>` carries NO `role`: it already has its implicit one, and putting
|
|
68
|
+
* `group` on top of it is a role not allowed for the element — axe flags it.
|
|
69
|
+
* What it does carry is `aria-label`, which is what names it.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
71
|
+
* And the content is NOT `aria-hidden`. That was the first thing tried, with the
|
|
72
|
+
* argument that announcing every tick does not tell what the chart tells, and it
|
|
73
|
+
* is wrong for two reasons: Recharts' accessibility layer makes the chart
|
|
74
|
+
* walkable with the keyboard, and hiding a subtree containing focusable elements
|
|
75
|
+
* is a violation in itself — focus lands on something that does not exist for
|
|
76
|
+
* whoever is listening. The summary adds to that, it does not replace it.
|
|
77
77
|
*/
|
|
78
78
|
declare function ChartContainer({ label, summary, height, className, children, ...props }: ChartContainerProps): react.JSX.Element;
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
80
|
+
* Recharts' `Tooltip` with the system's defaults: no animation, and the cursor
|
|
81
|
+
* tinted `surfaceRaised`.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
83
|
+
* You pass `content={<ChartTooltipContent />}` for the box.
|
|
84
84
|
*/
|
|
85
85
|
declare function ChartTooltip(props: ComponentPropsWithoutRef<typeof Tooltip>): react.JSX.Element;
|
|
86
86
|
declare function ChartLegend(props: ComponentPropsWithoutRef<typeof Legend>): react.JSX.Element;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* What Recharts passes to a `content`, declared here in short form.
|
|
89
89
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
90
|
+
* Recharts' types for this are open and drag in generics that add nothing at the
|
|
91
|
+
* call site; `any` is banned in this repo, so what is actually read is declared
|
|
92
|
+
* and the value is treated as `unknown`.
|
|
93
93
|
*/
|
|
94
94
|
type ChartPayloadItem = {
|
|
95
95
|
name?: string | number | undefined;
|
|
@@ -101,27 +101,27 @@ type ChartTooltipContentProps = {
|
|
|
101
101
|
active?: boolean | undefined;
|
|
102
102
|
payload?: readonly ChartPayloadItem[] | undefined;
|
|
103
103
|
label?: ReactNode;
|
|
104
|
-
/**
|
|
105
|
-
formatter?: ((
|
|
106
|
-
/**
|
|
104
|
+
/** Formats the value. Without it, it is printed as is: the library imposes no locale. */
|
|
105
|
+
formatter?: ((value: unknown, item: ChartPayloadItem) => ReactNode) | undefined;
|
|
106
|
+
/** Hides the header, for a single-category chart. */
|
|
107
107
|
hideLabel?: boolean;
|
|
108
108
|
className?: string;
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
111
|
+
* The tooltip's box. It is a system card — `surface`, control border, standard
|
|
112
|
+
* shadow — and not Recharts' white box, which in dark mode is a white rectangle
|
|
113
|
+
* on top of a dark panel.
|
|
114
114
|
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
115
|
+
* The color swatch is an 8px square, not a circle: it is the same mark the
|
|
116
|
+
* legend uses, and at 8 pixels a circle and a square are harder to tell apart
|
|
117
|
+
* from each other than two colors of the palette are.
|
|
118
118
|
*/
|
|
119
119
|
declare function ChartTooltipContent({ active, payload, label, formatter, hideLabel, className, }: ChartTooltipContentProps): react.JSX.Element | null;
|
|
120
120
|
type ChartLegendContentProps = {
|
|
121
121
|
payload?: readonly ChartPayloadItem[] | undefined;
|
|
122
122
|
className?: string;
|
|
123
123
|
};
|
|
124
|
-
/**
|
|
124
|
+
/** The legend, with the tooltip's same square swatch and the `label` scale. */
|
|
125
125
|
declare function ChartLegendContent({ payload, className }: ChartLegendContentProps): react.JSX.Element | null;
|
|
126
126
|
|
|
127
|
-
export {
|
|
127
|
+
export { ChartContainer, type ChartContainerProps, ChartLegend, ChartLegendContent, type ChartLegendContentProps, type ChartPayloadItem, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, SERIES_COLORS, seriesColor };
|
package/dist/chart/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import '../chunk-
|
|
1
|
+
'use client';
|
|
2
|
+
import { Text } from '../chunk-WGNIRIN7.js';
|
|
3
|
+
import '../chunk-ODBFN44D.js';
|
|
4
|
+
import { cn } from '../chunk-2WPWEIMD.js';
|
|
5
|
+
import '../chunk-OMKSESQB.js';
|
|
4
6
|
import '../chunk-MLKGABMK.js';
|
|
5
7
|
import { ResponsiveContainer, Tooltip, Legend } from 'recharts';
|
|
6
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
9
|
|
|
8
|
-
function
|
|
9
|
-
return `var(--color-
|
|
10
|
+
function seriesColor(index) {
|
|
11
|
+
return `var(--color-series-${Math.abs(index) % 4 + 1})`;
|
|
10
12
|
}
|
|
11
|
-
var
|
|
13
|
+
var SERIES_COLORS = [0, 1, 2, 3].map(seriesColor);
|
|
12
14
|
function ChartContainer({
|
|
13
15
|
label,
|
|
14
16
|
summary,
|
|
@@ -23,9 +25,9 @@ function ChartContainer({
|
|
|
23
25
|
"aria-label": label,
|
|
24
26
|
className: cn(
|
|
25
27
|
"w-full",
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
28
|
+
// The grid and the axes, with the system's tokens instead of Recharts'
|
|
29
|
+
// default greys. They go as descendant variants because the nodes are
|
|
30
|
+
// painted by the library and there is nowhere to put a class on them.
|
|
29
31
|
"[&_.recharts-cartesian-grid_line]:stroke-hairline",
|
|
30
32
|
"[&_.recharts-cartesian-axis-line]:stroke-hairline",
|
|
31
33
|
"[&_.recharts-cartesian-axis-tick_text]:fill-text-muted",
|
|
@@ -75,7 +77,7 @@ function ChartTooltipContent({
|
|
|
75
77
|
{
|
|
76
78
|
"aria-hidden": "true",
|
|
77
79
|
className: "rounded-chip size-2 shrink-0",
|
|
78
|
-
style: { backgroundColor: item.color ??
|
|
80
|
+
style: { backgroundColor: item.color ?? seriesColor(i) }
|
|
79
81
|
}
|
|
80
82
|
),
|
|
81
83
|
/* @__PURE__ */ jsx(Text, { as: "span", variant: "label", tone: "secondary", className: "font-normal", children: item.name }),
|
|
@@ -93,11 +95,11 @@ function ChartLegendContent({ payload, className }) {
|
|
|
93
95
|
{
|
|
94
96
|
"aria-hidden": "true",
|
|
95
97
|
className: "rounded-chip size-2 shrink-0",
|
|
96
|
-
style: { backgroundColor: item.color ??
|
|
98
|
+
style: { backgroundColor: item.color ?? seriesColor(i) }
|
|
97
99
|
}
|
|
98
100
|
),
|
|
99
101
|
/* @__PURE__ */ jsx(Text, { as: "span", variant: "label", tone: "secondary", className: "font-normal", children: item.value })
|
|
100
102
|
] }, `${String(item.dataKey ?? item.value ?? i)}`)) });
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
export {
|
|
105
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, SERIES_COLORS, seriesColor };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { spacing, control, radius, typeScale } from './chunk-OMKSESQB.js';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
4
|
+
|
|
5
|
+
var kebab = (name) => name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
6
|
+
var scales = Object.keys(typeScale);
|
|
7
|
+
var radii = Object.keys(radius);
|
|
8
|
+
var namespaces = Object.keys(spacing).map(kebab);
|
|
9
|
+
var controls = Object.keys(control).map((name) => `control-${kebab(name)}`);
|
|
10
|
+
var twMerge = extendTailwindMerge({
|
|
11
|
+
extend: {
|
|
12
|
+
classGroups: {
|
|
13
|
+
"font-size": [{ text: scales }],
|
|
14
|
+
rounded: [{ rounded: radii }],
|
|
15
|
+
p: [{ p: namespaces }],
|
|
16
|
+
px: [{ px: [...namespaces, ...controls] }],
|
|
17
|
+
py: [{ py: namespaces }],
|
|
18
|
+
gap: [{ gap: namespaces }],
|
|
19
|
+
size: [{ size: controls }]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function cn(...inputs) {
|
|
24
|
+
return twMerge(clsx(inputs));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { cn };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/social/index.tsx
|
|
5
|
+
var social_exports = {};
|
|
6
|
+
__export(social_exports, {
|
|
7
|
+
Discord: () => Discord,
|
|
8
|
+
Email: () => Email,
|
|
9
|
+
GitHub: () => GitHub,
|
|
10
|
+
Instagram: () => Instagram,
|
|
11
|
+
LinkedIn: () => LinkedIn,
|
|
12
|
+
Newsletter: () => Newsletter,
|
|
13
|
+
Rss: () => Rss,
|
|
14
|
+
X: () => X,
|
|
15
|
+
YouTube: () => YouTube
|
|
16
|
+
});
|
|
17
|
+
function Brand({ children, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
"svg",
|
|
20
|
+
{
|
|
21
|
+
viewBox: "0 0 24 24",
|
|
22
|
+
width: "1em",
|
|
23
|
+
height: "1em",
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
focusable: "false",
|
|
27
|
+
...props,
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function Functional({ children, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"svg",
|
|
35
|
+
{
|
|
36
|
+
viewBox: "0 0 24 24",
|
|
37
|
+
width: "1em",
|
|
38
|
+
height: "1em",
|
|
39
|
+
fill: "none",
|
|
40
|
+
stroke: "currentColor",
|
|
41
|
+
strokeWidth: 1.6,
|
|
42
|
+
strokeLinecap: "round",
|
|
43
|
+
strokeLinejoin: "round",
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
focusable: "false",
|
|
46
|
+
...props,
|
|
47
|
+
children
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
var GitHub = (props) => /* @__PURE__ */ jsx(Brand, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M12 .5C5.73.5.5 5.73.5 12a11.5 11.5 0 0 0 7.86 10.91c.58.1.79-.25.79-.55 0-.27-.01-1.18-.02-2.14-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.79 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.12 3.05.74.8 1.18 1.83 1.18 3.09 0 4.42-2.69 5.39-5.25 5.68.41.36.78 1.06.78 2.14 0 1.55-.01 2.79-.01 3.17 0 .3.2.66.79.55A11.5 11.5 0 0 0 23.5 12C23.5 5.73 18.27.5 12 .5Z" }) });
|
|
52
|
+
var LinkedIn = (props) => /* @__PURE__ */ jsx(Brand, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M4.98 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM3 9h4v12H3V9Zm7 0h3.8v1.71h.05a4.17 4.17 0 0 1 3.75-2.06c4.01 0 4.75 2.64 4.75 6.07V21h-4v-5.4c0-1.29-.02-2.95-1.8-2.95-1.8 0-2.08 1.4-2.08 2.85V21h-3.97V9Z" }) });
|
|
53
|
+
var X = (props) => /* @__PURE__ */ jsx(Brand, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M17.53 3h3.06l-6.69 7.64L21.75 21h-6.16l-4.83-6.3L5.25 21H2.19l7.15-8.17L2.5 3h6.32l4.36 5.77L17.53 3Zm-1.07 16.17h1.7L7.62 4.74H5.8l10.66 14.43Z" }) });
|
|
54
|
+
var Instagram = (props) => /* @__PURE__ */ jsx(Brand, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M12 2.16c3.2 0 3.58.01 4.85.07 1.17.05 1.8.25 2.23.41.56.22.96.48 1.38.9.42.42.68.82.9 1.38.16.42.36 1.06.41 2.23.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.05 1.17-.25 1.8-.41 2.23-.22.56-.48.96-.9 1.38-.42.42-.82.68-1.38.9-.42.16-1.06.36-2.23.41-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-1.17-.05-1.8-.25-2.23-.41-.56-.22-.96-.48-1.38-.9-.42-.42-.68-.82-.9-1.38-.16-.42-.36-1.06-.41-2.23C2.17 15.58 2.16 15.2 2.16 12s.01-3.58.07-4.85c.05-1.17.25-1.8.41-2.23.22-.56.48-.96.9-1.38.42-.42.82-.68 1.38-.9.42-.16 1.06-.36 2.23-.41C8.42 2.17 8.8 2.16 12 2.16Zm0 3.68a6.16 6.16 0 1 0 0 12.32 6.16 6.16 0 0 0 0-12.32Zm0 10.16a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm7.85-10.4a1.44 1.44 0 1 1-2.88 0 1.44 1.44 0 0 1 2.88 0Z" }) });
|
|
55
|
+
var Discord = (props) => /* @__PURE__ */ jsx(Brand, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M20.32 5.56A18.5 18.5 0 0 0 15.7 4.1a.07.07 0 0 0-.07.04c-.2.36-.42.82-.58 1.19a17 17 0 0 0-5.1 0c-.16-.38-.39-.83-.59-1.19a.07.07 0 0 0-.07-.04c-1.6.28-3.15.77-4.62 1.46a.06.06 0 0 0-.03.03C1.66 10 .9 14.28 1.28 18.5a.08.08 0 0 0 .03.05 18.6 18.6 0 0 0 5.6 2.84.07.07 0 0 0 .08-.03c.43-.59.81-1.21 1.14-1.86a.07.07 0 0 0-.04-.1c-.6-.23-1.18-.51-1.74-.83a.07.07 0 0 1-.01-.12l.35-.27a.07.07 0 0 1 .07-.01 13.3 13.3 0 0 0 11.3 0 .07.07 0 0 1 .08.01l.34.27c.04.04.04.1-.01.12-.55.33-1.13.6-1.74.83a.07.07 0 0 0-.04.1c.34.65.72 1.27 1.14 1.86a.07.07 0 0 0 .08.03 18.5 18.5 0 0 0 5.6-2.84.07.07 0 0 0 .04-.05c.45-4.88-.75-9.12-3.18-12.88a.06.06 0 0 0-.03-.03ZM8.4 15.93c-1.1 0-2.01-1.01-2.01-2.25 0-1.24.89-2.25 2.01-2.25 1.13 0 2.03 1.02 2.02 2.25 0 1.24-.9 2.25-2.02 2.25Zm7.22 0c-1.1 0-2.01-1.01-2.01-2.25 0-1.24.89-2.25 2.01-2.25 1.13 0 2.03 1.02 2.02 2.25 0 1.24-.89 2.25-2.02 2.25Z" }) });
|
|
56
|
+
var YouTube = (props) => /* @__PURE__ */ jsx(Brand, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M23.5 6.9a3 3 0 0 0-2.12-2.12C19.5 4.27 12 4.27 12 4.27s-7.5 0-9.38.51A3 3 0 0 0 .5 6.9 31.3 31.3 0 0 0 0 12a31.3 31.3 0 0 0 .5 5.1 3 3 0 0 0 2.12 2.12c1.88.51 9.38.51 9.38.51s7.5 0 9.38-.51a3 3 0 0 0 2.12-2.12A31.3 31.3 0 0 0 24 12a31.3 31.3 0 0 0-.5-5.1ZM9.6 15.6V8.4l6.24 3.6-6.24 3.6Z" }) });
|
|
57
|
+
var Rss = (props) => /* @__PURE__ */ jsxs(Functional, { ...props, children: [
|
|
58
|
+
/* @__PURE__ */ jsx("path", { d: "M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0 1 16 16" }),
|
|
59
|
+
/* @__PURE__ */ jsx("circle", { cx: "5", cy: "19", r: "1.6", fill: "currentColor", stroke: "none" })
|
|
60
|
+
] });
|
|
61
|
+
var Email = (props) => /* @__PURE__ */ jsxs(Functional, { ...props, children: [
|
|
62
|
+
/* @__PURE__ */ jsx("rect", { x: "2.75", y: "4.75", width: "18.5", height: "14.5", rx: "2" }),
|
|
63
|
+
/* @__PURE__ */ jsx("path", { d: "m3.5 7.5 7.4 5.2a2 2 0 0 0 2.2 0l7.4-5.2" })
|
|
64
|
+
] });
|
|
65
|
+
var Newsletter = (props) => /* @__PURE__ */ jsxs(Functional, { ...props, children: [
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M18 8.5a6 6 0 1 0-12 0c0 5-2 6.5-2 6.5h16s-2-1.5-2-6.5" }),
|
|
67
|
+
/* @__PURE__ */ jsx("path", { d: "M13.7 19a2 2 0 0 1-3.4 0" })
|
|
68
|
+
] });
|
|
69
|
+
|
|
70
|
+
export { Discord, Email, GitHub, Instagram, LinkedIn, Newsletter, Rss, X, YouTube, social_exports };
|