techne-sdk 0.13.0 → 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/CHANGELOG.md +49 -1
- package/README.md +59 -13
- package/dist/auth/hints.d.ts +14 -0
- package/dist/auth/hints.js +18 -0
- package/dist/auth/index.d.ts +19 -1
- package/dist/auth/index.js +49 -1
- package/dist/catalog/catalog.gen.js +9 -8
- package/dist/generated/lexicons.d.ts +8 -8
- package/dist/generated/lexicons.js +4 -3
- package/dist/generated/types/pub/techne/draft/derivation.d.ts +1 -1
- package/dist/generated/types/pub/techne/draft/statement.d.ts +1 -1
- package/dist/react/sign-in.d.ts +34 -0
- package/dist/react/sign-in.js +52 -0
- package/dist/sign-in/index.d.ts +33 -0
- package/dist/sign-in/index.js +483 -0
- package/dist/sign-in/styles.d.ts +22 -0
- package/dist/sign-in/styles.js +108 -0
- package/dist/wasm/techne-wasm.gen.js +1 -1
- package/dist/wasm/techne-wasm2js.gen.js +10682 -10680
- package/package.json +14 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sign-in form's and the button's styles: the Techne sign-in page's own values (ePDS auth-service
|
|
3
|
+
* `login-page.ts`, `phone/country-picker.ts` and shared `brand.ts`, as rendered in the approved mocks), in
|
|
4
|
+
* one sheet that lives in each form's shadow root. Nothing here reaches the host page, and the host page's
|
|
5
|
+
* rules do not reach in: `:host` resets every inherited property with `!important`, which beats the page's
|
|
6
|
+
* own rules on the host element.
|
|
7
|
+
*
|
|
8
|
+
* The two brand fonts are the Techne sign-in page's, loaded from the home PDS (`<pds>/static/fonts/`,
|
|
9
|
+
* served with `Access-Control-Allow-Origin: *`) under names of our own, so a host page's 'Octave' or
|
|
10
|
+
* 'Public Sans' is never touched. `@font-face` does not work inside a shadow root, so {@link fontFaces} goes
|
|
11
|
+
* into the document's head, once.
|
|
12
|
+
*/
|
|
13
|
+
/** The font families the sheet names (ours: no host page uses them). */
|
|
14
|
+
export const SERIF = "'Techne Octave', Georgia, serif";
|
|
15
|
+
export const SANS = "'Techne Public Sans', Arial, sans-serif";
|
|
16
|
+
/** The `@font-face` rules for {@link SERIF} and {@link SANS}, from `base` (`<pds>/static/fonts/`). */
|
|
17
|
+
export function fontFaces(base) {
|
|
18
|
+
const face = (family, file, weight) => `@font-face { font-family: '${family}'; src: url('${base}${file}') format('woff2'); font-weight: ${weight}; font-display: swap; }`;
|
|
19
|
+
return [
|
|
20
|
+
face('Techne Octave', 'octave-medium.woff2', 500),
|
|
21
|
+
face('Techne Public Sans', 'public-sans-latin-400-normal.woff2', 400),
|
|
22
|
+
face('Techne Public Sans', 'public-sans-latin-500-normal.woff2', 500),
|
|
23
|
+
face('Techne Public Sans', 'public-sans-latin-700-normal.woff2', 700),
|
|
24
|
+
].join('\n');
|
|
25
|
+
}
|
|
26
|
+
/** Shared by the form and the button. */
|
|
27
|
+
const BASE = `
|
|
28
|
+
:host { all: initial !important; display: block !important; }
|
|
29
|
+
:host([hidden]) { display: none !important; }
|
|
30
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
31
|
+
.root { font-family: ${SANS}; color: #000; text-align: left; line-height: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
|
|
32
|
+
button, input { font-family: inherit; }
|
|
33
|
+
:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
|
|
34
|
+
[hidden] { display: none !important; }
|
|
35
|
+
.word { font-family: ${SERIF}; font-weight: 500; font-feature-settings: 'dlig' 1; letter-spacing: -.01em; }
|
|
36
|
+
`;
|
|
37
|
+
/** The form's sheet. */
|
|
38
|
+
export const FORM_CSS = `${BASE}
|
|
39
|
+
.root { --muted: rgba(0,0,0,.58); --input-border: rgba(0,0,0,.12); }
|
|
40
|
+
.card { width: 100%; max-width: 420px; padding: 28px; display: flex; flex-direction: column; background: #fff; border: 1px solid rgba(0,0,0,.05); border-radius: 20px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
|
|
41
|
+
.app { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-width: 0; }
|
|
42
|
+
.app img { width: 44px; height: 44px; border-radius: 12px; flex: none; display: block; object-fit: cover; }
|
|
43
|
+
.app .name { font-size: 14px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
|
|
44
|
+
/* Every view sits in one grid cell; the country list is laid over it. The cell is as tall as the main view
|
|
45
|
+
whatever tab or view is showing, so the card keeps one size. */
|
|
46
|
+
.views { position: relative; display: grid; flex: 1 0 auto; }
|
|
47
|
+
.view { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; }
|
|
48
|
+
.view.off { visibility: hidden; }
|
|
49
|
+
h1 { font-family: ${SERIF}; font-size: 28px; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; color: #000; margin-bottom: 8px; font-feature-settings: 'dlig' 1; overflow-wrap: anywhere; text-wrap: balance; }
|
|
50
|
+
.lede { color: var(--muted); font-size: 15px; line-height: 1.45; margin-bottom: 24px; text-wrap: pretty; }
|
|
51
|
+
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #EDEBE3; border-radius: 999px; padding: 4px; margin-bottom: 16px; }
|
|
52
|
+
.tab { border: 0; background: none; padding: 9px 0; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
|
|
53
|
+
.tab[aria-selected="true"] { background: #fff; color: #1A130F; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
|
|
54
|
+
.tab:focus-visible { outline-offset: 2px; }
|
|
55
|
+
.fields { display: grid; }
|
|
56
|
+
.field { grid-area: 1 / 1; text-align: left; }
|
|
57
|
+
.field.off { visibility: hidden; }
|
|
58
|
+
label { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: #000; margin-bottom: 6px; }
|
|
59
|
+
input { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--input-border); border-radius: 12px; font-size: 16px; color: #000; background: #fff; outline: none; transition: border-color .15s; }
|
|
60
|
+
input:focus { border-color: #000; }
|
|
61
|
+
input:focus-visible { outline: none; }
|
|
62
|
+
input::placeholder { color: rgba(0,0,0,.4); }
|
|
63
|
+
.phone-row { display: flex; gap: 8px; }
|
|
64
|
+
.phone-row input { flex: 1 1 auto; min-width: 0; }
|
|
65
|
+
.country-btn { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px; border: 1.5px solid var(--input-border); border-radius: 12px; background: #fff; font-size: 16px; color: #1A130F; cursor: pointer; }
|
|
66
|
+
.country-btn:focus-visible, .country-btn[aria-expanded="true"] { outline: none; border-color: #000; }
|
|
67
|
+
.country-btn .caret { color: var(--muted); font-size: 12px; }
|
|
68
|
+
.flag { font-size: 20px; line-height: 1; }
|
|
69
|
+
.no-flags .flag { display: none; }
|
|
70
|
+
.send { width: 100%; height: 48px; margin-top: 16px; padding: 0 15px; background: #000; color: #fff; border: 0; border-radius: 999px; font-size: 15px; font-weight: 500; cursor: pointer; transition: opacity .15s; }
|
|
71
|
+
.send:hover { opacity: .86; }
|
|
72
|
+
.send:focus-visible { outline-offset: 2px; }
|
|
73
|
+
.send:disabled { opacity: .7; cursor: default; }
|
|
74
|
+
.fine { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.45; }
|
|
75
|
+
.fine.error { color: #B3261E; }
|
|
76
|
+
.other { align-self: center; margin-top: 18px; padding: 4px 2px; border: 0; background: none; font-size: 14px; font-weight: 400; color: rgba(0,0,0,.72); text-decoration: underline; text-decoration-color: rgba(0,0,0,.28); text-underline-offset: 3px; cursor: pointer; }
|
|
77
|
+
.other:hover { color: #000; text-decoration-color: currentColor; }
|
|
78
|
+
.other:disabled { cursor: default; }
|
|
79
|
+
/* The country list: over the views, inside the card. */
|
|
80
|
+
.picker { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }
|
|
81
|
+
.back { align-self: flex-start; margin-bottom: 10px; padding: 4px 0; border: 0; background: none; border-radius: 4px; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
|
|
82
|
+
.back:hover { color: #000; }
|
|
83
|
+
.picker input { flex: none; }
|
|
84
|
+
.list { list-style: none; flex: 1 1 0; min-height: 0; overflow-y: auto; margin-top: 8px; }
|
|
85
|
+
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
|
|
86
|
+
.list li .cname { flex: 1 1 auto; min-width: 0; }
|
|
87
|
+
.list li .code { color: var(--muted); }
|
|
88
|
+
.list li.active, .list li:hover { background: #f3f1ec; }
|
|
89
|
+
.list li[aria-selected="true"] .cname { font-weight: 600; }
|
|
90
|
+
.list li.empty { cursor: default; color: var(--muted); font-size: 14px; background: none; }
|
|
91
|
+
.powered { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; font-size: 12px; color: var(--muted); }
|
|
92
|
+
.powered a { text-decoration: none; color: #000; border-radius: 4px; }
|
|
93
|
+
.powered .word { font-size: 16px; line-height: 1; }
|
|
94
|
+
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
95
|
+
`;
|
|
96
|
+
/** The "Sign in with Techne" button's sheet: `dark` (black, for light backgrounds) and `light` (white with a black
|
|
97
|
+
* edge), 44 px or 36 px (`small`) tall. The name only, never the mark beside it. */
|
|
98
|
+
export const BUTTON_CSS = `${BASE}
|
|
99
|
+
:host { display: inline-block !important; }
|
|
100
|
+
.btn { display: inline-flex; align-items: center; height: 44px; padding: 0 22px; border-radius: 999px; font-family: ${SANS}; font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; border: 1.5px solid #000; }
|
|
101
|
+
.btn .word { font-size: 18px; line-height: 1; }
|
|
102
|
+
.btn.dark { background: #000; color: #fff; }
|
|
103
|
+
.btn.light { background: #fff; color: #000; }
|
|
104
|
+
.btn.small { height: 36px; padding: 0 16px; font-size: 14px; }
|
|
105
|
+
.btn.small .word { font-size: 16px; }
|
|
106
|
+
.btn:hover { opacity: .86; }
|
|
107
|
+
.btn:disabled { opacity: .7; cursor: default; }
|
|
108
|
+
`;
|