astryx-dracula 0.5.0 → 0.6.2
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/BRAND.md +3 -3
- package/README.md +7 -4
- package/USAGE.md +49 -49
- package/astryx-dracula.d.ts +2 -2
- package/astryx-dracula.js +25 -9
- package/astryx-dracula.variants.d.ts +2 -2
- package/astryx.integration.mjs +1 -1
- package/icons.mjs +21 -17
- package/icons.tsx +69 -62
- package/package.json +125 -120
- package/shared/auth-chrome-config.ts +6 -6
- package/shared/auth-chrome.tsx +143 -144
- package/shared/auth-copy.ts +14 -14
- package/shared/chaptered-doc-config.ts +48 -51
- package/shared/chaptered-doc.tsx +267 -289
- package/shared/chart-hues.ts +25 -10
- package/shared/chart-labels.tsx +31 -30
- package/shared/chart-legend.tsx +55 -56
- package/shared/chart-panel-style.ts +3 -3
- package/shared/data-bar.tsx +97 -102
- package/shared/format-money.ts +1 -1
- package/shared/gallery-image.ts +6 -6
- package/shared/login-demo.ts +1 -1
- package/shared/metric-card.tsx +101 -105
- package/shared/metric-delta.tsx +28 -27
- package/shared/order-desk.tsx +205 -216
- package/shared/revenue-chart.tsx +145 -165
- package/shared/scene-castle.tsx +206 -291
- package/shared/scene-frame.tsx +33 -32
- package/shared/scene-hues.ts +17 -17
- package/shared/scene-tile.tsx +88 -92
- package/shared/settings-data.ts +119 -125
- package/shared/settings-rows.tsx +122 -159
- package/shared/sparkline.tsx +75 -88
- package/shared/sso-icons.tsx +10 -22
- package/shared/stars.tsx +16 -25
- package/templates/ai-chat-landing.template.mjs +5 -4
- package/templates/ai-chat-landing.tsx +473 -460
- package/templates/ai-chat.template.mjs +5 -4
- package/templates/ai-chat.tsx +543 -612
- package/templates/blank.template.mjs +5 -4
- package/templates/blank.tsx +18 -14
- package/templates/centered-hero.template.mjs +5 -4
- package/templates/centered-hero.tsx +55 -68
- package/templates/classic-gallery.template.mjs +5 -4
- package/templates/classic-gallery.tsx +97 -104
- package/templates/contact-form.template.mjs +5 -4
- package/templates/contact-form.tsx +247 -282
- package/templates/dashboard-portfolio.template.mjs +5 -4
- package/templates/dashboard-portfolio.tsx +717 -548
- package/templates/dashboard.template.mjs +5 -4
- package/templates/dashboard.tsx +596 -567
- package/templates/detail-page.template.mjs +5 -4
- package/templates/detail-page.tsx +546 -603
- package/templates/documentation-design.template.mjs +5 -4
- package/templates/documentation-design.tsx +231 -243
- package/templates/documentation-technical.template.mjs +5 -4
- package/templates/documentation-technical.tsx +236 -239
- package/templates/documentation.template.mjs +5 -4
- package/templates/documentation.tsx +267 -279
- package/templates/editor.template.mjs +5 -4
- package/templates/editor.tsx +844 -877
- package/templates/file-explorer.template.mjs +5 -4
- package/templates/file-explorer.tsx +566 -590
- package/templates/form-two-column.template.mjs +5 -4
- package/templates/form-two-column.tsx +195 -210
- package/templates/gallery-hero.template.mjs +5 -4
- package/templates/gallery-hero.tsx +93 -114
- package/templates/ide.template.mjs +5 -4
- package/templates/ide.tsx +407 -453
- package/templates/incident-console.template.mjs +5 -4
- package/templates/incident-console.tsx +593 -575
- package/templates/kanban-board.template.mjs +5 -4
- package/templates/kanban-board.tsx +665 -683
- package/templates/library.template.mjs +5 -4
- package/templates/library.tsx +409 -430
- package/templates/login-card.template.mjs +5 -4
- package/templates/login-card.tsx +63 -72
- package/templates/login-split.template.mjs +5 -4
- package/templates/login-split.tsx +192 -193
- package/templates/login-sso.template.mjs +5 -4
- package/templates/login-sso.tsx +257 -258
- package/templates/login.template.mjs +5 -4
- package/templates/login.tsx +53 -49
- package/templates/messaging-shell.template.mjs +5 -4
- package/templates/messaging-shell.tsx +556 -574
- package/templates/mixed-gallery.template.mjs +5 -4
- package/templates/mixed-gallery.tsx +60 -58
- package/templates/payment-form.template.mjs +5 -4
- package/templates/payment-form.tsx +882 -991
- package/templates/product-detail.template.mjs +5 -4
- package/templates/product-detail.tsx +261 -272
- package/templates/product-gallery.template.mjs +5 -4
- package/templates/product-gallery.tsx +126 -137
- package/templates/product-tour.template.mjs +5 -4
- package/templates/product-tour.tsx +741 -773
- package/templates/settings-dialog.template.mjs +5 -4
- package/templates/settings-dialog.tsx +688 -717
- package/templates/settings-sidebar.template.mjs +5 -4
- package/templates/settings-sidebar.tsx +762 -807
- package/templates/settings.template.mjs +5 -4
- package/templates/settings.tsx +289 -304
- package/templates/shell-nav.template.mjs +5 -4
- package/templates/shell-nav.tsx +212 -219
- package/templates/shell-side-nav.template.mjs +5 -4
- package/templates/shell-side-nav.tsx +135 -157
- package/templates/shell-top-nav.template.mjs +5 -4
- package/templates/shell-top-nav.tsx +182 -203
- package/templates/side-gallery.template.mjs +5 -4
- package/templates/side-gallery.tsx +85 -90
- package/templates/table-grouped.template.mjs +5 -4
- package/templates/table-grouped.tsx +1000 -1053
- package/templates/table-page-chart.template.mjs +5 -4
- package/templates/table-page-chart.tsx +400 -398
- package/templates/table-page-heatmap-status.template.mjs +5 -4
- package/templates/table-page-heatmap-status.tsx +483 -512
- package/templates/table-page-shoe-store-heatmap.template.mjs +5 -4
- package/templates/table-page-shoe-store-heatmap.tsx +748 -746
- package/templates/table-page.template.mjs +5 -4
- package/templates/table-page.tsx +396 -405
- package/templates/table.template.mjs +5 -4
- package/templates/table.tsx +92 -93
- package/templates/tech-report.template.mjs +5 -4
- package/templates/tech-report.tsx +1316 -1304
- package/templates/theme-showcase.template.mjs +5 -4
- package/templates/theme-showcase.tsx +871 -951
- package/theme.css +35 -77
- package/theme.css.d.ts +9 -0
- package/tokens.css +373 -380
package/package.json
CHANGED
|
@@ -1,122 +1,127 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
2
|
+
"author": "Yuzu Octopus",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/yuzu-octopus/astryx-dracula/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"lucide-react": "^1.61.0"
|
|
8
|
+
},
|
|
9
|
+
"description": "Pure Dracula brand theme for Astryx React sites. Dark-only tokens, syntax highlighting, and chart colors with prebuilt CSS.",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@astryxdesign/cli": "0.7.2",
|
|
12
|
+
"@astryxdesign/core": "0.7.2",
|
|
13
|
+
"@biomejs/biome": "2.6.2",
|
|
14
|
+
"@types/bun": "^1.4.3",
|
|
15
|
+
"@types/node": "^26.6.5",
|
|
16
|
+
"@types/react": "^19.3.0",
|
|
17
|
+
"@types/react-dom": "^19.3.0",
|
|
18
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
19
|
+
"typescript": "^7.0.2",
|
|
20
|
+
"vite": "^8.3.5"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
"./shared/auth-chrome": "./shared/auth-chrome.tsx",
|
|
24
|
+
"./shared/auth-chrome-config": "./shared/auth-chrome-config.ts",
|
|
25
|
+
"./shared/auth-copy": "./shared/auth-copy.ts",
|
|
26
|
+
"./shared/chaptered-doc": "./shared/chaptered-doc.tsx",
|
|
27
|
+
"./shared/chaptered-doc-config": "./shared/chaptered-doc-config.ts",
|
|
28
|
+
"./shared/chart-hues": "./shared/chart-hues.ts",
|
|
29
|
+
"./shared/chart-labels": "./shared/chart-labels.tsx",
|
|
30
|
+
"./shared/chart-legend": "./shared/chart-legend.tsx",
|
|
31
|
+
"./shared/chart-panel-style": "./shared/chart-panel-style.ts",
|
|
32
|
+
"./shared/data-bar": "./shared/data-bar.tsx",
|
|
33
|
+
"./shared/gallery-image": "./shared/gallery-image.ts",
|
|
34
|
+
"./shared/login-demo": "./shared/login-demo.ts",
|
|
35
|
+
"./shared/metric-delta": "./shared/metric-delta.tsx",
|
|
36
|
+
"./shared/order-desk": "./shared/order-desk.tsx",
|
|
37
|
+
"./shared/revenue-chart": "./shared/revenue-chart.tsx",
|
|
38
|
+
"./shared/scene-castle": "./shared/scene-castle.tsx",
|
|
39
|
+
"./shared/scene-frame": "./shared/scene-frame.tsx",
|
|
40
|
+
"./shared/scene-hues": "./shared/scene-hues.ts",
|
|
41
|
+
"./shared/scene-tile": "./shared/scene-tile.tsx",
|
|
42
|
+
"./shared/settings-data": "./shared/settings-data.ts",
|
|
43
|
+
"./shared/settings-rows": "./shared/settings-rows.tsx",
|
|
44
|
+
"./shared/sparkline": "./shared/sparkline.tsx",
|
|
45
|
+
"./shared/format-money": "./shared/format-money.ts",
|
|
46
|
+
"./shared/metric-card": "./shared/metric-card.tsx",
|
|
47
|
+
"./shared/stars": "./shared/stars.tsx",
|
|
48
|
+
"./shared/sso-icons": "./shared/sso-icons.tsx",
|
|
49
|
+
".": {
|
|
50
|
+
"types": "./astryx-dracula.d.ts",
|
|
51
|
+
"default": "./astryx-dracula.js"
|
|
52
|
+
},
|
|
53
|
+
"./astryx.integration.mjs": "./astryx.integration.mjs",
|
|
54
|
+
"./package.json": "./package.json",
|
|
55
|
+
"./templates/*": "./templates/*",
|
|
56
|
+
"./theme.css": {
|
|
57
|
+
"types": "./theme.css.d.ts",
|
|
58
|
+
"default": "./theme.css"
|
|
59
|
+
},
|
|
60
|
+
"./tokens.css": "./tokens.css"
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"BRAND.md",
|
|
64
|
+
"LICENSE",
|
|
65
|
+
"README.md",
|
|
66
|
+
"USAGE.md",
|
|
67
|
+
"astryx-dracula.d.ts",
|
|
68
|
+
"astryx-dracula.js",
|
|
69
|
+
"astryx-dracula.variants.d.ts",
|
|
70
|
+
"fonts/",
|
|
71
|
+
"icons.mjs",
|
|
72
|
+
"icons.tsx",
|
|
73
|
+
"shared/",
|
|
74
|
+
"theme.css.d.ts",
|
|
75
|
+
"theme.css",
|
|
76
|
+
"tokens.css",
|
|
77
|
+
"templates/",
|
|
78
|
+
"astryx.integration.mjs"
|
|
79
|
+
],
|
|
80
|
+
"keywords": [
|
|
81
|
+
"astryx",
|
|
82
|
+
"dracula",
|
|
83
|
+
"dracula-theme",
|
|
84
|
+
"theme",
|
|
85
|
+
"design-system",
|
|
86
|
+
"dark-theme",
|
|
87
|
+
"react",
|
|
88
|
+
"tokens"
|
|
89
|
+
],
|
|
90
|
+
"license": "MIT",
|
|
91
|
+
"name": "astryx-dracula",
|
|
92
|
+
"peerDependencies": {
|
|
93
|
+
"@astryxdesign/core": "^0.7.2",
|
|
94
|
+
"lucide-react": "^1.45.0",
|
|
95
|
+
"react": ">=19.0.0",
|
|
96
|
+
"react-dom": ">=19.0.0"
|
|
97
|
+
},
|
|
98
|
+
"repository": {
|
|
99
|
+
"type": "git",
|
|
100
|
+
"url": "git+https://github.com/yuzu-octopus/astryx-dracula.git"
|
|
101
|
+
},
|
|
102
|
+
"scripts": {
|
|
103
|
+
"audit": "bun run fonts:sync && bun scripts/check.ts",
|
|
104
|
+
"fonts:sync": "mkdir -p public/fonts && cp fonts/*.woff2 public/fonts/",
|
|
105
|
+
"build": "bun check && vite build",
|
|
106
|
+
"dev": "vite",
|
|
107
|
+
"preview": "vite preview",
|
|
108
|
+
"theme:build": "bun run icons:build && bunx astryx theme build astryx-theme.ts -o theme.css --icons-specifier ./icons.mjs",
|
|
109
|
+
"icons:build": "NODE_ENV=production bun build icons.tsx --outfile icons.mjs --format esm --external react --external lucide-react",
|
|
110
|
+
"theme:check": "bun run icons:check && bunx astryx theme build astryx-theme.ts -o theme.css --icons-specifier ./icons.mjs --check --json | bun -e 'const r = JSON.parse(await Bun.stdin.text()); if (r.type !== \"theme.build.check\") { console.error(\"theme:check: unexpected CLI response \" + JSON.stringify(r).slice(0, 200)); process.exit(1); } const stale = r.data.stale; for (const s of stale) console.error(\"stale: \" + s.path + \" (\" + s.reason + \")\"); if (stale.length) process.exit(1); const entry = await import(\"./astryx-dracula.js\"); if (!entry.astryxDraculaTheme || !entry.draculaIconRegistry) { console.error(\"astryx-dracula.js is missing its theme or icon registry export\"); process.exit(1); } console.log(\"theme outputs up to date; astryx-dracula.js (hand-maintained) loads and exports\");' && bun run entry:check",
|
|
111
|
+
"icons:check": "NODE_ENV=production bun build icons.tsx --outfile .tmp-icons.mjs --format esm --external react --external lucide-react; s=$?; cmp -s .tmp-icons.mjs icons.mjs; c=$?; rm -f .tmp-icons.mjs; [ $s -eq 0 ] && [ $c -eq 0 ] || { echo 'stale: icons.mjs (rerun bun run icons:build)'; exit 1; }",
|
|
112
|
+
"entry:check": "node -e \"const{pathToFileURL}=require('url');const{resolve}=require('path');import(pathToFileURL(resolve('astryx-dracula.js')).href).then(m=>{if(!m.astryxDraculaTheme||!m.draculaIconRegistry){console.error('astryx-dracula.js is missing its theme or icon registry export');process.exit(1)}console.log('astryx-dracula.js loads under plain Node ESM')}).catch(e=>{console.error('astryx-dracula.js is not importable by Node ESM: '+e.message);process.exit(1)})\"",
|
|
113
|
+
"prepublishOnly": "bun run theme:check && bun run icons:check && bun run entry:check && bun run audit && bun check && bun run fmt:check && bun run lint && bunx react-doctor@latest --score",
|
|
114
|
+
"fmt": "bun fmt '**/*.{ts,tsx,mjs,js,jsx,json,css}'",
|
|
115
|
+
"fmt:check": "bun fmt --check '**/*.{ts,tsx,mjs,js,jsx,json,css}'",
|
|
116
|
+
"lint": "biome lint"
|
|
117
|
+
},
|
|
118
|
+
"sideEffects": [
|
|
119
|
+
"**/*.css"
|
|
120
|
+
],
|
|
121
|
+
"trustedDependencies": [
|
|
122
|
+
"@astryxdesign/core",
|
|
123
|
+
"@astryxdesign/cli"
|
|
124
|
+
],
|
|
125
|
+
"type": "module",
|
|
126
|
+
"version": "0.6.2"
|
|
122
127
|
}
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
// reason as shared/scene-hues.ts: a .tsx exporting non-components breaks React
|
|
3
3
|
// Fast Refresh. Five templates import these, so they are genuinely shared --
|
|
4
4
|
// they were only ever co-located by accident of history.
|
|
5
|
-
import type {CSSProperties} from
|
|
5
|
+
import type { CSSProperties } from "react";
|
|
6
6
|
|
|
7
7
|
// Standalone auth pages paint their own body background (no host shell).
|
|
8
8
|
export const authPageStyle: CSSProperties = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
minHeight: "100%",
|
|
10
|
+
backgroundColor: "var(--color-background-body)",
|
|
11
|
+
padding: "var(--spacing-6)",
|
|
12
12
|
};
|
|
13
13
|
// Cap the column at 400px but let it shrink to fit narrow screens.
|
|
14
|
-
export const authContentStyle: CSSProperties = {width:
|
|
14
|
+
export const authContentStyle: CSSProperties = { width: "100%", maxWidth: 400 };
|
|
15
15
|
// WCAG 1.3.5 autocomplete: TextInput forwards unknown props to <input> but its
|
|
16
16
|
// prop type omits input-only attributes, so spread through a widened record.
|
|
17
17
|
export const inputAutoComplete = (value: string) =>
|
|
18
|
-
|
|
18
|
+
({ autoComplete: value }) as Record<string, string>;
|
package/shared/auth-chrome.tsx
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
// Shared login chrome: page wash + 400px column + Moon brand row + the
|
|
2
2
|
// autocomplete widen-record TextInput needs (prop type omits input attrs).
|
|
3
|
-
import type {ReactNode} from 'react';
|
|
4
|
-
import {Moon} from 'lucide-react';
|
|
5
|
-
import {VStack} from '@astryxdesign/core/Layout';
|
|
6
|
-
import {Text} from '@astryxdesign/core/Text';
|
|
7
|
-
import {Icon} from '@astryxdesign/core/Icon';
|
|
8
|
-
import {Card} from '@astryxdesign/core/Card';
|
|
9
|
-
import {Link} from '@astryxdesign/core/Link';
|
|
10
|
-
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
11
|
-
import {Button} from '@astryxdesign/core/Button';
|
|
12
|
-
import {Heading} from '@astryxdesign/core/Text';
|
|
13
|
-
import {
|
|
14
|
-
AUTH_BRAND_NAME,
|
|
15
|
-
AUTH_HEADING,
|
|
16
|
-
AUTH_SUBTITLE,
|
|
17
|
-
AUTH_PRIMARY_CTA,
|
|
18
|
-
AUTH_SIGNUP_PROMPT,
|
|
19
|
-
AUTH_SIGNUP_LINK,
|
|
20
|
-
AUTH_FORGOT_PASSWORD,
|
|
21
|
-
AUTH_EMAIL_PLACEHOLDER,
|
|
22
|
-
AUTH_PASSWORD_PLACEHOLDER,
|
|
23
|
-
AUTH_TERMS_PREFIX,
|
|
24
|
-
AUTH_TERMS_SERVICE,
|
|
25
|
-
AUTH_TERMS_PRIVACY,
|
|
26
|
-
} from 'astryx-dracula/shared/auth-copy';
|
|
27
|
-
import {inputAutoComplete} from 'astryx-dracula/shared/auth-chrome-config';
|
|
28
3
|
|
|
4
|
+
import { Button } from "@astryxdesign/core/Button";
|
|
5
|
+
import { Card } from "@astryxdesign/core/Card";
|
|
6
|
+
import { Icon } from "@astryxdesign/core/Icon";
|
|
7
|
+
import { VStack } from "@astryxdesign/core/Layout";
|
|
8
|
+
import { Link } from "@astryxdesign/core/Link";
|
|
9
|
+
import { Heading, Text } from "@astryxdesign/core/Text";
|
|
10
|
+
import { TextInput } from "@astryxdesign/core/TextInput";
|
|
11
|
+
import { inputAutoComplete } from "astryx-dracula/shared/auth-chrome-config";
|
|
12
|
+
import {
|
|
13
|
+
AUTH_BRAND_NAME,
|
|
14
|
+
AUTH_EMAIL_PLACEHOLDER,
|
|
15
|
+
AUTH_FORGOT_PASSWORD,
|
|
16
|
+
AUTH_HEADING,
|
|
17
|
+
AUTH_PASSWORD_PLACEHOLDER,
|
|
18
|
+
AUTH_PRIMARY_CTA,
|
|
19
|
+
AUTH_SIGNUP_LINK,
|
|
20
|
+
AUTH_SIGNUP_PROMPT,
|
|
21
|
+
AUTH_SUBTITLE,
|
|
22
|
+
AUTH_TERMS_PREFIX,
|
|
23
|
+
AUTH_TERMS_PRIVACY,
|
|
24
|
+
AUTH_TERMS_SERVICE,
|
|
25
|
+
} from "astryx-dracula/shared/auth-copy";
|
|
26
|
+
import { Moon } from "lucide-react";
|
|
27
|
+
import type { ReactNode } from "react";
|
|
29
28
|
|
|
30
29
|
export function LoginBrand() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
return (
|
|
31
|
+
<VStack gap={2} hAlign="center">
|
|
32
|
+
<Icon icon={Moon} size="lg" color="secondary" />
|
|
33
|
+
<Text type="body" weight="semibold" size="lg">
|
|
34
|
+
{AUTH_BRAND_NAME}
|
|
35
|
+
</Text>
|
|
36
|
+
</VStack>
|
|
37
|
+
);
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
// Shared password-login core: the centered header, credential fields, primary
|
|
@@ -45,43 +44,43 @@ export function LoginBrand() {
|
|
|
45
44
|
// shell — login-split's two-column grid and login-sso's step machine keep
|
|
46
45
|
// their own markup and take the pieces below instead of this whole card.
|
|
47
46
|
export function AuthCard({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
selfHash,
|
|
48
|
+
signupLink = AUTH_SIGNUP_LINK,
|
|
49
|
+
children,
|
|
51
50
|
}: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
selfHash: string;
|
|
52
|
+
signupLink?: string;
|
|
53
|
+
children: ReactNode;
|
|
55
54
|
}) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<Card padding={4} width="100%">
|
|
58
|
+
<VStack gap={4} hAlign="stretch">
|
|
59
|
+
<VStack gap={1} hAlign="center">
|
|
60
|
+
<Heading level={1} type="display-2" justify="center">
|
|
61
|
+
{AUTH_HEADING}
|
|
62
|
+
</Heading>
|
|
63
|
+
<Text type="body" color="secondary">
|
|
64
|
+
{AUTH_SUBTITLE}
|
|
65
|
+
</Text>
|
|
66
|
+
</VStack>
|
|
67
|
+
{children}
|
|
68
|
+
{/* Prose link: colour alone is not a cue inside a sentence
|
|
70
69
|
(WCAG 1.4.1 / F73), so it asks for the underline the kit
|
|
71
70
|
only gives on hover. */}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
71
|
+
<VStack hAlign="center">
|
|
72
|
+
<Text type="supporting" color="secondary">
|
|
73
|
+
{AUTH_SIGNUP_PROMPT}{" "}
|
|
74
|
+
<Link href={selfHash} type="supporting" hasUnderline>
|
|
75
|
+
{signupLink}
|
|
76
|
+
</Link>
|
|
77
|
+
</Text>
|
|
78
|
+
</VStack>
|
|
79
|
+
</VStack>
|
|
80
|
+
</Card>
|
|
81
|
+
<AuthTerms selfHash={selfHash} />
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
// Email + password fields with the shared error/forgot-password rhythm, plus
|
|
@@ -89,87 +88,87 @@ export function AuthCard({
|
|
|
89
88
|
// not the outer 16px: without the group the two inputs sat twice as far
|
|
90
89
|
// apart as the fields below them.
|
|
91
90
|
export function AuthLoginFields({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
email,
|
|
92
|
+
password,
|
|
93
|
+
error,
|
|
94
|
+
selfHash,
|
|
95
|
+
isLoading,
|
|
96
|
+
onEmailChange,
|
|
97
|
+
onPasswordChange,
|
|
98
|
+
onSubmit,
|
|
100
99
|
}: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
email: string;
|
|
101
|
+
password: string;
|
|
102
|
+
error: string | null;
|
|
103
|
+
selfHash: string;
|
|
104
|
+
isLoading: boolean;
|
|
105
|
+
onEmailChange: (value: string) => void;
|
|
106
|
+
onPasswordChange: (value: string) => void;
|
|
107
|
+
onSubmit: () => void;
|
|
109
108
|
}) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<VStack gap={2}>
|
|
112
|
+
<TextInput
|
|
113
|
+
label="Email"
|
|
114
|
+
isLabelHidden
|
|
115
|
+
value={email}
|
|
116
|
+
onChange={onEmailChange}
|
|
117
|
+
placeholder={AUTH_EMAIL_PLACEHOLDER}
|
|
118
|
+
type="email"
|
|
119
|
+
{...inputAutoComplete("email")}
|
|
120
|
+
size="lg"
|
|
121
|
+
onEnter={onSubmit}
|
|
122
|
+
status={error ? { type: "error", message: error } : undefined}
|
|
123
|
+
/>
|
|
124
|
+
<VStack gap={1}>
|
|
125
|
+
<TextInput
|
|
126
|
+
label="Password"
|
|
127
|
+
isLabelHidden
|
|
128
|
+
value={password}
|
|
129
|
+
onChange={onPasswordChange}
|
|
130
|
+
placeholder={AUTH_PASSWORD_PLACEHOLDER}
|
|
131
|
+
type="password"
|
|
132
|
+
{...inputAutoComplete("current-password")}
|
|
133
|
+
size="lg"
|
|
134
|
+
onEnter={onSubmit}
|
|
135
|
+
status={error ? { type: "error", message: error } : undefined}
|
|
136
|
+
/>
|
|
137
|
+
{error && (
|
|
138
|
+
<VStack hAlign="end">
|
|
139
|
+
<Link href={selfHash} color="secondary" isStandalone>
|
|
140
|
+
{AUTH_FORGOT_PASSWORD}
|
|
141
|
+
</Link>
|
|
142
|
+
</VStack>
|
|
143
|
+
)}
|
|
144
|
+
</VStack>
|
|
145
|
+
</VStack>
|
|
146
|
+
<Button
|
|
147
|
+
label={AUTH_PRIMARY_CTA}
|
|
148
|
+
variant="primary"
|
|
149
|
+
size="lg"
|
|
150
|
+
isLoading={isLoading}
|
|
151
|
+
onClick={onSubmit}
|
|
152
|
+
/>
|
|
153
|
+
</>
|
|
154
|
+
);
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
// The family terms line, rendered below the card in the page column.
|
|
159
|
-
export function AuthTerms({selfHash}: {selfHash: string}) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
158
|
+
export function AuthTerms({ selfHash }: { selfHash: string }) {
|
|
159
|
+
return (
|
|
160
|
+
<VStack hAlign="center" width="100%">
|
|
161
|
+
<Text type="supporting" color="secondary" justify="center">
|
|
162
|
+
{AUTH_TERMS_PREFIX}{" "}
|
|
163
|
+
<Link href={selfHash} type="supporting" hasUnderline>
|
|
164
|
+
{AUTH_TERMS_SERVICE}
|
|
165
|
+
</Link>{" "}
|
|
166
|
+
and{" "}
|
|
167
|
+
<Link href={selfHash} type="supporting" hasUnderline>
|
|
168
|
+
{AUTH_TERMS_PRIVACY}
|
|
169
|
+
</Link>
|
|
170
|
+
.
|
|
171
|
+
</Text>
|
|
172
|
+
</VStack>
|
|
173
|
+
);
|
|
175
174
|
}
|