@eduardoalvarez/arrecife 0.8.0 → 0.10.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.
@@ -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';
@@ -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 this is the whole of what
6
- * «adopts» means: an optional peer dependency, and one place that fixes what a
7
- * call site was getting wrong on its own.
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` covers everything a primitive needs — and it stopped being
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
- * `lib/glyphs.tsx` is the outlier and it is NOT reconciled here: it draws at
43
- * 1.75 on a 16 grid, which is 0.109em — three quarters heavier than both the
44
- * document and this. Aligning it restyles every primitive in the library and is
45
- * its own change. See `docs/decisions/0.7.md` § 29.
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
@@ -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 this is the whole of what
6
- * «adopts» means: an optional peer dependency, and one place that fixes what a
7
- * call site was getting wrong on its own.
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` covers everything a primitive needs — and it stopped being
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
- * `lib/glyphs.tsx` is the outlier and it is NOT reconciled here: it draws at
43
- * 1.75 on a 16 grid, which is 0.109em — three quarters heavier than both the
44
- * document and this. Aligning it restyles every primitive in the library and is
45
- * its own change. See `docs/decisions/0.7.md` § 29.
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
@@ -1,28 +1,3 @@
1
- import { cn } from '../chunk-FAAGZG7A.js';
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 };