@metacensus/library-ui 0.13.2 → 0.14.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/LICENSES/ISC.txt +15 -0
- package/README.md +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/people/AudienceIcon.d.ts +16 -0
- package/dist/people/AudienceIcon.js +63 -0
- package/dist/people/AudienceIcon.js.map +1 -0
- package/dist/people/ContributorCard.d.ts +27 -0
- package/dist/people/ContributorCard.js +105 -0
- package/dist/people/ContributorCard.js.map +1 -0
- package/package.json +3 -2
- package/src/css/styles.css +188 -0
package/LICENSES/ISC.txt
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -30,11 +30,12 @@ Marks are importable as `@metacensus/library-ui/marks/mark.svg` and its siblings
|
|
|
30
30
|
|
|
31
31
|
Any unlayered rule of yours now beats the package's, whatever its specificity: a bare `button { ... }` beats `.mc-button`, which it did not before. That is how your own CSS wins. To choose the layer's name, import it as `@import '@metacensus/library-ui/styles.css' layer(brand);`, which nests the rules as `brand.mc`, and name `brand` in the ordering line in place of `mc`.
|
|
32
32
|
|
|
33
|
-
Components render on the server: no router, auth or API client, and no browser global while rendering. In Astro, add `@astrojs/react`; the marks and chrome render at build with no `client:` directive and ship no JS. Only `ThemeToggle`
|
|
33
|
+
Components render on the server: no router, auth or API client, and no browser global while rendering. In Astro, add `@astrojs/react`; the marks and chrome render at build with no `client:` directive and ship no JS. Only `ThemeToggle` and `ContributorCard` need one, as `client:visible`.
|
|
34
34
|
|
|
35
35
|
- Marks: `MetaCensusMark`, `MetaCensusLockup`, `MetaCensusWordmark` (the lockup's letters alone, in `WORDMARK_VIEWBOX`), `MetaCensusArrow`, `LogoArrowMorph`, and the shared geometry, including the lockup's spacing (`LOCKUP_VIEWBOX`, and `LOCKUP_MARK_BOX` for the mark's box within it).
|
|
36
36
|
- Chrome: `Header` (`nav` and `actions` slots, which wrap on a narrow screen; with no `nav`, the `actions` sit at the end of the row), `Footer` (`brand` replaces the linked lockup and its link is the consumer's; `tagline`; link columns as children), `Nav` (`links`).
|
|
37
37
|
- Tools: `cn`, `Button`, `Notice`, `Chip`, the form kit (`Field`, `Label`, `Input`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `FieldError`), `useTheme`, `ThemeToggle`, `themeScript`.
|
|
38
|
+
- People: `ContributorCard` (a person's photo, name, role, flavor chip and bio, whose bio floats open on hover or focus until Escape), `ContributorFlavorKey`, and `AudienceIcon` for each of `AUDIENCES`, labelled from `AUDIENCE_LABELS`. The floating card is portaled into `<body>`, so import `tokens.css` and set the theme on `:root`, not on a wrapper.
|
|
38
39
|
|
|
39
40
|
- Marks take `variant`: `auto` (the default: solid on light, reversed on dark), `solid` or `reversed`, and `gradient` on the lockup, which needs a white or very light ground. Mark usage is in [TRADEMARKS.md](TRADEMARKS.md).
|
|
40
41
|
- `LogoArrowMorph` is a pure function of `progress`, 0 the mark and 1 the arrow; whatever places it owns the timing. Keep it horizontal.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,4 +8,6 @@ export { Chip } from './tools/Chip.js';
|
|
|
8
8
|
export { cn } from './tools/cn.js';
|
|
9
9
|
export { Checkbox, Field, FieldError, Input, Label, RadioGroup, Select, Textarea, } from './tools/form.js';
|
|
10
10
|
export { Notice } from './tools/Notice.js';
|
|
11
|
+
export { AUDIENCES, AUDIENCE_LABELS, AudienceIcon, type Audience, } from './people/AudienceIcon.js';
|
|
12
|
+
export { ContributorCard, ContributorFlavorKey, type ContributorFlavor, } from './people/ContributorCard.js';
|
|
11
13
|
export { ThemeToggle, themeScript, useTheme, type Theme, } from './tools/theme.js';
|
package/dist/index.js
CHANGED
|
@@ -8,5 +8,7 @@ export { Chip } from './tools/Chip.js';
|
|
|
8
8
|
export { cn } from './tools/cn.js';
|
|
9
9
|
export { Checkbox, Field, FieldError, Input, Label, RadioGroup, Select, Textarea, } from './tools/form.js';
|
|
10
10
|
export { Notice } from './tools/Notice.js';
|
|
11
|
+
export { AUDIENCES, AUDIENCE_LABELS, AudienceIcon, } from './people/AudienceIcon.js';
|
|
12
|
+
export { ContributorCard, ContributorFlavorKey, } from './people/ContributorCard.js';
|
|
11
13
|
export { ThemeToggle, themeScript, useTheme, } from './tools/theme.js';
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,cAAc,qBAAqB,CAAA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A;AAC1C,OAAO,EACL,SAAS,EACT,eAAe,EACf,YAAY,GAEb,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,eAAe,EACf,oBAAoB,GAErB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,WAAW,EACX,WAAW,EACX,QAAQ,GAET,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SVGProps } from 'react';
|
|
2
|
+
/** Who a piece of work is for, in the order a page lists them. */
|
|
3
|
+
export declare const AUDIENCES: readonly ["engineers", "researchers", "regulators", "funders", "partners", "contributors"];
|
|
4
|
+
export type Audience = (typeof AUDIENCES)[number];
|
|
5
|
+
export declare const AUDIENCE_LABELS: Record<Audience, string>;
|
|
6
|
+
/** `</>` on a 24-unit square, as strokes: the engineering flavor's glyph and
|
|
7
|
+
* the engineers' symbol. Lucide's `code-xml`, under the ISC license in
|
|
8
|
+
* LICENSES/ISC.txt. */
|
|
9
|
+
export declare const CODE_PATH = "M18 16l4-4-4-4M6 8l-4 4 4 4M14.5 4l-5 16";
|
|
10
|
+
type AudienceIconProps = Omit<SVGProps<SVGSVGElement>, 'children'> & {
|
|
11
|
+
audience: Audience;
|
|
12
|
+
};
|
|
13
|
+
/** A person marked for one audience and labelled with its name, in the text
|
|
14
|
+
* colour at 1.5em. */
|
|
15
|
+
export declare function AudienceIcon({ audience, className, ...props }: AudienceIconProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { cn } from '../tools/cn.js';
|
|
4
|
+
/** Who a piece of work is for, in the order a page lists them. */
|
|
5
|
+
export const AUDIENCES = [
|
|
6
|
+
'engineers',
|
|
7
|
+
'researchers',
|
|
8
|
+
'regulators',
|
|
9
|
+
'funders',
|
|
10
|
+
'partners',
|
|
11
|
+
'contributors',
|
|
12
|
+
];
|
|
13
|
+
export const AUDIENCE_LABELS = {
|
|
14
|
+
engineers: 'Engineers',
|
|
15
|
+
researchers: 'Researchers',
|
|
16
|
+
regulators: 'Regulators and guideline groups',
|
|
17
|
+
funders: 'Funders',
|
|
18
|
+
partners: 'Partners',
|
|
19
|
+
contributors: 'Contributors',
|
|
20
|
+
};
|
|
21
|
+
/** `</>` on a 24-unit square, as strokes: the engineering flavor's glyph and
|
|
22
|
+
* the engineers' symbol. Lucide's `code-xml`, under the ISC license in
|
|
23
|
+
* LICENSES/ISC.txt. */
|
|
24
|
+
export const CODE_PATH = 'M18 16l4-4-4-4M6 8l-4 4 4 4M14.5 4l-5 16';
|
|
25
|
+
const rule = (d, width) => (_jsx("path", { d: d, fill: "none", stroke: "currentColor", strokeWidth: width, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
26
|
+
const SHIRT = _jsx("path", { d: "M-2.6 3L0 6.8 2.6 3l.5 6.8h-6.2z" });
|
|
27
|
+
const TIE = _jsx("path", { d: "M-.95 6.1L0 5.1l.95 1-.33 3.7h-1.24z" });
|
|
28
|
+
const DRAWINGS = {
|
|
29
|
+
engineers: {
|
|
30
|
+
symbol: (_jsx("g", { transform: "translate(-16.2 -11.6) scale(.35)", children: rule(CODE_PATH, 3.7) })),
|
|
31
|
+
},
|
|
32
|
+
researchers: {
|
|
33
|
+
cut: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M-2.6 1.6l.7 2.1-.9.8.9.8.7 4.5h2.4l.7-4.5.9-.8-.9-.8.7-2.1z" }), rule('M-6.1 8.4h2.6', 1.05), rule('M-5.5 8.4V6.6m.8 1.8V7.2', 0.85)] })),
|
|
34
|
+
symbol: (_jsxs(_Fragment, { children: [rule('M-12.8-11.3v4.1L-15-3.5h6l-2.2-3.7v-4.1', 1.3), rule('M-13.3-11.3h2.6', 1.3)] })),
|
|
35
|
+
},
|
|
36
|
+
regulators: {
|
|
37
|
+
cut: SHIRT,
|
|
38
|
+
ink: TIE,
|
|
39
|
+
symbol: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M-12-11.2l4 2.7q.4.4-.2.7h-7.6q-.6-.3-.2-.7z" }), rule('M-14.4-7.5v3m2.4-3v3m2.4-3v3', 1.3), rule('M-15.4-3.9h6.8', 1.6)] })),
|
|
40
|
+
},
|
|
41
|
+
funders: {
|
|
42
|
+
cut: (_jsxs(_Fragment, { children: [SHIRT, _jsx("circle", { cx: -12, cy: -6.9, r: 1.4 })] })),
|
|
43
|
+
ink: TIE,
|
|
44
|
+
symbol: _jsx("rect", { x: -16.4, y: -9.7, width: 8.8, height: 5.6, rx: 0.8 }),
|
|
45
|
+
},
|
|
46
|
+
partners: {
|
|
47
|
+
cut: SHIRT,
|
|
48
|
+
ink: TIE,
|
|
49
|
+
symbol: (_jsxs(_Fragment, { children: [rule('M-13.6-9.6v-1.5h3.2v1.5', 1.3), _jsx("rect", { x: -16.1, y: -9.6, width: 8.2, height: 5.9, rx: 0.8 })] })),
|
|
50
|
+
},
|
|
51
|
+
contributors: {},
|
|
52
|
+
};
|
|
53
|
+
const BOX = { x: -16.5, y: -12.75, size: 24 };
|
|
54
|
+
/** A person marked for one audience and labelled with its name, in the text
|
|
55
|
+
* colour at 1.5em. */
|
|
56
|
+
export function AudienceIcon({ audience, className, ...props }) {
|
|
57
|
+
const id = `mc-audience-${useId().replace(/:/g, '')}`;
|
|
58
|
+
const { cut, ink, symbol } = DRAWINGS[audience];
|
|
59
|
+
const label = AUDIENCE_LABELS[audience];
|
|
60
|
+
const box = { x: BOX.x, y: BOX.y, width: BOX.size, height: BOX.size };
|
|
61
|
+
return (_jsxs("svg", { viewBox: `${box.x} ${box.y} ${box.width} ${box.height}`, className: cn('mc-audience-icon', className), role: "img", "aria-label": label, fill: "currentColor", ...props, children: [_jsx("title", { children: label }), _jsxs("mask", { id: id, maskUnits: "userSpaceOnUse", ...box, children: [_jsx("rect", { ...box, fill: "white" }), _jsx("g", { fill: "black", color: "black", children: cut })] }), _jsxs("g", { mask: `url(#${id})`, children: [_jsx("path", { d: "M-7.4 9.8c0-10.15 14.8-10.15 14.8 0z" }), _jsx("circle", { cx: 0, cy: -3.2, r: 4 }), symbol] }), ink] }));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=AudienceIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudienceIcon.js","sourceRoot":"","sources":["../../src/people/AudienceIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAiC,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AAEnC,kEAAkE;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,WAAW;IACX,aAAa;IACb,YAAY;IACZ,SAAS;IACT,UAAU;IACV,cAAc;CACN,CAAA;AAIV,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,iCAAiC;IAC7C,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CAC7B,CAAA;AAED;;wBAEwB;AACxB,MAAM,CAAC,MAAM,SAAS,GAAG,0CAA0C,CAAA;AAOnE,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,KAAa,EAAE,EAAE,CAAC,CACzC,eACE,CAAC,EAAE,CAAC,EACJ,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,KAAK,EAClB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,CACH,CAAA;AAED,MAAM,KAAK,GAAG,eAAM,CAAC,EAAC,kCAAkC,GAAG,CAAA;AAC3D,MAAM,GAAG,GAAG,eAAM,CAAC,EAAC,sCAAsC,GAAG,CAAA;AAE7D,MAAM,QAAQ,GAA8B;IAC1C,SAAS,EAAE;QACT,MAAM,EAAE,CACN,YAAG,SAAS,EAA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AC,sCAAsC,GAAG,EACjD,iBAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAI,EAChC,MAAM,IACL,EACH,GAAG,IACA,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** Which kind of work someone contributes; `both` merges the two chips. */
|
|
3
|
+
export type ContributorFlavor = 'engineering' | 'quantitative' | 'both';
|
|
4
|
+
/** What each flavor chip means, shown once where a roster is introduced. */
|
|
5
|
+
export declare function ContributorFlavorKey({ className }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
type ContributorCardProps = {
|
|
9
|
+
name: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
image?: string;
|
|
12
|
+
role?: string;
|
|
13
|
+
/** `role` is a MetaCensus title, set in the accent. */
|
|
14
|
+
metacensusTitle?: boolean;
|
|
15
|
+
flavor?: ContributorFlavor;
|
|
16
|
+
/** The heading level of the name. */
|
|
17
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
|
+
/** The bio, clamped to the card and shown whole while it is hovered or
|
|
19
|
+
* focused. */
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
/** A person who contributes: photo or initials, name, role, flavor and bio,
|
|
23
|
+
* in a fixed 18rem by 12rem footprint. Hovered or focused, the card floats
|
|
24
|
+
* over the page at full height until both end or Escape is pressed, so it
|
|
25
|
+
* needs a `client:` directive to grow. */
|
|
26
|
+
export declare function ContributorCard({ name, href, image, role, metacensusTitle, flavor, level, children, }: ContributorCardProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { cn } from '../tools/cn.js';
|
|
5
|
+
import { CODE_PATH } from './AudienceIcon.js';
|
|
6
|
+
const FLAVORS = {
|
|
7
|
+
engineering: {
|
|
8
|
+
label: 'Engineering',
|
|
9
|
+
glyph: (_jsx("svg", { viewBox: "0 0 24 24", className: "mc-flavor-glyph", fill: "none", stroke: "currentColor", strokeWidth: 2.25, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: _jsx("path", { d: CODE_PATH }) })),
|
|
10
|
+
},
|
|
11
|
+
quantitative: {
|
|
12
|
+
label: 'Quantitative science',
|
|
13
|
+
// σ²: variance, not summation. Text, so it takes the page's face.
|
|
14
|
+
glyph: _jsx("span", { className: "mc-flavor-sigma", children: "\u03C3\u00B2" }),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
function FlavorChip({ flavor }) {
|
|
18
|
+
if (flavor === 'both') {
|
|
19
|
+
const { engineering, quantitative } = FLAVORS;
|
|
20
|
+
return (_jsxs("span", { role: "img", "aria-label": `${engineering.label} and ${quantitative.label}`, className: "mc-flavor-pair", children: [_jsx("span", { className: "mc-flavor mc-flavor-engineering", children: engineering.glyph }), _jsx("span", { className: "mc-flavor mc-flavor-quantitative", children: quantitative.glyph })] }));
|
|
21
|
+
}
|
|
22
|
+
const { label, glyph } = FLAVORS[flavor];
|
|
23
|
+
return (_jsx("span", { role: "img", "aria-label": label, className: cn('mc-flavor', `mc-flavor-${flavor}`), children: glyph }));
|
|
24
|
+
}
|
|
25
|
+
/** What each flavor chip means, shown once where a roster is introduced. */
|
|
26
|
+
export function ContributorFlavorKey({ className }) {
|
|
27
|
+
const entries = [
|
|
28
|
+
['engineering', FLAVORS.engineering.label],
|
|
29
|
+
['quantitative', FLAVORS.quantitative.label],
|
|
30
|
+
['both', 'Both'],
|
|
31
|
+
];
|
|
32
|
+
return (_jsx("ul", { "aria-label": "Contributor flavors", className: cn('mc-flavor-key', className), children: entries.map(([flavor, word]) => (_jsxs("li", { children: [_jsx("span", { "aria-hidden": true, children: _jsx(FlavorChip, { flavor: flavor }) }), word] }, flavor))) }));
|
|
33
|
+
}
|
|
34
|
+
/** The floated copy repeats the resting card, which keeps focus and the
|
|
35
|
+
* accessible content: hide the copy from assistive tech and the tab order,
|
|
36
|
+
* and keep its bottom on screen. */
|
|
37
|
+
const settle = (copy) => {
|
|
38
|
+
if (!copy)
|
|
39
|
+
return;
|
|
40
|
+
copy
|
|
41
|
+
.querySelectorAll('a, button, [tabindex]')
|
|
42
|
+
.forEach((el) => (el.tabIndex = -1));
|
|
43
|
+
const over = copy.getBoundingClientRect().bottom - window.innerHeight;
|
|
44
|
+
if (over > 0)
|
|
45
|
+
copy.style.top = `${Math.max(0, parseFloat(copy.style.top) - over)}px`;
|
|
46
|
+
};
|
|
47
|
+
/** A person who contributes: photo or initials, name, role, flavor and bio,
|
|
48
|
+
* in a fixed 18rem by 12rem footprint. Hovered or focused, the card floats
|
|
49
|
+
* over the page at full height until both end or Escape is pressed, so it
|
|
50
|
+
* needs a `client:` directive to grow. */
|
|
51
|
+
export function ContributorCard({ name, href, image, role, metacensusTitle, flavor, level, children, }) {
|
|
52
|
+
const Name = `h${level}`;
|
|
53
|
+
const shellRef = useRef(null);
|
|
54
|
+
const [rect, setRect] = useState(null);
|
|
55
|
+
const [hovered, setHovered] = useState(false);
|
|
56
|
+
const [focused, setFocused] = useState(false);
|
|
57
|
+
// Escape holds the card down until a new focus, or until hover and focus
|
|
58
|
+
// have both ended: removing the copy can fire a fresh mouseenter.
|
|
59
|
+
const [dismissed, setDismissed] = useState(false);
|
|
60
|
+
if (dismissed && !hovered && !focused)
|
|
61
|
+
setDismissed(false);
|
|
62
|
+
const floating = rect !== null && (hovered || focused) && !dismissed;
|
|
63
|
+
const measure = () => {
|
|
64
|
+
const r = shellRef.current?.getBoundingClientRect();
|
|
65
|
+
if (r)
|
|
66
|
+
setRect({ top: r.top, left: r.left, width: r.width });
|
|
67
|
+
};
|
|
68
|
+
// Keep the floating card on its shell while the page scrolls.
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!floating)
|
|
71
|
+
return;
|
|
72
|
+
window.addEventListener('scroll', measure, true);
|
|
73
|
+
window.addEventListener('resize', measure);
|
|
74
|
+
return () => {
|
|
75
|
+
window.removeEventListener('scroll', measure, true);
|
|
76
|
+
window.removeEventListener('resize', measure);
|
|
77
|
+
};
|
|
78
|
+
}, [floating]);
|
|
79
|
+
// From mount, so an Escape that follows the hover at once is not lost.
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const onKey = (event) => {
|
|
82
|
+
if (event.key === 'Escape')
|
|
83
|
+
setDismissed(true);
|
|
84
|
+
};
|
|
85
|
+
window.addEventListener('keydown', onKey);
|
|
86
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
87
|
+
}, []);
|
|
88
|
+
const card = (style) => (_jsxs("div", { ref: style && ((copy) => settle(copy)), "aria-hidden": style && true, className: cn('mc-contributor', style ? 'mc-contributor-floating' : 'mc-contributor-resting', children != null && 'mc-contributor-with-bio'), style: style, children: [flavor && (_jsx("span", { className: "mc-contributor-flavor", children: _jsx(FlavorChip, { flavor: flavor }) })), _jsxs("div", { className: "mc-contributor-head", children: [image ? (_jsx("img", { src: image, alt: "", width: 48, height: 48, loading: "lazy", className: "mc-contributor-photo" })) : (_jsx("div", { className: "mc-contributor-photo mc-contributor-initials", "aria-hidden": true, children: name
|
|
89
|
+
.split(' ')
|
|
90
|
+
.slice(0, 2)
|
|
91
|
+
.map((word) => word[0] ?? '')
|
|
92
|
+
.join('') })), _jsxs("div", { className: cn('mc-contributor-names', flavor && `mc-contributor-names-${flavor === 'both' ? 2 : 1}`), children: [_jsx(Name, { className: "mc-contributor-name", children: href ? _jsx("a", { href: href, children: name }) : name }), role && (_jsx("p", { className: cn('mc-contributor-role', metacensusTitle && 'mc-contributor-title'), children: role }))] })] }), children != null && _jsx("div", { className: "mc-contributor-bio", children: children })] }));
|
|
93
|
+
return (_jsxs("div", { ref: shellRef, className: "mc-contributor-shell", onMouseEnter: () => {
|
|
94
|
+
measure();
|
|
95
|
+
setHovered(true);
|
|
96
|
+
}, onMouseLeave: () => setHovered(false), onFocusCapture: () => {
|
|
97
|
+
measure();
|
|
98
|
+
setFocused(true);
|
|
99
|
+
setDismissed(false);
|
|
100
|
+
}, onBlurCapture: (event) => {
|
|
101
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
102
|
+
setFocused(false);
|
|
103
|
+
}, children: [card(), floating && createPortal(card({ ...rect, zIndex: 50 }), document.body)] }));
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=ContributorCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContributorCard.js","sourceRoot":"","sources":["../../src/people/ContributorCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,MAAM,OAAO,GAAG;IACd,WAAW,EAAE;QACX,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,CACL,cACE,OAAO,EAAC,WAAW,EACnB,SAAS,EAAC,iBAAiB,EAC3B,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,IAAI,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iCAGtB,eAAM,CAAC,EAAE,SAAS,GAAI,GAClB,CACP;KACF;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,sBAAsB;QAC7B,kEAAkE;QAClE,KAAK,EAAE,eAAM,SAAS,EAAC,iBAAiB,6BAAU;KACnD;CACO,CAAA;AAEV,SAAS,UAAU,CAAC,EAAE,MAAM,EAAiC;IAC3D,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,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BAAsB,CAC1C,YAEA,IAAI,GACH,CACL,IACG,IACF,EACL,QAAQ,IAAI,IAAI,IAAI,cAAK,SAAS,EAAC,oBAAoB,YAAE,QAAQ,GAAO,IACrE,CACP,CAAA;IAED,OAAO,CACL,eACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAC,sBAAsB,EAChC,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO,EAAE,CAAA;YACT,UAAU,CAAC,IAAI,CAAC,CAAA;QAClB,CAAC,EACD,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EACrC,cAAc,EAAE,GAAG,EAAE;YACnB,OAAO,EAAE,CAAA;YACT,UAAU,CAAC,IAAI,CAAC,CAAA;YAChB,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC,EACD,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,aAA4B,CAAC;gBACnE,UAAU,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC,aAEA,IAAI,EAAE,EAGN,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,IACnE,CACP,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metacensus/library-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "MetaCensus brand layer and UI tools for React.",
|
|
5
5
|
"license": "AGPL-3.0-only AND LicenseRef-MetaCensus-Marks",
|
|
6
6
|
"repository": {
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"pdfjs-dist": "6.5.438"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"react": "^18.3.1"
|
|
59
|
+
"react": "^18.3.1",
|
|
60
|
+
"react-dom": "^18.3.1"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@axe-core/playwright": "^4.14.0",
|
package/src/css/styles.css
CHANGED
|
@@ -336,4 +336,192 @@
|
|
|
336
336
|
outline: 2px solid var(--mc-ink-accent);
|
|
337
337
|
outline-offset: 2px;
|
|
338
338
|
}
|
|
339
|
+
|
|
340
|
+
/* Audience icon. */
|
|
341
|
+
.mc-audience-icon {
|
|
342
|
+
display: inline-block;
|
|
343
|
+
flex-shrink: 0;
|
|
344
|
+
width: 1.5em;
|
|
345
|
+
height: 1.5em;
|
|
346
|
+
vertical-align: middle;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* Contributor card: a fixed footprint the floating card grows out of. */
|
|
350
|
+
.mc-contributor-shell {
|
|
351
|
+
position: relative;
|
|
352
|
+
flex-shrink: 0;
|
|
353
|
+
width: 18rem;
|
|
354
|
+
height: 12rem;
|
|
355
|
+
}
|
|
356
|
+
.mc-contributor {
|
|
357
|
+
--mc-contributor-shade: color-mix(in srgb, black 10%, transparent);
|
|
358
|
+
display: flex;
|
|
359
|
+
flex-direction: column;
|
|
360
|
+
justify-content: center;
|
|
361
|
+
box-sizing: border-box;
|
|
362
|
+
padding: 1rem;
|
|
363
|
+
border: 1px solid color-mix(in oklab, var(--mc-hairline) 70%, transparent);
|
|
364
|
+
border-radius: 0.75rem;
|
|
365
|
+
background: var(--mc-card);
|
|
366
|
+
box-shadow: 0 1px 2px 0 color-mix(in srgb, black 5%, transparent);
|
|
367
|
+
color: var(--mc-ink);
|
|
368
|
+
}
|
|
369
|
+
.mc-contributor-with-bio {
|
|
370
|
+
justify-content: normal;
|
|
371
|
+
gap: 0.5rem;
|
|
372
|
+
}
|
|
373
|
+
.mc-contributor-resting {
|
|
374
|
+
position: absolute;
|
|
375
|
+
inset: 0 0 auto;
|
|
376
|
+
z-index: 10;
|
|
377
|
+
height: 100%;
|
|
378
|
+
overflow: hidden;
|
|
379
|
+
}
|
|
380
|
+
.mc-contributor-floating {
|
|
381
|
+
position: fixed;
|
|
382
|
+
min-height: 12rem;
|
|
383
|
+
border-color: color-mix(in oklab, var(--mc-ink) 40%, transparent);
|
|
384
|
+
box-shadow:
|
|
385
|
+
0 20px 25px -5px var(--mc-contributor-shade),
|
|
386
|
+
0 8px 10px -6px var(--mc-contributor-shade);
|
|
387
|
+
}
|
|
388
|
+
.mc-contributor-flavor {
|
|
389
|
+
position: absolute;
|
|
390
|
+
top: 0.625rem;
|
|
391
|
+
right: 0.625rem;
|
|
392
|
+
}
|
|
393
|
+
.mc-contributor-head {
|
|
394
|
+
display: flex;
|
|
395
|
+
align-items: center;
|
|
396
|
+
gap: 0.75rem;
|
|
397
|
+
}
|
|
398
|
+
.mc-contributor-photo {
|
|
399
|
+
flex-shrink: 0;
|
|
400
|
+
width: 3rem;
|
|
401
|
+
height: 3rem;
|
|
402
|
+
border-radius: 9999px;
|
|
403
|
+
box-shadow: 0 0 0 1px var(--mc-hairline);
|
|
404
|
+
object-fit: cover;
|
|
405
|
+
}
|
|
406
|
+
.mc-contributor-initials {
|
|
407
|
+
display: flex;
|
|
408
|
+
align-items: center;
|
|
409
|
+
justify-content: center;
|
|
410
|
+
background: var(--mc-surface);
|
|
411
|
+
font-size: 0.75rem;
|
|
412
|
+
font-weight: 600;
|
|
413
|
+
line-height: 1rem;
|
|
414
|
+
text-transform: uppercase;
|
|
415
|
+
}
|
|
416
|
+
.mc-contributor-names {
|
|
417
|
+
min-width: 0;
|
|
418
|
+
}
|
|
419
|
+
/* Clear of the flavor chip in the corner. */
|
|
420
|
+
.mc-contributor-names-1 {
|
|
421
|
+
padding-right: 1.75rem;
|
|
422
|
+
}
|
|
423
|
+
.mc-contributor-names-2 {
|
|
424
|
+
padding-right: 3.5rem;
|
|
425
|
+
}
|
|
426
|
+
.mc-contributor-name {
|
|
427
|
+
margin: 0;
|
|
428
|
+
font-size: 0.875rem;
|
|
429
|
+
font-weight: 600;
|
|
430
|
+
line-height: 1.25;
|
|
431
|
+
letter-spacing: -0.025em;
|
|
432
|
+
}
|
|
433
|
+
.mc-contributor-name a {
|
|
434
|
+
color: inherit;
|
|
435
|
+
text-decoration: none;
|
|
436
|
+
text-underline-offset: 4px;
|
|
437
|
+
}
|
|
438
|
+
.mc-contributor-name a:hover {
|
|
439
|
+
text-decoration: underline;
|
|
440
|
+
}
|
|
441
|
+
.mc-contributor-role {
|
|
442
|
+
margin: 0.125rem 0 0;
|
|
443
|
+
font-size: 0.75rem;
|
|
444
|
+
font-weight: 500;
|
|
445
|
+
line-height: 1.375;
|
|
446
|
+
}
|
|
447
|
+
.mc-contributor-title {
|
|
448
|
+
color: var(--mc-ink-accent);
|
|
449
|
+
font-weight: 600;
|
|
450
|
+
}
|
|
451
|
+
.mc-contributor-bio {
|
|
452
|
+
font-size: 0.78125rem;
|
|
453
|
+
line-height: 1.375;
|
|
454
|
+
}
|
|
455
|
+
.mc-contributor-bio > p {
|
|
456
|
+
margin: 0;
|
|
457
|
+
}
|
|
458
|
+
.mc-contributor-resting .mc-contributor-bio > p {
|
|
459
|
+
display: -webkit-box;
|
|
460
|
+
overflow: hidden;
|
|
461
|
+
-webkit-box-orient: vertical;
|
|
462
|
+
-webkit-line-clamp: 6;
|
|
463
|
+
}
|
|
464
|
+
.mc-contributor-bio a {
|
|
465
|
+
color: inherit;
|
|
466
|
+
font-weight: 500;
|
|
467
|
+
text-decoration: underline;
|
|
468
|
+
text-underline-offset: 2px;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* Flavor chips: a family's tint, the pair drawn as one object. */
|
|
472
|
+
.mc-flavor {
|
|
473
|
+
display: flex;
|
|
474
|
+
align-items: center;
|
|
475
|
+
justify-content: center;
|
|
476
|
+
box-sizing: border-box;
|
|
477
|
+
width: 1.75rem;
|
|
478
|
+
height: 1.75rem;
|
|
479
|
+
border: 2px solid currentColor;
|
|
480
|
+
border-radius: 0.5rem;
|
|
481
|
+
}
|
|
482
|
+
.mc-flavor-engineering {
|
|
483
|
+
background: var(--mc-tint-red-fill);
|
|
484
|
+
color: var(--mc-tint-red-ink);
|
|
485
|
+
}
|
|
486
|
+
.mc-flavor-quantitative {
|
|
487
|
+
background: var(--mc-tint-blue-fill);
|
|
488
|
+
color: var(--mc-tint-blue-ink);
|
|
489
|
+
}
|
|
490
|
+
.mc-flavor-pair {
|
|
491
|
+
display: flex;
|
|
492
|
+
}
|
|
493
|
+
.mc-flavor-pair > :first-child {
|
|
494
|
+
border-right: 0;
|
|
495
|
+
border-radius: 0.5rem 0 0 0.5rem;
|
|
496
|
+
}
|
|
497
|
+
.mc-flavor-pair > :last-child {
|
|
498
|
+
border-left: 0;
|
|
499
|
+
border-radius: 0 0.5rem 0.5rem 0;
|
|
500
|
+
}
|
|
501
|
+
.mc-flavor-glyph {
|
|
502
|
+
width: 1rem;
|
|
503
|
+
height: 1rem;
|
|
504
|
+
}
|
|
505
|
+
.mc-flavor-sigma {
|
|
506
|
+
font-size: 0.84375rem;
|
|
507
|
+
font-weight: 600;
|
|
508
|
+
line-height: 1;
|
|
509
|
+
letter-spacing: -0.025em;
|
|
510
|
+
}
|
|
511
|
+
.mc-flavor-key {
|
|
512
|
+
display: flex;
|
|
513
|
+
flex-wrap: wrap;
|
|
514
|
+
gap: 0.75rem 1.5rem;
|
|
515
|
+
margin: 0;
|
|
516
|
+
padding: 0;
|
|
517
|
+
list-style: none;
|
|
518
|
+
color: var(--mc-ink);
|
|
519
|
+
font-size: 0.875rem;
|
|
520
|
+
line-height: 1.25rem;
|
|
521
|
+
}
|
|
522
|
+
.mc-flavor-key li {
|
|
523
|
+
display: flex;
|
|
524
|
+
align-items: center;
|
|
525
|
+
gap: 0.5rem;
|
|
526
|
+
}
|
|
339
527
|
}
|