@editio-ui/react 0.0.0-stage → 0.1.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.
Files changed (44) hide show
  1. package/dist/components/button/button.d.ts +17 -0
  2. package/dist/components/button/button.js +11 -0
  3. package/dist/components/button/index.d.ts +2 -0
  4. package/dist/components/checkbox/checkbox.d.ts +23 -0
  5. package/dist/components/checkbox/checkbox.js +19 -0
  6. package/dist/components/checkbox/index.d.ts +2 -0
  7. package/dist/components/input/index.d.ts +2 -0
  8. package/dist/components/input/input.d.ts +15 -0
  9. package/dist/components/input/input.js +14 -0
  10. package/dist/components/objects/index.d.ts +18 -0
  11. package/dist/components/objects/index.js +220 -0
  12. package/dist/components/radio-group/index.d.ts +2 -0
  13. package/dist/components/radio-group/radio-group.d.ts +31 -0
  14. package/dist/components/radio-group/radio-group.js +47 -0
  15. package/dist/components/separator/index.d.ts +2 -0
  16. package/dist/components/separator/separator.d.ts +18 -0
  17. package/dist/components/separator/separator.js +13 -0
  18. package/dist/components/studies/index.d.ts +25 -0
  19. package/dist/components/studies/index.js +140 -0
  20. package/dist/components/switch/index.d.ts +2 -0
  21. package/dist/components/switch/switch.d.ts +7 -0
  22. package/dist/components/switch/switch.js +12 -0
  23. package/dist/components/textarea/index.d.ts +2 -0
  24. package/dist/components/textarea/textarea.d.ts +15 -0
  25. package/dist/components/textarea/textarea.js +14 -0
  26. package/dist/editorial/backgrounds.css +203 -0
  27. package/dist/editorial/buttons.css +223 -0
  28. package/dist/editorial/choices.css +374 -0
  29. package/dist/editorial/disclosure.css +365 -0
  30. package/dist/editorial/feedback.css +278 -0
  31. package/dist/editorial/fields.css +221 -0
  32. package/dist/editorial/motion.css +188 -0
  33. package/dist/editorial/objects.css +1 -0
  34. package/dist/editorial/redesign.css +132 -0
  35. package/dist/editorial/showcase.css +401 -0
  36. package/dist/editorial/studies.css +10 -0
  37. package/dist/editorial/tokens.css +129 -0
  38. package/dist/editorial/type.css +387 -0
  39. package/dist/editorial-fonts.css +4 -0
  40. package/dist/editorial.css +2926 -0
  41. package/dist/index.d.ts +17 -0
  42. package/dist/index.js +10 -0
  43. package/package.json +71 -3
  44. package/README.md +0 -3
@@ -0,0 +1,17 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ /**
3
+ * Props for {@link Button}: every native `<button>` attribute and event
4
+ * handler (`disabled`, `onClick`, `aria-*`, `data-*`, `className`, `style`...).
5
+ * Editio adds no props of its own, so the type is the native one.
6
+ */
7
+ export type ButtonProps = ComponentPropsWithoutRef<"button">;
8
+ /**
9
+ * A native `<button>` with no imposed styling.
10
+ *
11
+ * Keyboard behavior (Enter and Space activate it, Tab focuses it) and
12
+ * disabled behavior come from the browser, not from Editio code.
13
+ *
14
+ * `type` defaults to `"button"` so a Button inside a `<form>` does not submit
15
+ * it by accident. Pass `type="submit"` to opt in.
16
+ */
17
+ export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,11 @@
1
+ import { forwardRef as e } from "react";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ // src/components/button/button.tsx
4
+ var n = e(function({ type: e = "button", ...n }, r) {
5
+ return /* @__PURE__ */ t("button", {
6
+ ref: r,
7
+ type: e,
8
+ ...n
9
+ });
10
+ });
11
+ export { n as Button };
@@ -0,0 +1,2 @@
1
+ export { Button } from "./button.js";
2
+ export type { ButtonProps } from "./button.js";
@@ -0,0 +1,23 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export type CheckboxProps = Omit<ComponentPropsWithoutRef<"input">, "type"> & {
3
+ /** Called with the new checked state. Use with `checked` for controlled mode. */
4
+ onCheckedChange?: (checked: boolean) => void;
5
+ /** Shows the mixed state. Purely visual and announced; it does not change `checked`. */
6
+ indeterminate?: boolean;
7
+ };
8
+ /**
9
+ * A native `<input type="checkbox">`.
10
+ *
11
+ * Because it is the real element, keyboard behavior (Space toggles), form
12
+ * submission and label association all work without extra code. Style it with
13
+ * `appearance: none` plus `:checked` and `:indeterminate`.
14
+ *
15
+ * Controlled: pass `checked` and `onCheckedChange`.
16
+ * Uncontrolled: pass `defaultChecked` (or nothing).
17
+ */
18
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type"> & {
19
+ /** Called with the new checked state. Use with `checked` for controlled mode. */
20
+ onCheckedChange?: (checked: boolean) => void;
21
+ /** Shows the mixed state. Purely visual and announced; it does not change `checked`. */
22
+ indeterminate?: boolean;
23
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,19 @@
1
+ import { forwardRef as e, useEffect as t, useImperativeHandle as n, useRef as r } from "react";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ // src/components/checkbox/checkbox.tsx
4
+ var a = e(function({ onCheckedChange: e, onChange: a, indeterminate: o = !1, ...s }, c) {
5
+ let l = r(null);
6
+ n(c, () => l.current), t(() => {
7
+ l.current && (l.current.indeterminate = o);
8
+ }, [o, s.checked]);
9
+ function u(t) {
10
+ a?.(t), e?.(t.target.checked);
11
+ }
12
+ return /* @__PURE__ */ i("input", {
13
+ ...s,
14
+ ref: l,
15
+ type: "checkbox",
16
+ onChange: u
17
+ });
18
+ });
19
+ export { a as Checkbox };
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from "./checkbox.js";
2
+ export type { CheckboxProps } from "./checkbox.js";
@@ -0,0 +1,2 @@
1
+ export { Input } from "./input.js";
2
+ export type { InputProps } from "./input.js";
@@ -0,0 +1,15 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export type InputProps = ComponentPropsWithoutRef<"input"> & {
3
+ /** Called with the new text. Use with `value` for controlled mode. */
4
+ onValueChange?: (value: string) => void;
5
+ };
6
+ /**
7
+ * A native `<input>`. Pass `type` ("email", "password", "search"...) as usual.
8
+ *
9
+ * Controlled: pass `value` and `onValueChange`.
10
+ * Uncontrolled: pass `defaultValue` (or nothing).
11
+ */
12
+ export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
13
+ /** Called with the new text. Use with `value` for controlled mode. */
14
+ onValueChange?: (value: string) => void;
15
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,14 @@
1
+ import { forwardRef as e } from "react";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ // src/components/input/input.tsx
4
+ var n = e(function({ onValueChange: e, onChange: n, ...r }, i) {
5
+ function a(t) {
6
+ n?.(t), e?.(t.target.value);
7
+ }
8
+ return /* @__PURE__ */ t("input", {
9
+ ...r,
10
+ ref: i,
11
+ onChange: a
12
+ });
13
+ });
14
+ export { n as Input };
@@ -0,0 +1,18 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare function BookObject({ title, subtitle, children }: {
3
+ title?: string;
4
+ subtitle?: string;
5
+ children?: ReactNode;
6
+ }): import("react").JSX.Element;
7
+ export declare function ColorDeck({ colors, names }: {
8
+ colors?: string[];
9
+ names?: string[];
10
+ }): import("react").JSX.Element;
11
+ export declare function RecordSleeve({ title, artist, tracks }: {
12
+ title?: string;
13
+ artist?: string;
14
+ tracks?: string[];
15
+ }): import("react").JSX.Element;
16
+ export declare function PrintRegister({ text }: {
17
+ text?: string;
18
+ }): import("react").JSX.Element;
@@ -0,0 +1,220 @@
1
+ import { useState as e } from "react";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ // src/components/objects/index.tsx
4
+ function r({ title: r = "The shape of things", subtitle: i = "A collection of observations", children: a = "Objects carry the traces of the people who use them." }) {
5
+ let [o, s] = e(!1);
6
+ return /* @__PURE__ */ n("section", {
7
+ className: "eo-book",
8
+ children: [/* @__PURE__ */ t("div", {
9
+ className: "eo-book-stage",
10
+ children: /* @__PURE__ */ n("div", {
11
+ className: "eo-book-volume",
12
+ "data-open": o,
13
+ children: [/* @__PURE__ */ n("div", {
14
+ className: "eo-book-page",
15
+ children: [/* @__PURE__ */ t("small", { children: "01 / PREFACE" }), /* @__PURE__ */ t("p", { children: a })]
16
+ }), /* @__PURE__ */ n("div", {
17
+ className: "eo-book-cover",
18
+ children: [
19
+ /* @__PURE__ */ t("small", { children: "FIELD EDITIONS / 01" }),
20
+ /* @__PURE__ */ t("strong", { children: r }),
21
+ /* @__PURE__ */ t("i", { children: i }),
22
+ /* @__PURE__ */ t("span", {
23
+ "aria-hidden": "true",
24
+ children: "◒"
25
+ })
26
+ ]
27
+ })]
28
+ })
29
+ }), /* @__PURE__ */ n("button", {
30
+ className: "eo-action",
31
+ type: "button",
32
+ "aria-expanded": o,
33
+ onClick: () => s(!o),
34
+ children: [
35
+ o ? "Close volume" : "Open volume",
36
+ " ",
37
+ /* @__PURE__ */ t("span", {
38
+ "aria-hidden": "true",
39
+ children: o ? "−" : "↗"
40
+ })
41
+ ]
42
+ })]
43
+ });
44
+ }
45
+ function i({ colors: r = [
46
+ "#b64b32",
47
+ "#e5b85c",
48
+ "#536c59",
49
+ "#344c75",
50
+ "#e8dfc9"
51
+ ], names: i = [
52
+ "Brick",
53
+ "Ochre",
54
+ "Moss",
55
+ "Ultramarine",
56
+ "Linen"
57
+ ] }) {
58
+ let [a, o] = e(0), [s, c] = e(!0);
59
+ return /* @__PURE__ */ n("section", {
60
+ className: "eo-deck",
61
+ children: [
62
+ /* @__PURE__ */ t("div", {
63
+ className: "eo-deck-stage",
64
+ children: r.map((e, n) => /* @__PURE__ */ t("button", {
65
+ type: "button",
66
+ "aria-label": i[n] || e,
67
+ "aria-pressed": a === n,
68
+ onClick: () => {
69
+ o(n), c(!0);
70
+ },
71
+ className: "eo-swatch",
72
+ style: {
73
+ background: e,
74
+ transform: `rotate(${s ? (n - (r.length - 1) / 2) * Math.min(17, 85 / Math.max(1, r.length - 1)) : 0}deg) translateY(${a === n ? -14 : 0}px)`,
75
+ zIndex: a === n ? r.length + 1 : n
76
+ },
77
+ children: /* @__PURE__ */ t("span", { children: String(n + 1).padStart(2, "0") })
78
+ }, n))
79
+ }),
80
+ /* @__PURE__ */ n("div", {
81
+ className: "eo-deck-label",
82
+ "aria-live": "polite",
83
+ children: [/* @__PURE__ */ t("strong", { children: i[a] || r[a] }), /* @__PURE__ */ t("code", { children: r[a] })]
84
+ }),
85
+ /* @__PURE__ */ t("div", {
86
+ className: "eo-palette",
87
+ children: r.map((e, n) => /* @__PURE__ */ t("button", {
88
+ type: "button",
89
+ "aria-label": i[n] || e,
90
+ "aria-pressed": a === n,
91
+ style: { background: e },
92
+ onClick: () => o(n)
93
+ }, n))
94
+ }),
95
+ /* @__PURE__ */ t("button", {
96
+ className: "eo-action",
97
+ type: "button",
98
+ "aria-expanded": s,
99
+ onClick: () => c(!s),
100
+ children: s ? "Close swatch deck" : "Fan out swatches"
101
+ })
102
+ ]
103
+ });
104
+ }
105
+ function a({ title: r = "After hours", artist: i = "Studio sessions", tracks: a = [
106
+ "Blue room",
107
+ "Intervals",
108
+ "Last light"
109
+ ] }) {
110
+ let [o, s] = e(!1), [c, l] = e(0);
111
+ return /* @__PURE__ */ n("section", {
112
+ className: "eo-record",
113
+ children: [
114
+ /* @__PURE__ */ n("div", {
115
+ className: "eo-record-stage",
116
+ "data-out": o,
117
+ children: [/* @__PURE__ */ t("div", {
118
+ className: "eo-disc",
119
+ "aria-hidden": "true",
120
+ children: /* @__PURE__ */ t("div", { children: String(c + 1).padStart(2, "0") })
121
+ }), /* @__PURE__ */ n("div", {
122
+ className: "eo-sleeve",
123
+ children: [
124
+ /* @__PURE__ */ t("small", { children: "STEREO / 33⅓" }),
125
+ /* @__PURE__ */ t("strong", { children: r }),
126
+ /* @__PURE__ */ t("div", { className: "eo-sleeve-art" }),
127
+ /* @__PURE__ */ t("i", { children: i })
128
+ ]
129
+ })]
130
+ }),
131
+ /* @__PURE__ */ n("button", {
132
+ type: "button",
133
+ className: "eo-action",
134
+ "aria-expanded": o,
135
+ onClick: () => s(!o),
136
+ children: [o ? "Return record" : "Inspect record", " ↗"]
137
+ }),
138
+ /* @__PURE__ */ t("div", {
139
+ className: "eo-tracks",
140
+ children: a.map((e, r) => /* @__PURE__ */ n("button", {
141
+ type: "button",
142
+ "aria-pressed": c === r,
143
+ onClick: () => {
144
+ l(r), s(!0);
145
+ },
146
+ children: [
147
+ /* @__PURE__ */ n("small", { children: ["0", r + 1] }),
148
+ e,
149
+ /* @__PURE__ */ t("span", { children: c === r ? "●" : "○" })
150
+ ]
151
+ }, r))
152
+ })
153
+ ]
154
+ });
155
+ }
156
+ function o({ text: r = "FORM" }) {
157
+ let [i, a] = e(8), [o, s] = e(-3);
158
+ return /* @__PURE__ */ n("section", {
159
+ className: "eo-print",
160
+ children: [
161
+ /* @__PURE__ */ n("div", {
162
+ className: "eo-print-sheet",
163
+ children: [
164
+ /* @__PURE__ */ t("small", { children: "OVERPRINT / TEST 04" }),
165
+ /* @__PURE__ */ n("div", {
166
+ className: "eo-print-type",
167
+ "aria-label": r,
168
+ children: [/* @__PURE__ */ t("span", {
169
+ "aria-hidden": "true",
170
+ children: r
171
+ }), /* @__PURE__ */ t("span", {
172
+ "aria-hidden": "true",
173
+ style: { transform: `translate(${i}px,${i / 2}px) rotate(${o}deg)` },
174
+ children: r
175
+ })]
176
+ }),
177
+ /* @__PURE__ */ n("div", {
178
+ className: "eo-print-marks",
179
+ children: [
180
+ "+ ",
181
+ /* @__PURE__ */ t("span", { children: "CYAN / VERMILION" }),
182
+ " +"
183
+ ]
184
+ })
185
+ ]
186
+ }),
187
+ /* @__PURE__ */ n("label", { children: [
188
+ "Registration ",
189
+ /* @__PURE__ */ n("output", { children: [i, " px"] }),
190
+ /* @__PURE__ */ t("input", {
191
+ type: "range",
192
+ min: "-24",
193
+ max: "24",
194
+ value: i,
195
+ onChange: (e) => a(+e.target.value)
196
+ })
197
+ ] }),
198
+ /* @__PURE__ */ n("label", { children: [
199
+ "Rotation ",
200
+ /* @__PURE__ */ n("output", { children: [o, "°"] }),
201
+ /* @__PURE__ */ t("input", {
202
+ type: "range",
203
+ min: "-12",
204
+ max: "12",
205
+ value: o,
206
+ onChange: (e) => s(+e.target.value)
207
+ })
208
+ ] }),
209
+ /* @__PURE__ */ t("button", {
210
+ className: "eo-action",
211
+ type: "button",
212
+ onClick: () => {
213
+ a(0), s(0);
214
+ },
215
+ children: "Align plates +"
216
+ })
217
+ ]
218
+ });
219
+ }
220
+ export { r as BookObject, i as ColorDeck, o as PrintRegister, a as RecordSleeve };
@@ -0,0 +1,2 @@
1
+ export { RadioGroup } from "./radio-group.js";
2
+ export type { RadioGroupRootProps, RadioGroupItemProps } from "./radio-group.js";
@@ -0,0 +1,31 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export type RadioGroupRootProps = Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange" | "role"> & {
3
+ /** Selected value. Use with `onValueChange` for controlled mode. */
4
+ value?: string;
5
+ /** Initially selected value for uncontrolled mode. */
6
+ defaultValue?: string;
7
+ onValueChange?: (value: string) => void;
8
+ disabled?: boolean;
9
+ required?: boolean;
10
+ /** Form field name. A unique one is generated if you omit it. */
11
+ name?: string;
12
+ };
13
+ export type RadioGroupItemProps = Omit<ComponentPropsWithoutRef<"input">, "type" | "checked" | "defaultChecked" | "name" | "value" | "onChange"> & {
14
+ value: string;
15
+ };
16
+ export declare const RadioGroup: {
17
+ readonly Root: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onChange" | "role"> & {
18
+ /** Selected value. Use with `onValueChange` for controlled mode. */
19
+ value?: string;
20
+ /** Initially selected value for uncontrolled mode. */
21
+ defaultValue?: string;
22
+ onValueChange?: (value: string) => void;
23
+ disabled?: boolean;
24
+ required?: boolean;
25
+ /** Form field name. A unique one is generated if you omit it. */
26
+ name?: string;
27
+ } & import("react").RefAttributes<HTMLDivElement>>;
28
+ readonly Item: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "checked" | "defaultChecked" | "name" | "onChange" | "type" | "value"> & {
29
+ value: string;
30
+ } & import("react").RefAttributes<HTMLInputElement>>;
31
+ };
@@ -0,0 +1,47 @@
1
+ import { createContext as e, forwardRef as t, useContext as n, useId as r, useState as i } from "react";
2
+ import { jsx as a } from "react/jsx-runtime";
3
+ // src/components/radio-group/radio-group.tsx
4
+ var o = e(null);
5
+ function s() {
6
+ let e = n(o);
7
+ if (!e) throw Error("RadioGroup.Item must be used inside RadioGroup.Root.");
8
+ return e;
9
+ }
10
+ var c = {
11
+ Root: t(function({ value: e, defaultValue: t, onValueChange: n, disabled: s = !1, required: c = !1, name: l, ...u }, d) {
12
+ let f = r(), [p, m] = i(t), h = e !== void 0;
13
+ function g(e) {
14
+ h || m(e), n?.(e);
15
+ }
16
+ return /* @__PURE__ */ a(o.Provider, {
17
+ value: {
18
+ name: l ?? f,
19
+ value: h ? e : p,
20
+ disabled: s,
21
+ required: c,
22
+ select: g
23
+ },
24
+ children: /* @__PURE__ */ a("div", {
25
+ ...u,
26
+ ref: d,
27
+ role: "radiogroup",
28
+ "aria-required": c || void 0
29
+ })
30
+ });
31
+ }),
32
+ Item: t(function({ value: e, disabled: t, ...n }, r) {
33
+ let i = s();
34
+ return /* @__PURE__ */ a("input", {
35
+ ...n,
36
+ ref: r,
37
+ type: "radio",
38
+ name: i.name,
39
+ value: e,
40
+ checked: i.value === e,
41
+ disabled: i.disabled || t,
42
+ required: i.required,
43
+ onChange: () => i.select(e)
44
+ });
45
+ })
46
+ };
47
+ export { c as RadioGroup };
@@ -0,0 +1,2 @@
1
+ export { Separator } from "./separator.js";
2
+ export type { SeparatorProps } from "./separator.js";
@@ -0,0 +1,18 @@
1
+ import type { HTMLAttributes } from "react";
2
+ export type SeparatorProps = Omit<HTMLAttributes<HTMLElement>, "role"> & {
3
+ /** Defaults to "horizontal". */
4
+ orientation?: "horizontal" | "vertical";
5
+ /**
6
+ * Set when the line is only visual and carries no meaning. Screen readers
7
+ * then ignore it.
8
+ */
9
+ decorative?: boolean;
10
+ };
11
+ /**
12
+ * A dividing line between content.
13
+ *
14
+ * A meaningful horizontal separator renders a native `<hr>`. A vertical or
15
+ * decorative one renders a `<div>`, because `<hr>` has no vertical form and
16
+ * cannot be made decorative. Editio draws nothing; you style the line.
17
+ */
18
+ export declare function Separator({ orientation, decorative, ...props }: SeparatorProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ // src/components/separator/separator.tsx
3
+ function t({ orientation: t = "horizontal", decorative: n = !1, ...r }) {
4
+ return n ? /* @__PURE__ */ e("div", {
5
+ ...r,
6
+ role: "none"
7
+ }) : t === "horizontal" ? /* @__PURE__ */ e("hr", { ...r }) : /* @__PURE__ */ e("div", {
8
+ ...r,
9
+ role: "separator",
10
+ "aria-orientation": "vertical"
11
+ });
12
+ }
13
+ export { t as Separator };
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare function TypeSpecimen({ text, initialSize }: {
3
+ text?: string;
4
+ initialSize?: number;
5
+ }): import("react").JSX.Element;
6
+ export type IndexEntry = {
7
+ title: string;
8
+ detail: string;
9
+ year?: string;
10
+ content: ReactNode;
11
+ };
12
+ export declare function ProjectIndex({ entries }: {
13
+ entries: IndexEntry[];
14
+ }): import("react").JSX.Element;
15
+ export declare function ImageProof({ before, after, label }: {
16
+ before: string;
17
+ after: string;
18
+ label?: string;
19
+ }): import("react").JSX.Element;
20
+ export declare function ReadingEdition({ pages }: {
21
+ pages: {
22
+ title: string;
23
+ content: ReactNode;
24
+ }[];
25
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,140 @@
1
+ import { useId as e, useState as t } from "react";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ // src/components/studies/index.tsx
4
+ function i({ text: e = "Something human.", initialSize: i = 76 }) {
5
+ let [a, o] = t(i), [s, c] = t(!1);
6
+ return /* @__PURE__ */ r("section", {
7
+ className: "ed-study-type",
8
+ children: [
9
+ /* @__PURE__ */ r("div", {
10
+ className: "ed-study-meta",
11
+ children: [/* @__PURE__ */ n("span", { children: "TYPE SPECIMEN" }), /* @__PURE__ */ r("span", { children: [a, " PX"] })]
12
+ }),
13
+ /* @__PURE__ */ n("div", {
14
+ className: "ed-study-glyph",
15
+ style: {
16
+ fontSize: `clamp(28px, 12cqi, ${a}px)`,
17
+ fontStyle: s ? "italic" : "normal"
18
+ },
19
+ children: e
20
+ }),
21
+ /* @__PURE__ */ r("div", {
22
+ className: "ed-study-tools",
23
+ children: [/* @__PURE__ */ r("label", { children: ["Size ", /* @__PURE__ */ n("input", {
24
+ type: "range",
25
+ min: 28,
26
+ max: 120,
27
+ value: a,
28
+ onChange: (e) => o(+e.target.value)
29
+ })] }), /* @__PURE__ */ n("button", {
30
+ type: "button",
31
+ "aria-pressed": s,
32
+ onClick: () => c(!s),
33
+ children: "Italic"
34
+ })]
35
+ })
36
+ ]
37
+ });
38
+ }
39
+ function a({ entries: i }) {
40
+ let [a, o] = t(0), s = e();
41
+ return /* @__PURE__ */ n("div", {
42
+ className: "ed-study-index",
43
+ children: i.map((e, t) => /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ r("button", {
44
+ type: "button",
45
+ "aria-expanded": a === t,
46
+ "aria-controls": `${s}-${t}`,
47
+ onClick: () => o(a === t ? null : t),
48
+ children: [
49
+ /* @__PURE__ */ n("small", { children: String(t + 1).padStart(2, "0") }),
50
+ /* @__PURE__ */ r("span", { children: [e.title, /* @__PURE__ */ n("small", { children: e.detail })] }),
51
+ /* @__PURE__ */ n("small", { children: e.year }),
52
+ /* @__PURE__ */ n("span", {
53
+ "aria-hidden": "true",
54
+ children: a === t ? "−" : "+"
55
+ })
56
+ ]
57
+ }), /* @__PURE__ */ n("div", {
58
+ id: `${s}-${t}`,
59
+ hidden: a !== t,
60
+ className: "ed-study-index-body",
61
+ children: e.content
62
+ })] }, t))
63
+ });
64
+ }
65
+ function o({ before: e, after: i, label: a = "Image comparison" }) {
66
+ let [o, s] = t(50);
67
+ return /* @__PURE__ */ r("figure", {
68
+ className: "ed-study-proof",
69
+ children: [/* @__PURE__ */ r("div", {
70
+ className: "ed-study-proof-image",
71
+ children: [
72
+ /* @__PURE__ */ n("img", {
73
+ src: i,
74
+ alt: "Edited image"
75
+ }),
76
+ /* @__PURE__ */ n("img", {
77
+ src: e,
78
+ alt: "Original image",
79
+ style: { clipPath: `inset(0 ${100 - o}% 0 0)` }
80
+ }),
81
+ /* @__PURE__ */ n("span", {
82
+ className: "ed-study-proof-rule",
83
+ style: { left: `${o}%` },
84
+ "aria-hidden": "true"
85
+ }),
86
+ /* @__PURE__ */ n("input", {
87
+ "aria-label": a,
88
+ type: "range",
89
+ min: 0,
90
+ max: 100,
91
+ value: o,
92
+ onChange: (e) => s(+e.target.value)
93
+ })
94
+ ]
95
+ }), /* @__PURE__ */ r("figcaption", {
96
+ className: "ed-study-meta",
97
+ children: [
98
+ /* @__PURE__ */ n("span", { children: "ORIGINAL" }),
99
+ /* @__PURE__ */ r("span", { children: [o, "%"] }),
100
+ /* @__PURE__ */ n("span", { children: "EDITED" })
101
+ ]
102
+ })]
103
+ });
104
+ }
105
+ function s({ pages: e }) {
106
+ let [i, a] = t(0), o = e[Math.min(i, e.length - 1)];
107
+ return o ? /* @__PURE__ */ r("section", {
108
+ className: "ed-study-edition",
109
+ children: [
110
+ /* @__PURE__ */ r("div", {
111
+ className: "ed-study-meta",
112
+ children: [/* @__PURE__ */ n("span", { children: "READING ROOM" }), /* @__PURE__ */ r("span", { children: [
113
+ String(i + 1).padStart(2, "0"),
114
+ " / ",
115
+ String(e.length).padStart(2, "0")
116
+ ] })]
117
+ }),
118
+ /* @__PURE__ */ r("div", {
119
+ className: "ed-study-page",
120
+ "aria-live": "polite",
121
+ children: [/* @__PURE__ */ n("h3", { children: o.title }), o.content]
122
+ }),
123
+ /* @__PURE__ */ r("div", {
124
+ className: "ed-study-tools",
125
+ children: [/* @__PURE__ */ n("button", {
126
+ type: "button",
127
+ disabled: i === 0,
128
+ onClick: () => a((e) => e - 1),
129
+ children: "← Previous"
130
+ }), /* @__PURE__ */ n("button", {
131
+ type: "button",
132
+ disabled: i >= e.length - 1,
133
+ onClick: () => a((e) => e + 1),
134
+ children: "Next →"
135
+ })]
136
+ })
137
+ ]
138
+ }) : null;
139
+ }
140
+ export { o as ImageProof, a as ProjectIndex, s as ReadingEdition, i as TypeSpecimen };
@@ -0,0 +1,2 @@
1
+ export { Switch } from "./switch.js";
2
+ export type { SwitchProps } from "./switch.js";
@@ -0,0 +1,7 @@
1
+ import { type CheckboxProps } from "../checkbox/checkbox.js";
2
+ export type SwitchProps = Omit<CheckboxProps, "indeterminate" | "role">;
3
+ /**
4
+ * An on/off control. It is a native checkbox with `role="switch"`, which
5
+ * browsers and screen readers announce as "switch, on/off". Space toggles it.
6
+ */
7
+ export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,12 @@
1
+ import { forwardRef as e } from "react";
2
+ import { Checkbox as t } from "../checkbox/checkbox.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ // src/components/switch/switch.tsx
5
+ var r = e(function(e, r) {
6
+ return /* @__PURE__ */ n(t, {
7
+ ...e,
8
+ ref: r,
9
+ role: "switch"
10
+ });
11
+ });
12
+ export { r as Switch };