@eduardoalvarez/arrecife 0.9.0 → 0.11.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 +58 -0
- package/README.md +111 -70
- package/dist/brand/index.cjs +9 -3
- package/dist/brand/index.d.cts +45 -6
- package/dist/brand/index.d.ts +45 -6
- package/dist/brand/index.js +2 -3
- package/dist/chart/index.cjs +26 -4
- package/dist/chart/index.d.cts +19 -3
- package/dist/chart/index.d.ts +19 -3
- package/dist/chart/index.js +26 -5
- package/dist/{chunk-MPZBF2TZ.js → chunk-RKGKO2TW.js} +11 -5
- package/dist/chunk-ZSCSKCTY.js +26 -0
- package/dist/form/index.js +0 -1
- package/dist/icons/index.d.cts +19 -10
- package/dist/icons/index.d.ts +19 -10
- package/dist/icons/index.js +2 -27
- package/dist/index.cjs +277 -401
- package/dist/index.d.cts +114 -13
- package/dist/index.d.ts +114 -13
- package/dist/index.js +211 -203
- package/dist/og/index.js +0 -1
- package/dist/shiki/index.js +0 -1
- package/dist/theme/index.js +0 -1
- package/dist/tokens/index.js +0 -1
- package/dist/tokens/theme.css +21 -1
- package/dist/variants/index.js +0 -1
- package/llms.txt +99 -138
- package/package.json +18 -30
- package/dist/chunk-HOADZ6GS.js +0 -72
- package/dist/chunk-LXRGQKMG.js +0 -145
- package/dist/chunk-MLKGABMK.js +0 -7
- package/dist/index-BbRplw_B.d.cts +0 -58
- package/dist/index-BbRplw_B.d.ts +0 -58
- package/dist/social/data.cjs +0 -161
- package/dist/social/data.d.cts +0 -161
- package/dist/social/data.d.ts +0 -161
- package/dist/social/data.js +0 -2
- package/dist/social/index.cjs +0 -153
- package/dist/social/index.d.cts +0 -2
- package/dist/social/index.d.ts +0 -2
- package/dist/social/index.js +0 -3
package/dist/chart/index.d.cts
CHANGED
|
@@ -187,6 +187,22 @@ type SeriesChartProps = Omit<ChartContainerProps, 'children'> & {
|
|
|
187
187
|
* «$1200» in the tooltip, and the axis is the one you read while comparing.
|
|
188
188
|
*/
|
|
189
189
|
yTickFormatter?: ((value: unknown) => string) | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* The top of the value axis, when the scale has one that the data does not
|
|
192
|
+
* reach — 100 for a percentage.
|
|
193
|
+
*
|
|
194
|
+
* Without it the axis ends at the largest datum, and on a chart of «% visto»
|
|
195
|
+
* a course watched to 40 % draws as a full bar when it is the highest on the
|
|
196
|
+
* list. On `BarChart orientation="horizontal"` nothing gives that away: the
|
|
197
|
+
* value axis is hidden by design, so the chart says something false and
|
|
198
|
+
* looks exactly like one that does not.
|
|
199
|
+
*
|
|
200
|
+
* The bottom is always zero. A bar that does not start at zero is a
|
|
201
|
+
* different lie, and this prop is not a way into it. It is a floor for the
|
|
202
|
+
* top and not a clip either: a datum above it extends the axis instead of
|
|
203
|
+
* running off the edge. See `docs/decisions/0.11.md` § 58.
|
|
204
|
+
*/
|
|
205
|
+
valueMax?: number | undefined;
|
|
190
206
|
/**
|
|
191
207
|
* Shows the legend. It defaults to «only when there is more than one series»:
|
|
192
208
|
* a legend naming the one line already named by the chart's own heading is a
|
|
@@ -217,7 +233,7 @@ type AreaChartProps = SeriesChartProps & {
|
|
|
217
233
|
/** Adds the series up instead of overlaying them. */
|
|
218
234
|
stacked?: boolean | undefined;
|
|
219
235
|
};
|
|
220
|
-
declare function AreaChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, legend, stacked, ...container }: AreaChartProps): react.JSX.Element;
|
|
236
|
+
declare function AreaChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, valueMax, legend, stacked, ...container }: AreaChartProps): react.JSX.Element;
|
|
221
237
|
/**
|
|
222
238
|
* Bars, upright or lying down.
|
|
223
239
|
*
|
|
@@ -241,7 +257,7 @@ type BarChartProps = SeriesChartProps & {
|
|
|
241
257
|
/** Stacks the series instead of putting them side by side. */
|
|
242
258
|
stacked?: boolean | undefined;
|
|
243
259
|
};
|
|
244
|
-
declare function BarChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, legend, orientation, stacked, ...container }: BarChartProps): react.JSX.Element;
|
|
260
|
+
declare function BarChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, valueMax, legend, orientation, stacked, ...container }: BarChartProps): react.JSX.Element;
|
|
245
261
|
/**
|
|
246
262
|
* Lines, for comparing series against each other.
|
|
247
263
|
*
|
|
@@ -254,6 +270,6 @@ declare function BarChart({ data, series, xKey, formatter, xTickFormatter, yTick
|
|
|
254
270
|
* where it means «this one».
|
|
255
271
|
*/
|
|
256
272
|
type LineChartProps = SeriesChartProps;
|
|
257
|
-
declare function LineChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, legend, ...container }: LineChartProps): react.JSX.Element;
|
|
273
|
+
declare function LineChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, valueMax, legend, ...container }: LineChartProps): react.JSX.Element;
|
|
258
274
|
|
|
259
275
|
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.d.ts
CHANGED
|
@@ -187,6 +187,22 @@ type SeriesChartProps = Omit<ChartContainerProps, 'children'> & {
|
|
|
187
187
|
* «$1200» in the tooltip, and the axis is the one you read while comparing.
|
|
188
188
|
*/
|
|
189
189
|
yTickFormatter?: ((value: unknown) => string) | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* The top of the value axis, when the scale has one that the data does not
|
|
192
|
+
* reach — 100 for a percentage.
|
|
193
|
+
*
|
|
194
|
+
* Without it the axis ends at the largest datum, and on a chart of «% visto»
|
|
195
|
+
* a course watched to 40 % draws as a full bar when it is the highest on the
|
|
196
|
+
* list. On `BarChart orientation="horizontal"` nothing gives that away: the
|
|
197
|
+
* value axis is hidden by design, so the chart says something false and
|
|
198
|
+
* looks exactly like one that does not.
|
|
199
|
+
*
|
|
200
|
+
* The bottom is always zero. A bar that does not start at zero is a
|
|
201
|
+
* different lie, and this prop is not a way into it. It is a floor for the
|
|
202
|
+
* top and not a clip either: a datum above it extends the axis instead of
|
|
203
|
+
* running off the edge. See `docs/decisions/0.11.md` § 58.
|
|
204
|
+
*/
|
|
205
|
+
valueMax?: number | undefined;
|
|
190
206
|
/**
|
|
191
207
|
* Shows the legend. It defaults to «only when there is more than one series»:
|
|
192
208
|
* a legend naming the one line already named by the chart's own heading is a
|
|
@@ -217,7 +233,7 @@ type AreaChartProps = SeriesChartProps & {
|
|
|
217
233
|
/** Adds the series up instead of overlaying them. */
|
|
218
234
|
stacked?: boolean | undefined;
|
|
219
235
|
};
|
|
220
|
-
declare function AreaChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, legend, stacked, ...container }: AreaChartProps): react.JSX.Element;
|
|
236
|
+
declare function AreaChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, valueMax, legend, stacked, ...container }: AreaChartProps): react.JSX.Element;
|
|
221
237
|
/**
|
|
222
238
|
* Bars, upright or lying down.
|
|
223
239
|
*
|
|
@@ -241,7 +257,7 @@ type BarChartProps = SeriesChartProps & {
|
|
|
241
257
|
/** Stacks the series instead of putting them side by side. */
|
|
242
258
|
stacked?: boolean | undefined;
|
|
243
259
|
};
|
|
244
|
-
declare function BarChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, legend, orientation, stacked, ...container }: BarChartProps): react.JSX.Element;
|
|
260
|
+
declare function BarChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, valueMax, legend, orientation, stacked, ...container }: BarChartProps): react.JSX.Element;
|
|
245
261
|
/**
|
|
246
262
|
* Lines, for comparing series against each other.
|
|
247
263
|
*
|
|
@@ -254,6 +270,6 @@ declare function BarChart({ data, series, xKey, formatter, xTickFormatter, yTick
|
|
|
254
270
|
* where it means «this one».
|
|
255
271
|
*/
|
|
256
272
|
type LineChartProps = SeriesChartProps;
|
|
257
|
-
declare function LineChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, legend, ...container }: LineChartProps): react.JSX.Element;
|
|
273
|
+
declare function LineChart({ data, series, xKey, formatter, xTickFormatter, yTickFormatter, valueMax, legend, ...container }: LineChartProps): react.JSX.Element;
|
|
258
274
|
|
|
259
275
|
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
|
@@ -3,7 +3,6 @@ import { Text } from '../chunk-TRPBID2W.js';
|
|
|
3
3
|
import '../chunk-ODBFN44D.js';
|
|
4
4
|
import { cn } from '../chunk-FAAGZG7A.js';
|
|
5
5
|
import { radius } from '../chunk-FGFNK72B.js';
|
|
6
|
-
import '../chunk-MLKGABMK.js';
|
|
7
6
|
import { useId } from 'react';
|
|
8
7
|
import { ResponsiveContainer, Tooltip, Legend, AreaChart as AreaChart$1, CartesianGrid, XAxis, YAxis, Area, BarChart as BarChart$1, Bar, LineChart as LineChart$1, Line } from 'recharts';
|
|
9
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -107,6 +106,7 @@ var color = (series, index) => series.color ?? seriesColor(index);
|
|
|
107
106
|
var MARGIN = { left: 0, right: 12, top: 8, bottom: 0 };
|
|
108
107
|
var AXIS = { tickLine: false, axisLine: false };
|
|
109
108
|
var tickOf = (format) => format ? { tickFormatter: format } : {};
|
|
109
|
+
var domainOf = (max) => max === void 0 ? {} : { domain: [0, max] };
|
|
110
110
|
var legendOf = (series, legend) => legend ?? series.length > 1 ? /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }, "legend") : null;
|
|
111
111
|
var tooltipOf = (formatter) => /* @__PURE__ */ jsx(
|
|
112
112
|
ChartTooltip,
|
|
@@ -123,6 +123,7 @@ function AreaChart({
|
|
|
123
123
|
formatter,
|
|
124
124
|
xTickFormatter,
|
|
125
125
|
yTickFormatter,
|
|
126
|
+
valueMax,
|
|
126
127
|
legend,
|
|
127
128
|
stacked = false,
|
|
128
129
|
...container
|
|
@@ -135,7 +136,7 @@ function AreaChart({
|
|
|
135
136
|
] }, s.key)) }),
|
|
136
137
|
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
137
138
|
/* @__PURE__ */ jsx(XAxis, { dataKey: xKey, ...AXIS, tickMargin: 8, ...tickOf(xTickFormatter) }),
|
|
138
|
-
/* @__PURE__ */ jsx(YAxis, { ...AXIS, width: 40, ...tickOf(yTickFormatter) }),
|
|
139
|
+
/* @__PURE__ */ jsx(YAxis, { ...AXIS, width: 40, ...tickOf(yTickFormatter), ...domainOf(valueMax) }),
|
|
139
140
|
tooltipOf(formatter),
|
|
140
141
|
legendOf(series, legend),
|
|
141
142
|
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
@@ -161,6 +162,7 @@ function BarChart({
|
|
|
161
162
|
formatter,
|
|
162
163
|
xTickFormatter,
|
|
163
164
|
yTickFormatter,
|
|
165
|
+
valueMax,
|
|
164
166
|
legend,
|
|
165
167
|
orientation = "vertical",
|
|
166
168
|
stacked = false,
|
|
@@ -187,7 +189,16 @@ function BarChart({
|
|
|
187
189
|
},
|
|
188
190
|
"category"
|
|
189
191
|
),
|
|
190
|
-
/* @__PURE__ */ jsx(
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
XAxis,
|
|
194
|
+
{
|
|
195
|
+
type: "number",
|
|
196
|
+
hide: true,
|
|
197
|
+
...tickOf(yTickFormatter),
|
|
198
|
+
...domainOf(valueMax)
|
|
199
|
+
},
|
|
200
|
+
"value"
|
|
201
|
+
)
|
|
191
202
|
] : [
|
|
192
203
|
/* @__PURE__ */ jsx(
|
|
193
204
|
XAxis,
|
|
@@ -199,7 +210,16 @@ function BarChart({
|
|
|
199
210
|
},
|
|
200
211
|
"category"
|
|
201
212
|
),
|
|
202
|
-
/* @__PURE__ */ jsx(
|
|
213
|
+
/* @__PURE__ */ jsx(
|
|
214
|
+
YAxis,
|
|
215
|
+
{
|
|
216
|
+
...AXIS,
|
|
217
|
+
width: 40,
|
|
218
|
+
...tickOf(yTickFormatter),
|
|
219
|
+
...domainOf(valueMax)
|
|
220
|
+
},
|
|
221
|
+
"value"
|
|
222
|
+
)
|
|
203
223
|
],
|
|
204
224
|
tooltipOf(formatter),
|
|
205
225
|
legendOf(series, legend),
|
|
@@ -226,13 +246,14 @@ function LineChart({
|
|
|
226
246
|
formatter,
|
|
227
247
|
xTickFormatter,
|
|
228
248
|
yTickFormatter,
|
|
249
|
+
valueMax,
|
|
229
250
|
legend,
|
|
230
251
|
...container
|
|
231
252
|
}) {
|
|
232
253
|
return /* @__PURE__ */ jsx(ChartContainer, { ...container, children: /* @__PURE__ */ jsxs(LineChart$1, { data: rows(data), margin: MARGIN, children: [
|
|
233
254
|
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
234
255
|
/* @__PURE__ */ jsx(XAxis, { dataKey: xKey, ...AXIS, tickMargin: 8, ...tickOf(xTickFormatter) }),
|
|
235
|
-
/* @__PURE__ */ jsx(YAxis, { ...AXIS, width: 40, ...tickOf(yTickFormatter) }),
|
|
256
|
+
/* @__PURE__ */ jsx(YAxis, { ...AXIS, width: 40, ...tickOf(yTickFormatter), ...domainOf(valueMax) }),
|
|
236
257
|
tooltipOf(formatter),
|
|
237
258
|
legendOf(series, legend),
|
|
238
259
|
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { fins, ASSETS_PATH, poses, faces } from './chunk-CKRSQPTX.js';
|
|
2
1
|
import { cn } from './chunk-FAAGZG7A.js';
|
|
2
|
+
import { fins, ASSETS_PATH, poses, faces } from './chunk-CKRSQPTX.js';
|
|
3
3
|
import { naming, tagline } from './chunk-FGFNK72B.js';
|
|
4
|
-
import {
|
|
4
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
function Isotype({
|
|
7
7
|
background = "dark",
|
|
@@ -10,18 +10,24 @@ function Isotype({
|
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
12
|
}) {
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
+
const fin = (file, mode) => /* @__PURE__ */ jsx(
|
|
15
14
|
"img",
|
|
16
15
|
{
|
|
17
16
|
src: `${basePath}/${file}`,
|
|
18
17
|
alt,
|
|
19
18
|
width: 147,
|
|
20
19
|
height: 111,
|
|
21
|
-
className: cn("h-8 w-auto select-none", className),
|
|
20
|
+
className: cn("h-8 w-auto select-none", className, mode),
|
|
22
21
|
...props
|
|
23
22
|
}
|
|
24
23
|
);
|
|
24
|
+
if (background === "auto") {
|
|
25
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
+
fin(fins.foam, "light:hidden"),
|
|
27
|
+
fin(fins.color, "not-light:hidden")
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
return fin(background === "dark" ? fins.foam : fins.color);
|
|
25
31
|
}
|
|
26
32
|
function Logo({
|
|
27
33
|
background = "dark",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from './chunk-FAAGZG7A.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
var ICON_WEIGHT = "regular";
|
|
5
|
+
var TONE_WEIGHT = {
|
|
6
|
+
action: ICON_WEIGHT,
|
|
7
|
+
current: "fill",
|
|
8
|
+
quiet: "light"
|
|
9
|
+
};
|
|
10
|
+
function Icon({ as: Glyph, tone = "action", label, className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Glyph,
|
|
13
|
+
{
|
|
14
|
+
size: "1em",
|
|
15
|
+
weight: TONE_WEIGHT[tone],
|
|
16
|
+
"aria-hidden": label ? void 0 : true,
|
|
17
|
+
"aria-label": label,
|
|
18
|
+
role: label ? "img" : void 0,
|
|
19
|
+
focusable: "false",
|
|
20
|
+
className: cn("shrink-0", className),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { ICON_WEIGHT, Icon, TONE_WEIGHT };
|
package/dist/form/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { Text } from '../chunk-TRPBID2W.js';
|
|
|
4
4
|
import '../chunk-ODBFN44D.js';
|
|
5
5
|
import { cn } from '../chunk-FAAGZG7A.js';
|
|
6
6
|
import '../chunk-FGFNK72B.js';
|
|
7
|
-
import '../chunk-MLKGABMK.js';
|
|
8
7
|
import { createContext, useContext, useId } from 'react';
|
|
9
8
|
import { FormProvider, Controller, useFormContext, useFormState } from 'react-hook-form';
|
|
10
9
|
import { Slot } from '@radix-ui/react-slot';
|
package/dist/icons/index.d.cts
CHANGED
|
@@ -2,14 +2,20 @@ import * as react from 'react';
|
|
|
2
2
|
import { IconWeight, IconProps as IconProps$1, Icon as Icon$1 } from '@phosphor-icons/react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The system adopts `@phosphor-icons/react`, and
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The system adopts `@phosphor-icons/react`, and since 0.10.0 «adopts» means
|
|
6
|
+
* ALL of it: a required peer dependency, one place that fixes what a call site
|
|
7
|
+
* was getting wrong on its own, and no second set anywhere in the library.
|
|
8
|
+
*
|
|
9
|
+
* It was optional for three releases, and what made it required is that the
|
|
10
|
+
* library stopped keeping a set of its own to fall back on. That is the trade
|
|
11
|
+
* and it is worth naming: the two consumers that draw no icons of their own now
|
|
12
|
+
* install Phosphor anyway, because the `Alert` and the `Select` they DO draw are
|
|
13
|
+
* drawn with it.
|
|
8
14
|
*
|
|
9
15
|
* WHY IT IS HERE AT ALL. The position used to be that the system has no icons.
|
|
10
|
-
* That was right for what the library was — five reading sites, where
|
|
11
|
-
* `lib/glyphs.tsx`
|
|
12
|
-
* right when an admin panel arrived. Measured across the four consumers, the one
|
|
16
|
+
* That was right for what the library was — five reading sites, where a
|
|
17
|
+
* hand-drawn `lib/glyphs.tsx` covered everything a primitive needed — and it
|
|
18
|
+
* stopped being right when an admin panel arrived. Measured across the four consumers, the one
|
|
13
19
|
* admin app imports 89 distinct icons in 229 places and the other three import
|
|
14
20
|
* 9, 0 and 0. Seventy-seven of the 89 are domain icons for a course admin —
|
|
15
21
|
* `GraduationCap`, `TicketPercent`, `Webhook` — and no design system was ever
|
|
@@ -39,10 +45,13 @@ import { IconWeight, IconProps as IconProps$1, Icon as Icon$1 } from '@phosphor-
|
|
|
39
45
|
* because Phosphor's other three — `thin`, `bold`, `duotone` — say nothing this
|
|
40
46
|
* system means. See `TONE_WEIGHT` below and `docs/decisions/0.7.md` § 35.
|
|
41
47
|
*
|
|
42
|
-
*
|
|
43
|
-
* 1.75 on a 16 grid
|
|
44
|
-
* document and this
|
|
45
|
-
*
|
|
48
|
+
* IT IS NOW THE ONLY LINE THE LIBRARY DRAWS, which is what 0.10.0 changed.
|
|
49
|
+
* `lib/glyphs.tsx` drew at 1.75 on a 16 grid — 0.109em, three quarters heavier
|
|
50
|
+
* than both the document and this — and `./social` drew ten brand marks in a
|
|
51
|
+
* third hand. 0.7.0 left both alone because reconciling them restyles every
|
|
52
|
+
* primitive in the library; that is exactly what 0.10.0 did, and both files are
|
|
53
|
+
* gone. There is one description of what a line looks like here, and it is
|
|
54
|
+
* Phosphor's. See `docs/decisions/0.10.md` § 51.
|
|
46
55
|
*
|
|
47
56
|
* IN NEXT, IMPORT FROM `@phosphor-icons/react/ssr` inside a Server Component.
|
|
48
57
|
* Phosphor's default build reads `IconContext` through `useContext`, and a hook
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -2,14 +2,20 @@ import * as react from 'react';
|
|
|
2
2
|
import { IconWeight, IconProps as IconProps$1, Icon as Icon$1 } from '@phosphor-icons/react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The system adopts `@phosphor-icons/react`, and
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The system adopts `@phosphor-icons/react`, and since 0.10.0 «adopts» means
|
|
6
|
+
* ALL of it: a required peer dependency, one place that fixes what a call site
|
|
7
|
+
* was getting wrong on its own, and no second set anywhere in the library.
|
|
8
|
+
*
|
|
9
|
+
* It was optional for three releases, and what made it required is that the
|
|
10
|
+
* library stopped keeping a set of its own to fall back on. That is the trade
|
|
11
|
+
* and it is worth naming: the two consumers that draw no icons of their own now
|
|
12
|
+
* install Phosphor anyway, because the `Alert` and the `Select` they DO draw are
|
|
13
|
+
* drawn with it.
|
|
8
14
|
*
|
|
9
15
|
* WHY IT IS HERE AT ALL. The position used to be that the system has no icons.
|
|
10
|
-
* That was right for what the library was — five reading sites, where
|
|
11
|
-
* `lib/glyphs.tsx`
|
|
12
|
-
* right when an admin panel arrived. Measured across the four consumers, the one
|
|
16
|
+
* That was right for what the library was — five reading sites, where a
|
|
17
|
+
* hand-drawn `lib/glyphs.tsx` covered everything a primitive needed — and it
|
|
18
|
+
* stopped being right when an admin panel arrived. Measured across the four consumers, the one
|
|
13
19
|
* admin app imports 89 distinct icons in 229 places and the other three import
|
|
14
20
|
* 9, 0 and 0. Seventy-seven of the 89 are domain icons for a course admin —
|
|
15
21
|
* `GraduationCap`, `TicketPercent`, `Webhook` — and no design system was ever
|
|
@@ -39,10 +45,13 @@ import { IconWeight, IconProps as IconProps$1, Icon as Icon$1 } from '@phosphor-
|
|
|
39
45
|
* because Phosphor's other three — `thin`, `bold`, `duotone` — say nothing this
|
|
40
46
|
* system means. See `TONE_WEIGHT` below and `docs/decisions/0.7.md` § 35.
|
|
41
47
|
*
|
|
42
|
-
*
|
|
43
|
-
* 1.75 on a 16 grid
|
|
44
|
-
* document and this
|
|
45
|
-
*
|
|
48
|
+
* IT IS NOW THE ONLY LINE THE LIBRARY DRAWS, which is what 0.10.0 changed.
|
|
49
|
+
* `lib/glyphs.tsx` drew at 1.75 on a 16 grid — 0.109em, three quarters heavier
|
|
50
|
+
* than both the document and this — and `./social` drew ten brand marks in a
|
|
51
|
+
* third hand. 0.7.0 left both alone because reconciling them restyles every
|
|
52
|
+
* primitive in the library; that is exactly what 0.10.0 did, and both files are
|
|
53
|
+
* gone. There is one description of what a line looks like here, and it is
|
|
54
|
+
* Phosphor's. See `docs/decisions/0.10.md` § 51.
|
|
46
55
|
*
|
|
47
56
|
* IN NEXT, IMPORT FROM `@phosphor-icons/react/ssr` inside a Server Component.
|
|
48
57
|
* Phosphor's default build reads `IconContext` through `useContext`, and a hook
|
package/dist/icons/index.js
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export { ICON_WEIGHT, Icon, TONE_WEIGHT } from '../chunk-ZSCSKCTY.js';
|
|
2
|
+
import '../chunk-FAAGZG7A.js';
|
|
2
3
|
import '../chunk-FGFNK72B.js';
|
|
3
|
-
import '../chunk-MLKGABMK.js';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var ICON_WEIGHT = "regular";
|
|
7
|
-
var TONE_WEIGHT = {
|
|
8
|
-
action: ICON_WEIGHT,
|
|
9
|
-
current: "fill",
|
|
10
|
-
quiet: "light"
|
|
11
|
-
};
|
|
12
|
-
function Icon({ as: Glyph, tone = "action", label, className, ...props }) {
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
Glyph,
|
|
15
|
-
{
|
|
16
|
-
size: "1em",
|
|
17
|
-
weight: TONE_WEIGHT[tone],
|
|
18
|
-
"aria-hidden": label ? void 0 : true,
|
|
19
|
-
"aria-label": label,
|
|
20
|
-
role: label ? "img" : void 0,
|
|
21
|
-
focusable: "false",
|
|
22
|
-
className: cn("shrink-0", className),
|
|
23
|
-
...props
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { ICON_WEIGHT, Icon, TONE_WEIGHT };
|