@eduardoalvarez/arrecife 0.11.0 → 0.12.1
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 +33 -0
- package/README.md +34 -14
- package/dist/brand/index.cjs +2 -2
- package/dist/brand/index.d.cts +1 -1
- package/dist/brand/index.d.ts +1 -1
- package/dist/brand/index.js +3 -3
- package/dist/chart/index.cjs +2 -2
- package/dist/chart/index.d.cts +3 -3
- package/dist/chart/index.d.ts +3 -3
- package/dist/chart/index.js +3 -3
- package/dist/{chunk-FGFNK72B.js → chunk-5YWGOFDX.js} +17 -4
- package/dist/{chunk-5A5GH2PF.js → chunk-6QJQ6K7J.js} +1 -1
- package/dist/{chunk-TRPBID2W.js → chunk-BFYNBIVJ.js} +1 -1
- package/dist/{chunk-RKGKO2TW.js → chunk-BRDTB44R.js} +2 -2
- package/dist/{chunk-XXDATT3A.js → chunk-FF33ARRA.js} +1 -1
- package/dist/{chunk-FAAGZG7A.js → chunk-TMUGT3Y3.js} +1 -1
- package/dist/{chunk-6IGD5REB.js → chunk-W75O3Z77.js} +1 -1
- package/dist/{chunk-ZSCSKCTY.js → chunk-WU66TPJT.js} +1 -1
- package/dist/form/index.cjs +2 -2
- 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 +3 -3
- package/dist/index.cjs +86 -18
- package/dist/index.d.cts +31 -16
- package/dist/index.d.ts +31 -16
- package/dist/index.js +83 -28
- package/dist/og/index.cjs +1 -2
- package/dist/og/index.js +1 -1
- package/dist/shiki/index.js +1 -1
- package/dist/tokens/index.cjs +17 -4
- package/dist/tokens/index.d.cts +20 -5
- package/dist/tokens/index.d.ts +20 -5
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/theme.css +20 -3
- 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 +39 -13
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -72,6 +72,15 @@ project declares `@source`, include the package:
|
|
|
72
72
|
@source "../node_modules/@eduardoalvarez/arrecife/dist";
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
**Every token is in `:root`, and you may read it with `var()`.** The block is
|
|
76
|
+
`@theme static`, so a token is emitted whether or not a utility asks for it:
|
|
77
|
+
`style={{ fill: 'var(--color-series-1)' }}` or `var(--radius-card)` from your own
|
|
78
|
+
JavaScript resolves. Do not write a fallback hexadecimal next to it — that is a
|
|
79
|
+
second copy of a value this package exists to keep in one place. Before that fix
|
|
80
|
+
Tailwind dropped the four `--color-series-*` as unused, because they are read by
|
|
81
|
+
`var()` and requested by no class, and the charts drew black. See
|
|
82
|
+
`decisions/` § 61.
|
|
83
|
+
|
|
75
84
|
### Light mode and dark mode
|
|
76
85
|
|
|
77
86
|
**Dark mode is primary and it is the default.** A dark project declares nothing.
|
|
@@ -263,7 +272,7 @@ does nothing.
|
|
|
263
272
|
|
|
264
273
|
**One `Nav` per page.** It renders the site's `banner` landmark, and two banners
|
|
265
274
|
on one page is an accessibility failure — which is also why `PageHeader` goes
|
|
266
|
-
inside `<main>` and is not a landmark. See `decisions
|
|
275
|
+
inside `<main>` and is not a landmark. See `decisions/` § 30.
|
|
267
276
|
|
|
268
277
|
### Icons are yours, the way they are drawn is not
|
|
269
278
|
|
|
@@ -332,7 +341,7 @@ a Server Component throws. It ships no `"use client"` to stop you, so the failur
|
|
|
332
341
|
arrives at render rather than at build. The `/ssr` entry is the same icons
|
|
333
342
|
without the context read, and `Icon` works with either.
|
|
334
343
|
|
|
335
|
-
See `decisions
|
|
344
|
+
See `decisions/` § 29 and § 35.
|
|
336
345
|
|
|
337
346
|
### `Stat`'s delta says direction, not judgement
|
|
338
347
|
|
|
@@ -349,7 +358,7 @@ errores» point the same way and mean opposite things, so whether a number is go
|
|
|
349
358
|
news is `tone`'s job and yours: `neutral` for a datum, `alert` when the number IS
|
|
350
359
|
the problem, `achievement` when it is the reward. `alert` and `achievement` paint
|
|
351
360
|
the same sand on purpose — the API is the meaning, the colour is the
|
|
352
|
-
implementation. See `decisions
|
|
361
|
+
implementation. See `decisions/` § 28.
|
|
353
362
|
|
|
354
363
|
`delta.value` arrives already formatted, like `value`: the library imposes no
|
|
355
364
|
locale and computes no percentage. `spark` is a `ReactNode` and the library ships
|
|
@@ -359,7 +368,7 @@ no sparkline — pass your own, exactly like `icon`.
|
|
|
359
368
|
and biolume goes on the icon badge and the sparkline instead: three accents in
|
|
360
369
|
one card and the figure stops being the loudest thing in it. `alert` and
|
|
361
370
|
`achievement` DO paint the number sand, which is how «this number is not just a
|
|
362
|
-
number» is said. See `decisions
|
|
371
|
+
number» is said. See `decisions/` § 31.
|
|
363
372
|
|
|
364
373
|
**`icon` is a badge in the corner opposite the title**, in a circle tinted at
|
|
365
374
|
10 % of the tone. You pass the glyph; the circle, the tint and the size are the
|
|
@@ -433,6 +442,13 @@ it is `aria-hidden`. The column titles render as `<h3>`. Pass `linkAsChild` to
|
|
|
433
442
|
plug in the router's `Link`; without it the columns are plain `<a>` and every
|
|
434
443
|
navigation costs a page load.
|
|
435
444
|
|
|
445
|
+
**`builtWith` adds «Creado con Arrecife ♥» under the signature**, linking to the
|
|
446
|
+
library's Storybook. It works on both shapes and it is OFF by default:
|
|
447
|
+
the credit is the site's to give, so the library does not put it in a footer
|
|
448
|
+
that did not ask. Do not hand-write that line instead — the heart is Phosphor's
|
|
449
|
+
filled `Heart` and never the emoji, and the URL is checked against the package's
|
|
450
|
+
`homepage` on every build. See `decisions/` § 62.
|
|
451
|
+
|
|
436
452
|
### `Table` brings its own surface
|
|
437
453
|
|
|
438
454
|
```tsx
|
|
@@ -485,7 +501,7 @@ largest datum, and on a horizontal ranking — whose value axis is hidden — a
|
|
|
485
501
|
course watched to 40 % draws as a full bar when it is the highest on the list.
|
|
486
502
|
The bottom is always zero, and it is a floor rather than a clip: a datum above
|
|
487
503
|
`valueMax` widens the axis instead of running off the edge. It is on all three
|
|
488
|
-
types. See `decisions
|
|
504
|
+
types. See `decisions/` § 58.
|
|
489
505
|
|
|
490
506
|
`stacked` on `AreaChart` and `BarChart` adds the series up. Without it areas
|
|
491
507
|
overlap, which is honest and rarely what you want with more than one series: to
|
|
@@ -494,6 +510,13 @@ COMPARE rather than add up, the type is `LineChart`.
|
|
|
494
510
|
Anything that is not a series over a category axis has no type and is not missing
|
|
495
511
|
one. A doughnut is `ChartContainer` plus Recharts' `Pie` with `SERIES_COLORS`.
|
|
496
512
|
|
|
513
|
+
**The series palette comes from `seriesColor(i)` and `SERIES_COLORS`, and both
|
|
514
|
+
return `var(--color-series-N)`** rather than a hexadecimal, so the colors follow
|
|
515
|
+
the mode instead of freezing to the one that was live when the chart mounted. You
|
|
516
|
+
do not need `data-theme` on `<html>` for that to resolve, and you do not need a
|
|
517
|
+
fallback: the tokens are in `:root` on every page. Pass `color` per series only
|
|
518
|
+
to override the palette on purpose — a semantic red for a failure count, say.
|
|
519
|
+
|
|
497
520
|
### The social icons are yours, and they come from Phosphor
|
|
498
521
|
|
|
499
522
|
Until 0.10.0 the library shipped ten of them at `./social` — `GitHub`,
|
|
@@ -585,7 +608,7 @@ compiles and looks wrong, or that fails the project's accessibility audit.
|
|
|
585
608
|
3. **`Button variant="destructive"` is for the irreversible only.** Never for
|
|
586
609
|
«cancel» on a form, and not inside an `AlertDialog` — there the confirm button
|
|
587
610
|
stays `primary`, because the title, the focus on cancel and the no-click-outside
|
|
588
|
-
already carry the weight. See `decisions
|
|
611
|
+
already carry the weight. See `decisions/` § 21.
|
|
589
612
|
4. **`secondary` is never filled.** It is border and text.
|
|
590
613
|
5. **No entrance animations.** Modals, menus, tooltips and toasts appear where
|
|
591
614
|
they will stay. There are five declared exceptions, all behind `motion-safe`
|
|
@@ -600,7 +623,7 @@ compiles and looks wrong, or that fails the project's accessibility audit.
|
|
|
600
623
|
`PageHeader` makes the same split: `as` is the level and `titleVariant` the
|
|
601
624
|
scale. An admin panel's title is `<PageHeader title="Ventas"
|
|
602
625
|
titleVariant="h3" />` — still the page's only `h1`, at 25px instead of 44. See
|
|
603
|
-
`decisions
|
|
626
|
+
`decisions/` § 57.
|
|
604
627
|
7. **`textMuted` never goes over `surfaceRaised`**: it gives 4.07 in dark. Over a
|
|
605
628
|
raised surface — menus, active tabs — the token is `textSecondary`.
|
|
606
629
|
8. **A background tinted with a semantic color carries text from a text token**,
|
|
@@ -618,14 +641,14 @@ compiles and looks wrong, or that fails the project's accessibility audit.
|
|
|
618
641
|
hole inside a table page or a dashboard widget, and it carries no face — the
|
|
619
642
|
type does not accept one. `page`, the default, is the one that IS the screen,
|
|
620
643
|
and there `expression` stays mandatory. A dozen mascots on one admin screen is
|
|
621
|
-
not the humour contract. See `decisions
|
|
644
|
+
not the humour contract. See `decisions/` § 27.
|
|
622
645
|
12. **The fin is not a free parameter**: `foam` on a dark background, `color` on a
|
|
623
646
|
light one. The components already choose it from the background.
|
|
624
647
|
**On a site that switches theme, pass `background="auto"`** to `Isotype` or
|
|
625
648
|
`Logo`: both fins are rendered and the `light:` variant shows the one that
|
|
626
649
|
reads, so no call site has to know the theme. A surface that keeps one mode
|
|
627
650
|
whatever the page does — a dark panel on a light page — is a fixed
|
|
628
|
-
background, and it still says `dark`. See `decisions
|
|
651
|
+
background, and it still says `dark`. See `decisions/` § 60.
|
|
629
652
|
|
|
630
653
|
## What the library does NOT do, on purpose
|
|
631
654
|
|
|
@@ -646,7 +669,7 @@ These are the confusions people run into most often when consuming it.
|
|
|
646
669
|
already names the card — and `footer`, the closing row where a project puts the
|
|
647
670
|
rating and the price. Both are nodes the project draws; the card keeps the
|
|
648
671
|
title, its hover and the sand progress bar. The title does not go over the
|
|
649
|
-
cover. See `decisions
|
|
672
|
+
cover. See `decisions/` § 59.
|
|
650
673
|
- **It ships no `data-testid`.** A composed part your test suite has to reach is
|
|
651
674
|
reached with a slot: `ArticleCard`'s `tagAsChild`, `Breadcrumb`'s and
|
|
652
675
|
`TableOfContents`'s `linkAsChild`. They hand you the element and its
|
|
@@ -1470,6 +1493,7 @@ Source: `src/components/footer/index.tsx`
|
|
|
1470
1493
|
| --- | --- | --- | --- | --- |
|
|
1471
1494
|
| `action` | `ReactNode` | | | An action under the row of icons — «Reportar un problema». Usually a tertiary button. |
|
|
1472
1495
|
| `brand` | `ReactNode` | | | The brand row: the fin and the wordmark, at the very top. |
|
|
1496
|
+
| `builtWith` | `boolean \| undefined` | | | Adds «Creado con Arrecife ♥», linking to the library's Storybook. |
|
|
1473
1497
|
| `columns` | `readonly FooterColumn[]` | | | The link columns. Mandatory: without them `full` is the default form with extra steps. |
|
|
1474
1498
|
| `description` | `ReactNode` | | | One line under the brand, saying what the site is. |
|
|
1475
1499
|
| `domain` | `string` | | | The domain the signature prints, defaulting to the identity's own. |
|
|
@@ -1615,7 +1639,7 @@ A large metric: the number in the `stat` scale and its name underneath.
|
|
|
1615
1639
|
| `label` | `ReactNode` | yes | | What is being counted. It goes in mono small caps. |
|
|
1616
1640
|
| `progress` | `number` | | | With `progress`, the metric reads as progress and adds the bar. |
|
|
1617
1641
|
| `spark` | `ReactNode` | | | The number's shape over time, under it. A `ReactNode` and not a data prop: a sparkline needs a charting library, and this component lives in the barrel that four projects install. The one project that draws them passes its own, exactly like `icon`. |
|
|
1618
|
-
| `tone` | `"neutral" \| "alert" \| "achievement"` | | `neutral` | `alert` ONLY when the number is the problem, and `achievement` when it is the opposite — the diplomas issued, the modules finished. The two paint the same sand today and they are still two names: a system that names by meaning cannot make «this is bad» the only way to say «this stands out». See `docs/decisions
|
|
1642
|
+
| `tone` | `"neutral" \| "alert" \| "achievement"` | | `neutral` | `alert` ONLY when the number is the problem, and `achievement` when it is the opposite — the diplomas issued, the modules finished. The two paint the same sand today and they are still two names: a system that names by meaning cannot make «this is bad» the only way to say «this stands out». See `docs/decisions/` § 28. |
|
|
1619
1643
|
| `value` | `ReactNode` | yes | | The number, already formatted. The library imposes no locale. |
|
|
1620
1644
|
|
|
1621
1645
|
### TalkCard
|
|
@@ -1927,7 +1951,7 @@ it: if the code does not mount React, that subpath is the one to import.
|
|
|
1927
1951
|
| `light` | `{ background, surface, surfaceRaised, border, hairline, hairlineHover, textPrimary, textSecondary, textMuted, accent, accentHover, accentOn, warm, warmHover, warmOn, success, warning, error, danger, dangerHover, dangerOn }` | Light mode. Contrast measured against `background` #F6F2EA. `background` is WARM white: never #FFF as the page background. |
|
|
1928
1952
|
| `limits` | `{ readonly minScreenPx: 13; readonly minPrintPt: 12; readonly measure: "68ch"; }` | Hard legibility limits. |
|
|
1929
1953
|
| `motion` | `{ readonly duration: "150ms"; readonly easing: "ease-out"; readonly properties: "color, background-color, border-color, fill, stroke"; }` | 150ms ease-out — color and border only. The system animates neither position nor scale: states are communicated with border and color, not with movement. |
|
|
1930
|
-
| `naming` | `{
|
|
1954
|
+
| `naming` | `{ wordmark, mascot, domain, library, libraryUrl }` | The wordmark always reads «Eduardo Álvarez». The mascot is called Tiburoncín and its name never appears inside the logo. |
|
|
1931
1955
|
| `radius` | `{ readonly chip: 6; readonly control: 10; readonly card: 14; readonly panel: 16; readonly pill: 999; }` | |
|
|
1932
1956
|
| `series` | `{ readonly dark: readonly ["#35D6C0", "#F2A65A", "#3E7CB1", "#71919C"]; readonly light: readonly ["#0D7C6F", "#A65B27", "#3E7CB1", "#626A75"]; }` | The chart series palette. FOUR, for the same reason as the syntax palette: the system communicates with color and border, not with chromatic noise. |
|
|
1933
1957
|
| `shadow` | `{ readonly standard: "0 1px 2px rgba(0, 0, 0, 0.35)"; }` | A single level. There is no elevation scale. |
|
|
@@ -2035,5 +2059,7 @@ Types (60): `AccordionProps`, `AccordionTriggerProps`, `AlertProps`, `ArticleCar
|
|
|
2035
2059
|
- `architecture/design-system.md` and `architecture/brand-manual.md`: the identity documents,
|
|
2036
2060
|
greppable.
|
|
2037
2061
|
- `decisions/`: the points where the code and the document did not say the
|
|
2038
|
-
same thing, each with its resolution.
|
|
2062
|
+
same thing, each with its resolution. One file per decision, named for its
|
|
2063
|
+
number, so «§ 45» is `decisions/045-*.md` — which is how every `§ N` in this
|
|
2064
|
+
file resolves.
|
|
2039
2065
|
- `AGENTS.md`: for working inside the library's repo.
|
package/package.json
CHANGED