@eduardoalvarez/arrecife 0.7.0 → 0.8.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 +43 -0
- package/README.md +115 -41
- package/dist/brand/index.cjs +2 -2
- package/dist/brand/index.js +3 -3
- package/dist/chart/index.cjs +129 -2
- package/dist/chart/index.d.cts +114 -4
- package/dist/chart/index.d.ts +114 -4
- package/dist/chart/index.js +129 -5
- package/dist/{chunk-TA7TLWW4.js → chunk-5A5GH2PF.js} +1 -1
- package/dist/{chunk-727HCBD4.js → chunk-6IGD5REB.js} +1 -1
- package/dist/{chunk-2WPWEIMD.js → chunk-FAAGZG7A.js} +1 -1
- package/dist/{chunk-OMKSESQB.js → chunk-FGFNK72B.js} +3 -3
- package/dist/chunk-HOADZ6GS.js +72 -0
- package/dist/chunk-LXRGQKMG.js +145 -0
- package/dist/{chunk-JN3IS5OS.js → chunk-MPZBF2TZ.js} +2 -2
- package/dist/{chunk-WGNIRIN7.js → chunk-TRPBID2W.js} +1 -1
- package/dist/{chunk-E6KFUSKB.js → chunk-XXDATT3A.js} +1 -1
- package/dist/doctor.mjs +95 -13
- package/dist/form/index.cjs +2 -2
- package/dist/form/index.d.cts +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +4 -4
- package/dist/icons/index.cjs +2 -2
- package/dist/icons/index.d.cts +2 -2
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +2 -2
- package/dist/{index-DlAO2JZs.d.cts → index-BbRplw_B.d.cts} +15 -4
- package/dist/{index-DlAO2JZs.d.ts → index-BbRplw_B.d.ts} +15 -4
- package/dist/index.cjs +262 -264
- package/dist/index.d.cts +194 -124
- package/dist/index.d.ts +194 -124
- package/dist/index.js +151 -236
- package/dist/{label-MgHFKnFy.d.ts → label-DJ4HuD-R.d.cts} +3 -2
- package/dist/{label-MgHFKnFy.d.cts → label-DJ4HuD-R.d.ts} +3 -2
- package/dist/og/index.js +1 -1
- package/dist/shiki/index.js +1 -1
- package/dist/social/data.cjs +161 -0
- package/dist/social/data.d.cts +161 -0
- package/dist/social/data.d.ts +161 -0
- package/dist/social/data.js +2 -0
- package/dist/social/index.cjs +124 -38
- package/dist/social/index.d.cts +1 -1
- package/dist/social/index.d.ts +1 -1
- package/dist/social/index.js +2 -1
- package/dist/tokens/index.cjs +3 -3
- package/dist/tokens/index.d.cts +5 -5
- package/dist/tokens/index.d.ts +5 -5
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/theme.css +46 -19
- package/dist/variants/index.cjs +1 -1
- package/dist/variants/index.d.cts +2 -2
- package/dist/variants/index.d.ts +2 -2
- package/dist/variants/index.js +1 -1
- package/llms.txt +257 -140
- package/package.json +6 -1
- package/dist/chunk-45HVCTB7.js +0 -70
package/dist/chart/index.d.ts
CHANGED
|
@@ -22,9 +22,15 @@ import { Legend, Tooltip } from 'recharts';
|
|
|
22
22
|
* 3. The tooltip appears where it will stay: `isAnimationActive` is off
|
|
23
23
|
* everywhere, because the system does not animate position.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
* Recharts' API, the project already knows it, and wrapping them would
|
|
27
|
-
* layer of names to keep in sync with the library's version.
|
|
25
|
+
* Recharts' data pieces — `Area`, `Line`, `XAxis` — are still NOT re-exported.
|
|
26
|
+
* They are Recharts' API, the project already knows it, and wrapping them would
|
|
27
|
+
* be a layer of names to keep in sync with the library's version.
|
|
28
|
+
*
|
|
29
|
+
* What IS published, since this version, are three CHART TYPES on top of that
|
|
30
|
+
* chassis: `AreaChart`, `BarChart` and `LineChart`. They are not wrappers over
|
|
31
|
+
* Recharts' components of the same name — they take `data`, `series` and `xKey`
|
|
32
|
+
* and draw the whole thing. See `docs/decisions/0.8.md` § 43 for why the names
|
|
33
|
+
* collide on purpose.
|
|
28
34
|
*/
|
|
29
35
|
/**
|
|
30
36
|
* The color of series `index`, as a custom property.
|
|
@@ -123,5 +129,109 @@ type ChartLegendContentProps = {
|
|
|
123
129
|
};
|
|
124
130
|
/** The legend, with the tooltip's same square swatch and the `label` scale. */
|
|
125
131
|
declare function ChartLegendContent({ payload, className }: ChartLegendContentProps): react.JSX.Element | null;
|
|
132
|
+
/**
|
|
133
|
+
* One series: which key of the datum it reads, what it is called, and — only if
|
|
134
|
+
* you insist — what color it is.
|
|
135
|
+
*
|
|
136
|
+
* `color` is there for the case the palette cannot serve: a status series where
|
|
137
|
+
* «pagado» has to be `success` and not «the first of the four». Leaving it out
|
|
138
|
+
* is the normal case and the right one — `seriesColor(i)` follows the mode, and
|
|
139
|
+
* a hard-coded hex does not. See the note on `seriesColor` above.
|
|
140
|
+
*/
|
|
141
|
+
type ChartSeries = {
|
|
142
|
+
/** The key this series reads in each datum. */
|
|
143
|
+
key: string;
|
|
144
|
+
/** What the legend and the tooltip call it. User-facing, so Spanish. */
|
|
145
|
+
label: string;
|
|
146
|
+
/** Overrides the palette. Defaults to `seriesColor(index)`. */
|
|
147
|
+
color?: string | undefined;
|
|
148
|
+
};
|
|
149
|
+
/** A row of the chart: the category key plus one value per series. */
|
|
150
|
+
type ChartDatum = Record<string, unknown>;
|
|
151
|
+
/**
|
|
152
|
+
* What all three types take, and it is deliberately short: `data`, `series` and
|
|
153
|
+
* `xKey`, plus the container's own `label`.
|
|
154
|
+
*
|
|
155
|
+
* Everything that is NOT here is the part that was being copied — the gradient,
|
|
156
|
+
* the grid with no vertical lines, the axes with no line and no tick, the
|
|
157
|
+
* tooltip with no cursor. `cursos` wrote all of it four times, once per chart,
|
|
158
|
+
* and the fourth one would have had a different `strokeWidth` from the first.
|
|
159
|
+
* The drawing is the system's; the data is the project's.
|
|
160
|
+
*/
|
|
161
|
+
type SeriesChartProps = Omit<ChartContainerProps, 'children'> & {
|
|
162
|
+
data: readonly ChartDatum[];
|
|
163
|
+
series: readonly ChartSeries[];
|
|
164
|
+
/** The key on the category axis: the day, the month, the course. */
|
|
165
|
+
xKey: string;
|
|
166
|
+
/** Formats the value in the tooltip. The library imposes no locale. */
|
|
167
|
+
formatter?: ((value: unknown) => ReactNode) | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Shows the legend. It defaults to «only when there is more than one series»:
|
|
170
|
+
* a legend naming the one line already named by the chart's own heading is a
|
|
171
|
+
* row of pixels that says nothing.
|
|
172
|
+
*/
|
|
173
|
+
legend?: boolean | undefined;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* A series over time, with the fill fading out underneath it.
|
|
177
|
+
*
|
|
178
|
+
* The gradient is the whole reason this is a component and not three lines at
|
|
179
|
+
* the call site: it needs a `<linearGradient>` with an id, the id has to be
|
|
180
|
+
* unique on the page, and the two projects that wrote it by hand both hardcoded
|
|
181
|
+
* one — a second chart on the same screen would have taken the first one's fill.
|
|
182
|
+
* `useId` settles it.
|
|
183
|
+
*
|
|
184
|
+
* 0.5 down to 0.05 is the ramp `cursos` arrived at, and `type="natural"` is its
|
|
185
|
+
* curve: a monotone spline reads as a measurement and a straight segment reads
|
|
186
|
+
* as a schedule. The stroke is 2, which is the one weight in the system that is
|
|
187
|
+
* neither a hairline nor a border.
|
|
188
|
+
*
|
|
189
|
+
* With more than one series the areas OVERLAP rather than stack, because a
|
|
190
|
+
* stacked area answers «how much in total» and this library has no way to know
|
|
191
|
+
* that is the question. When it is, pass `stacked`. When you want to compare
|
|
192
|
+
* rather than add up, the answer is `LineChart`.
|
|
193
|
+
*/
|
|
194
|
+
type AreaChartProps = SeriesChartProps & {
|
|
195
|
+
/** Adds the series up instead of overlaying them. */
|
|
196
|
+
stacked?: boolean | undefined;
|
|
197
|
+
};
|
|
198
|
+
declare function AreaChart({ data, series, xKey, formatter, legend, stacked, ...container }: AreaChartProps): react.JSX.Element;
|
|
199
|
+
/**
|
|
200
|
+
* Bars, upright or lying down.
|
|
201
|
+
*
|
|
202
|
+
* `orientation` is named for what you SEE and not for what Recharts calls it,
|
|
203
|
+
* and the two are opposites: Recharts' `layout="vertical"` draws horizontal
|
|
204
|
+
* bars. That inversion is a coin flip every time somebody writes it, so it is
|
|
205
|
+
* settled here once — `vertical` means the bars grow upwards.
|
|
206
|
+
*
|
|
207
|
+
* `horizontal` is the shape for a ranking, which is what `cursos` uses it for:
|
|
208
|
+
* course names on the left, one bar each. It reserves 130px for the category
|
|
209
|
+
* axis and hides the value axis, because a ranking is read by comparing lengths
|
|
210
|
+
* and not by reading a number off a scale — the number is in the tooltip.
|
|
211
|
+
*
|
|
212
|
+
* The corner radius is `radius.chip`, the system's smallest. A bar is a chip
|
|
213
|
+
* lying down, and picking a number that is not a token is how a fifth radius
|
|
214
|
+
* gets into the system without anybody deciding it should.
|
|
215
|
+
*/
|
|
216
|
+
type BarChartProps = SeriesChartProps & {
|
|
217
|
+
/** `vertical` grows the bars upwards, which is the default. `horizontal` is a ranking. */
|
|
218
|
+
orientation?: 'vertical' | 'horizontal' | undefined;
|
|
219
|
+
/** Stacks the series instead of putting them side by side. */
|
|
220
|
+
stacked?: boolean | undefined;
|
|
221
|
+
};
|
|
222
|
+
declare function BarChart({ data, series, xKey, formatter, legend, orientation, stacked, ...container }: BarChartProps): react.JSX.Element;
|
|
223
|
+
/**
|
|
224
|
+
* Lines, for comparing series against each other.
|
|
225
|
+
*
|
|
226
|
+
* It is the type that does NOT add anything up, which is the whole reason it
|
|
227
|
+
* exists next to `AreaChart`: four filled areas on top of each other are a
|
|
228
|
+
* total, and four lines are four things you can tell apart.
|
|
229
|
+
*
|
|
230
|
+
* No dots at rest. A point per datum on a 90-day series is a dotted line, and
|
|
231
|
+
* the value is in the tooltip; the dot comes back on hover because that is
|
|
232
|
+
* where it means «this one».
|
|
233
|
+
*/
|
|
234
|
+
type LineChartProps = SeriesChartProps;
|
|
235
|
+
declare function LineChart({ data, series, xKey, formatter, legend, ...container }: LineChartProps): react.JSX.Element;
|
|
126
236
|
|
|
127
|
-
export { ChartContainer, type ChartContainerProps, ChartLegend, ChartLegendContent, type ChartLegendContentProps, type ChartPayloadItem, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, SERIES_COLORS, seriesColor };
|
|
237
|
+
export { AreaChart, type AreaChartProps, BarChart, type BarChartProps, ChartContainer, type ChartContainerProps, type ChartDatum, ChartLegend, ChartLegendContent, type ChartLegendContentProps, type ChartPayloadItem, type ChartSeries, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, LineChart, type LineChartProps, SERIES_COLORS, type SeriesChartProps, seriesColor };
|
package/dist/chart/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Text } from '../chunk-
|
|
2
|
+
import { Text } from '../chunk-TRPBID2W.js';
|
|
3
3
|
import '../chunk-ODBFN44D.js';
|
|
4
|
-
import { cn } from '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import { cn } from '../chunk-FAAGZG7A.js';
|
|
5
|
+
import { radius } from '../chunk-FGFNK72B.js';
|
|
6
6
|
import '../chunk-MLKGABMK.js';
|
|
7
|
-
import {
|
|
7
|
+
import { useId } from 'react';
|
|
8
|
+
import { ResponsiveContainer, Tooltip, Legend, AreaChart as AreaChart$1, CartesianGrid, XAxis, YAxis, Area, BarChart as BarChart$1, Bar, LineChart as LineChart$1, Line } from 'recharts';
|
|
8
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
11
|
function seriesColor(index) {
|
|
@@ -101,5 +102,128 @@ function ChartLegendContent({ payload, className }) {
|
|
|
101
102
|
/* @__PURE__ */ jsx(Text, { as: "span", variant: "label", tone: "secondary", className: "font-normal", children: item.value })
|
|
102
103
|
] }, `${String(item.dataKey ?? item.value ?? i)}`)) });
|
|
103
104
|
}
|
|
105
|
+
var rows = (data) => data;
|
|
106
|
+
var color = (series, index) => series.color ?? seriesColor(index);
|
|
107
|
+
var MARGIN = { left: 0, right: 12, top: 8, bottom: 0 };
|
|
108
|
+
var AXIS = { tickLine: false, axisLine: false };
|
|
109
|
+
var legendOf = (series, legend) => legend ?? series.length > 1 ? /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }, "legend") : null;
|
|
110
|
+
var tooltipOf = (formatter) => /* @__PURE__ */ jsx(
|
|
111
|
+
ChartTooltip,
|
|
112
|
+
{
|
|
113
|
+
cursor: false,
|
|
114
|
+
content: /* @__PURE__ */ jsx(ChartTooltipContent, { formatter: formatter ? (value) => formatter(value) : void 0 })
|
|
115
|
+
},
|
|
116
|
+
"tooltip"
|
|
117
|
+
);
|
|
118
|
+
function AreaChart({
|
|
119
|
+
data,
|
|
120
|
+
series,
|
|
121
|
+
xKey,
|
|
122
|
+
formatter,
|
|
123
|
+
legend,
|
|
124
|
+
stacked = false,
|
|
125
|
+
...container
|
|
126
|
+
}) {
|
|
127
|
+
const id = useId();
|
|
128
|
+
return /* @__PURE__ */ jsx(ChartContainer, { ...container, children: /* @__PURE__ */ jsxs(AreaChart$1, { data: rows(data), margin: MARGIN, children: [
|
|
129
|
+
/* @__PURE__ */ jsx("defs", { children: series.map((s, i) => /* @__PURE__ */ jsxs("linearGradient", { id: `${id}-${s.key}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
130
|
+
/* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: color(s, i), stopOpacity: 0.5 }),
|
|
131
|
+
/* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: color(s, i), stopOpacity: 0.05 })
|
|
132
|
+
] }, s.key)) }),
|
|
133
|
+
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
134
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xKey, ...AXIS, tickMargin: 8 }),
|
|
135
|
+
/* @__PURE__ */ jsx(YAxis, { ...AXIS, width: 40 }),
|
|
136
|
+
tooltipOf(formatter),
|
|
137
|
+
legendOf(series, legend),
|
|
138
|
+
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
139
|
+
Area,
|
|
140
|
+
{
|
|
141
|
+
dataKey: s.key,
|
|
142
|
+
name: s.label,
|
|
143
|
+
type: "natural",
|
|
144
|
+
stroke: color(s, i),
|
|
145
|
+
strokeWidth: 2,
|
|
146
|
+
fill: `url(#${id}-${s.key})`,
|
|
147
|
+
isAnimationActive: false,
|
|
148
|
+
...stacked ? { stackId: "stack" } : {}
|
|
149
|
+
},
|
|
150
|
+
s.key
|
|
151
|
+
))
|
|
152
|
+
] }) });
|
|
153
|
+
}
|
|
154
|
+
function BarChart({
|
|
155
|
+
data,
|
|
156
|
+
series,
|
|
157
|
+
xKey,
|
|
158
|
+
formatter,
|
|
159
|
+
legend,
|
|
160
|
+
orientation = "vertical",
|
|
161
|
+
stacked = false,
|
|
162
|
+
...container
|
|
163
|
+
}) {
|
|
164
|
+
const lying = orientation === "horizontal";
|
|
165
|
+
return /* @__PURE__ */ jsx(ChartContainer, { ...container, children: /* @__PURE__ */ jsxs(
|
|
166
|
+
BarChart$1,
|
|
167
|
+
{
|
|
168
|
+
data: rows(data),
|
|
169
|
+
margin: MARGIN,
|
|
170
|
+
...lying ? { layout: "vertical" } : {},
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ jsx(CartesianGrid, { vertical: lying, horizontal: !lying }),
|
|
173
|
+
lying ? [
|
|
174
|
+
/* @__PURE__ */ jsx(YAxis, { dataKey: xKey, type: "category", ...AXIS, width: 130 }, "category"),
|
|
175
|
+
/* @__PURE__ */ jsx(XAxis, { type: "number", hide: true }, "value")
|
|
176
|
+
] : [
|
|
177
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xKey, ...AXIS, tickMargin: 8 }, "category"),
|
|
178
|
+
/* @__PURE__ */ jsx(YAxis, { ...AXIS, width: 40 }, "value")
|
|
179
|
+
],
|
|
180
|
+
tooltipOf(formatter),
|
|
181
|
+
legendOf(series, legend),
|
|
182
|
+
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
183
|
+
Bar,
|
|
184
|
+
{
|
|
185
|
+
dataKey: s.key,
|
|
186
|
+
name: s.label,
|
|
187
|
+
fill: color(s, i),
|
|
188
|
+
radius: lying ? [0, radius.chip, radius.chip, 0] : [radius.chip, radius.chip, 0, 0],
|
|
189
|
+
isAnimationActive: false,
|
|
190
|
+
...stacked ? { stackId: "stack" } : {}
|
|
191
|
+
},
|
|
192
|
+
s.key
|
|
193
|
+
))
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
) });
|
|
197
|
+
}
|
|
198
|
+
function LineChart({
|
|
199
|
+
data,
|
|
200
|
+
series,
|
|
201
|
+
xKey,
|
|
202
|
+
formatter,
|
|
203
|
+
legend,
|
|
204
|
+
...container
|
|
205
|
+
}) {
|
|
206
|
+
return /* @__PURE__ */ jsx(ChartContainer, { ...container, children: /* @__PURE__ */ jsxs(LineChart$1, { data: rows(data), margin: MARGIN, children: [
|
|
207
|
+
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
208
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xKey, ...AXIS, tickMargin: 8 }),
|
|
209
|
+
/* @__PURE__ */ jsx(YAxis, { ...AXIS, width: 40 }),
|
|
210
|
+
tooltipOf(formatter),
|
|
211
|
+
legendOf(series, legend),
|
|
212
|
+
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
213
|
+
Line,
|
|
214
|
+
{
|
|
215
|
+
dataKey: s.key,
|
|
216
|
+
name: s.label,
|
|
217
|
+
type: "natural",
|
|
218
|
+
stroke: color(s, i),
|
|
219
|
+
strokeWidth: 2,
|
|
220
|
+
dot: false,
|
|
221
|
+
activeDot: { r: 4 },
|
|
222
|
+
isAnimationActive: false
|
|
223
|
+
},
|
|
224
|
+
s.key
|
|
225
|
+
))
|
|
226
|
+
] }) });
|
|
227
|
+
}
|
|
104
228
|
|
|
105
|
-
export { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, SERIES_COLORS, seriesColor };
|
|
229
|
+
export { AreaChart, BarChart, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, LineChart, SERIES_COLORS, seriesColor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { naming, tagline, motion, shadow, series, syntax, gradient, size, spacing, control, radius, limits, typeScale, fonts, brand, colors } from './chunk-
|
|
1
|
+
import { naming, tagline, motion, shadow, series, syntax, gradient, size, spacing, control, radius, limits, typeScale, fonts, brand, colors } from './chunk-FGFNK72B.js';
|
|
2
2
|
|
|
3
3
|
// src/tokens/index.ts
|
|
4
4
|
var tokens = {
|
|
@@ -144,7 +144,7 @@ var typeScale = {
|
|
|
144
144
|
* (plankton 5.57:1 over abyss), which is the part that is not negotiable.
|
|
145
145
|
*
|
|
146
146
|
* At 13 the three badge families grew past the size of a small button and
|
|
147
|
-
* outweighed the title they accompany. See `docs/decisions
|
|
147
|
+
* outweighed the title they accompany. See `docs/decisions/`.
|
|
148
148
|
*/
|
|
149
149
|
chip: { family: "mono", size: 11.5, lineHeight: 1.4, weight: 400 },
|
|
150
150
|
/**
|
|
@@ -198,7 +198,7 @@ var control = {
|
|
|
198
198
|
* baseline; 28 would have been a fifth height that matches nothing.
|
|
199
199
|
*
|
|
200
200
|
* It does not replace `icon`. A page's primary action stays at 42; this is for
|
|
201
|
-
* a row of a table. See `docs/decisions.md` § 22.
|
|
201
|
+
* a row of a table. See `docs/decisions/0.6.md` § 22.
|
|
202
202
|
*/
|
|
203
203
|
iconSm: 32
|
|
204
204
|
};
|
|
@@ -221,7 +221,7 @@ var size = {
|
|
|
221
221
|
* together eat the top of the content area. 56 is what `cursos` had arrived at
|
|
222
222
|
* on its own, and it is the same reasoning as `control.iconSm`: the one admin
|
|
223
223
|
* app of the five is denser than the four reading sites. See
|
|
224
|
-
* `docs/decisions.md` § 30.
|
|
224
|
+
* `docs/decisions/0.7.md` § 30.
|
|
225
225
|
*/
|
|
226
226
|
navCompact: 56,
|
|
227
227
|
/**
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { gitHubGlyph, linkedInGlyph, xGlyph, instagramGlyph, discordGlyph, youTubeGlyph, rssGlyph, emailGlyph, newsletterGlyph, websiteGlyph, SOCIAL_STROKE_WIDTH, SOCIAL_VIEW_BOX } from './chunk-LXRGQKMG.js';
|
|
2
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/social/index.tsx
|
|
6
|
+
var social_exports = {};
|
|
7
|
+
__export(social_exports, {
|
|
8
|
+
Discord: () => Discord,
|
|
9
|
+
Email: () => Email,
|
|
10
|
+
GitHub: () => GitHub,
|
|
11
|
+
Instagram: () => Instagram,
|
|
12
|
+
LinkedIn: () => LinkedIn,
|
|
13
|
+
Newsletter: () => Newsletter,
|
|
14
|
+
Rss: () => Rss,
|
|
15
|
+
Website: () => Website,
|
|
16
|
+
X: () => X,
|
|
17
|
+
YouTube: () => YouTube
|
|
18
|
+
});
|
|
19
|
+
var SOLID = { fill: "currentColor", stroke: "none" };
|
|
20
|
+
function drawShape(shape, index) {
|
|
21
|
+
if (shape.tag === "path") {
|
|
22
|
+
return /* @__PURE__ */ jsx("path", { d: shape.d, ...shape.solid ? SOLID : {} }, index);
|
|
23
|
+
}
|
|
24
|
+
if (shape.tag === "circle") {
|
|
25
|
+
return /* @__PURE__ */ jsx("circle", { cx: shape.cx, cy: shape.cy, r: shape.r, ...shape.solid ? SOLID : {} }, index);
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
"rect",
|
|
29
|
+
{
|
|
30
|
+
x: shape.x,
|
|
31
|
+
y: shape.y,
|
|
32
|
+
width: shape.width,
|
|
33
|
+
height: shape.height,
|
|
34
|
+
rx: shape.rx
|
|
35
|
+
},
|
|
36
|
+
index
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function Glyph({ glyph, ...props }) {
|
|
40
|
+
const brand = glyph.kind === "brand";
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"svg",
|
|
43
|
+
{
|
|
44
|
+
viewBox: SOCIAL_VIEW_BOX,
|
|
45
|
+
width: "1em",
|
|
46
|
+
height: "1em",
|
|
47
|
+
fill: brand ? "currentColor" : "none",
|
|
48
|
+
...brand ? {} : {
|
|
49
|
+
stroke: "currentColor",
|
|
50
|
+
strokeWidth: SOCIAL_STROKE_WIDTH,
|
|
51
|
+
strokeLinecap: "round",
|
|
52
|
+
strokeLinejoin: "round"
|
|
53
|
+
},
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
focusable: "false",
|
|
56
|
+
...props,
|
|
57
|
+
children: glyph.shapes.map(drawShape)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
var GitHub = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: gitHubGlyph, ...props });
|
|
62
|
+
var LinkedIn = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: linkedInGlyph, ...props });
|
|
63
|
+
var X = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: xGlyph, ...props });
|
|
64
|
+
var Instagram = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: instagramGlyph, ...props });
|
|
65
|
+
var Discord = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: discordGlyph, ...props });
|
|
66
|
+
var YouTube = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: youTubeGlyph, ...props });
|
|
67
|
+
var Rss = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: rssGlyph, ...props });
|
|
68
|
+
var Email = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: emailGlyph, ...props });
|
|
69
|
+
var Newsletter = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: newsletterGlyph, ...props });
|
|
70
|
+
var Website = (props) => /* @__PURE__ */ jsx(Glyph, { glyph: websiteGlyph, ...props });
|
|
71
|
+
|
|
72
|
+
export { Discord, Email, GitHub, Instagram, LinkedIn, Newsletter, Rss, Website, X, YouTube, social_exports };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// src/social/data.ts
|
|
2
|
+
var SOCIAL_STROKE_WIDTH = 1.6;
|
|
3
|
+
var SOCIAL_VIEW_BOX = "0 0 24 24";
|
|
4
|
+
var gitHubGlyph = {
|
|
5
|
+
kind: "brand",
|
|
6
|
+
shapes: [
|
|
7
|
+
{
|
|
8
|
+
tag: "path",
|
|
9
|
+
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"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
var linkedInGlyph = {
|
|
14
|
+
kind: "brand",
|
|
15
|
+
shapes: [
|
|
16
|
+
{
|
|
17
|
+
tag: "path",
|
|
18
|
+
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"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
var xGlyph = {
|
|
23
|
+
kind: "brand",
|
|
24
|
+
shapes: [
|
|
25
|
+
{
|
|
26
|
+
tag: "path",
|
|
27
|
+
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"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
};
|
|
31
|
+
var instagramGlyph = {
|
|
32
|
+
kind: "brand",
|
|
33
|
+
shapes: [
|
|
34
|
+
{
|
|
35
|
+
tag: "path",
|
|
36
|
+
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"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
var discordGlyph = {
|
|
41
|
+
kind: "brand",
|
|
42
|
+
shapes: [
|
|
43
|
+
{
|
|
44
|
+
tag: "path",
|
|
45
|
+
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"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
var youTubeGlyph = {
|
|
50
|
+
kind: "brand",
|
|
51
|
+
shapes: [
|
|
52
|
+
{
|
|
53
|
+
tag: "path",
|
|
54
|
+
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"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
};
|
|
58
|
+
var rssGlyph = {
|
|
59
|
+
kind: "functional",
|
|
60
|
+
shapes: [
|
|
61
|
+
{ tag: "path", d: "M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0 1 16 16" },
|
|
62
|
+
{ tag: "circle", cx: 5, cy: 19, r: 1.6, solid: true }
|
|
63
|
+
]
|
|
64
|
+
};
|
|
65
|
+
var emailGlyph = {
|
|
66
|
+
kind: "functional",
|
|
67
|
+
shapes: [
|
|
68
|
+
{ tag: "rect", x: 2.75, y: 4.75, width: 18.5, height: 14.5, rx: 2 },
|
|
69
|
+
{ tag: "path", d: "m3.5 7.5 7.4 5.2a2 2 0 0 0 2.2 0l7.4-5.2" }
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
var newsletterGlyph = {
|
|
73
|
+
kind: "functional",
|
|
74
|
+
shapes: [
|
|
75
|
+
{ tag: "path", d: "M18 8.5a6 6 0 1 0-12 0c0 5-2 6.5-2 6.5h16s-2-1.5-2-6.5" },
|
|
76
|
+
{ tag: "path", d: "M13.7 19a2 2 0 0 1-3.4 0" }
|
|
77
|
+
]
|
|
78
|
+
};
|
|
79
|
+
var websiteGlyph = {
|
|
80
|
+
kind: "functional",
|
|
81
|
+
shapes: [
|
|
82
|
+
{ tag: "circle", cx: 12, cy: 12, r: 9.25 },
|
|
83
|
+
{ tag: "path", d: "M2.75 12h18.5" },
|
|
84
|
+
{ tag: "path", d: "M12 2.75a14 14 0 0 1 0 18.5a14 14 0 0 1 0-18.5" }
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
var socialGlyphs = {
|
|
88
|
+
Discord: discordGlyph,
|
|
89
|
+
Email: emailGlyph,
|
|
90
|
+
GitHub: gitHubGlyph,
|
|
91
|
+
Instagram: instagramGlyph,
|
|
92
|
+
LinkedIn: linkedInGlyph,
|
|
93
|
+
Newsletter: newsletterGlyph,
|
|
94
|
+
Rss: rssGlyph,
|
|
95
|
+
Website: websiteGlyph,
|
|
96
|
+
X: xGlyph,
|
|
97
|
+
YouTube: youTubeGlyph
|
|
98
|
+
};
|
|
99
|
+
var socialNames = Object.keys(socialGlyphs);
|
|
100
|
+
var escape = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
101
|
+
var attributes = (pairs) => Object.entries(pairs).map(([key, value]) => ` ${key}="${escape(String(value))}"`).join("");
|
|
102
|
+
var shapeMarkup = (shape) => {
|
|
103
|
+
const solid = { fill: "currentColor", stroke: "none" };
|
|
104
|
+
if (shape.tag === "path") {
|
|
105
|
+
return `<path${attributes({ d: shape.d, ...shape.solid ? solid : {} })}/>`;
|
|
106
|
+
}
|
|
107
|
+
if (shape.tag === "circle") {
|
|
108
|
+
return `<circle${attributes({
|
|
109
|
+
cx: shape.cx,
|
|
110
|
+
cy: shape.cy,
|
|
111
|
+
r: shape.r,
|
|
112
|
+
...shape.solid ? solid : {}
|
|
113
|
+
})}/>`;
|
|
114
|
+
}
|
|
115
|
+
return `<rect${attributes({
|
|
116
|
+
x: shape.x,
|
|
117
|
+
y: shape.y,
|
|
118
|
+
width: shape.width,
|
|
119
|
+
height: shape.height,
|
|
120
|
+
rx: shape.rx
|
|
121
|
+
})}/>`;
|
|
122
|
+
};
|
|
123
|
+
function socialSvg(name, extra = {}) {
|
|
124
|
+
const glyph = socialGlyphs[name];
|
|
125
|
+
const base = glyph.kind === "brand" ? { fill: "currentColor" } : {
|
|
126
|
+
fill: "none",
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
"stroke-width": SOCIAL_STROKE_WIDTH,
|
|
129
|
+
"stroke-linecap": "round",
|
|
130
|
+
"stroke-linejoin": "round"
|
|
131
|
+
};
|
|
132
|
+
const open = attributes({
|
|
133
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
134
|
+
viewBox: SOCIAL_VIEW_BOX,
|
|
135
|
+
width: "1em",
|
|
136
|
+
height: "1em",
|
|
137
|
+
...base,
|
|
138
|
+
"aria-hidden": "true",
|
|
139
|
+
focusable: "false",
|
|
140
|
+
...extra
|
|
141
|
+
});
|
|
142
|
+
return `<svg${open}>${glyph.shapes.map(shapeMarkup).join("")}</svg>`;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { SOCIAL_STROKE_WIDTH, SOCIAL_VIEW_BOX, discordGlyph, emailGlyph, gitHubGlyph, instagramGlyph, linkedInGlyph, newsletterGlyph, rssGlyph, socialGlyphs, socialNames, socialSvg, websiteGlyph, xGlyph, youTubeGlyph };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cn } from './chunk-2WPWEIMD.js';
|
|
2
1
|
import { fins, ASSETS_PATH, poses, faces } from './chunk-CKRSQPTX.js';
|
|
3
|
-
import {
|
|
2
|
+
import { cn } from './chunk-FAAGZG7A.js';
|
|
3
|
+
import { naming, tagline } from './chunk-FGFNK72B.js';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
function Isotype({
|
|
@@ -19,7 +19,7 @@ var button = cva(
|
|
|
19
19
|
],
|
|
20
20
|
// The one control whose focus ring is not biolume. It is the system's
|
|
21
21
|
// only sand fill, and a biolume ring three pixels off a sand button puts
|
|
22
|
-
// both of the brand's accents in the same glance. See `decisions.md` § 37.
|
|
22
|
+
// both of the brand's accents in the same glance. See `docs/decisions/0.7.md` § 37.
|
|
23
23
|
conversion: "bg-warm text-warm-on hover:bg-warm-hover focus-ring-warm",
|
|
24
24
|
secondary: [
|
|
25
25
|
"border-hairline-hover border bg-transparent text-text-primary",
|