@seanyeh77/ui 0.52.1 → 0.54.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/dist/bundle.js +1 -1
- package/dist/css/Card.css +1 -1
- package/dist/css/DataTable.css +8 -6
- package/dist/css/Grid.css +7 -8
- package/dist/css/Markdown.css +3 -3
- package/dist/css/PageHeader.css +1 -1
- package/dist/css/Section.css +1 -1
- package/dist/css/SettingsLayout.css +1 -1
- package/dist/css/TopBar.css +9 -2
- package/dist/generated/themeDefaults.js +4 -4
- package/dist/generated/themeDefaults.js.map +1 -1
- package/dist/styles.css +31 -23
- package/dist/theme.js +2 -2
- package/dist/theme.js.map +1 -1
- package/dist/tokens.css +35 -27
- package/docs/AiMark.md +1 -1
- package/docs/AppShell.md +3 -3
- package/docs/BarChart.md +1 -1
- package/docs/Card.md +1 -1
- package/docs/DataColors.md +1 -1
- package/docs/DetailList.md +3 -3
- package/docs/EventTimeline.md +1 -1
- package/docs/FloorPlan.md +3 -3
- package/docs/Graph.md +1 -1
- package/docs/Grid.md +3 -3
- package/docs/IconButton.md +1 -1
- package/docs/InlineCode.md +2 -2
- package/docs/KpiCard.md +1 -1
- package/docs/PageHeader.md +1 -1
- package/docs/Section.md +1 -1
- package/docs/SideNav.md +3 -3
- package/docs/TimeControl.md +1 -1
- package/docs/Tooltip.md +1 -1
- package/docs/TopBar.md +1 -1
- package/docs/TreeList.md +1 -1
- package/docs/ZoneMap.md +1 -1
- package/docs/agents.md +5 -5
- package/docs/guidelines.md +2 -2
- package/docs/layout.md +1 -1
- package/docs/monitoring.md +3 -3
- package/docs/theme.md +1 -1
- package/package.json +2 -2
package/dist/css/Card.css
CHANGED
package/dist/css/DataTable.css
CHANGED
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
--dt-zebra: var(--surface-sub);
|
|
29
29
|
--dt-hover: color-mix(in srgb, var(--surface), var(--ink) 6%);
|
|
30
30
|
}
|
|
31
|
-
/* Dark:
|
|
32
|
-
|
|
31
|
+
/* Dark: rows go darker, toward the page ground, not lighter. Text colors are made to read on both the surface and the
|
|
32
|
+
page ground, so every row between them keeps 4.5:1 for ink-muted and every accent and *-text color. */
|
|
33
33
|
[data-theme='dark'] .ui-dt {
|
|
34
|
-
--dt-zebra: color-mix(in srgb, var(--surface), var(--
|
|
35
|
-
--dt-hover: color-mix(in srgb, var(--surface), var(--
|
|
34
|
+
--dt-zebra: color-mix(in srgb, var(--surface), var(--bg) 30%);
|
|
35
|
+
--dt-hover: color-mix(in srgb, var(--surface), var(--bg) 60%);
|
|
36
36
|
}
|
|
37
37
|
.ui-dt-caption {
|
|
38
38
|
/* The same size as a Card title: a table's heading is a block heading whether or not it sits in a card. */
|
|
@@ -362,7 +362,7 @@
|
|
|
362
362
|
display: grid;
|
|
363
363
|
align-items: center;
|
|
364
364
|
min-height: 48px;
|
|
365
|
-
border-bottom: 1px solid var(--line);
|
|
365
|
+
border-bottom: 1px solid var(--line-soft);
|
|
366
366
|
background: var(--dt-row-bg);
|
|
367
367
|
}
|
|
368
368
|
.ui-dt-body .ui-dt-row.is-even {
|
|
@@ -370,6 +370,8 @@
|
|
|
370
370
|
}
|
|
371
371
|
.ui-dt-body {
|
|
372
372
|
position: relative;
|
|
373
|
+
/* Table text 14 px; headings, toolbar and secondary lines keep their own sizes. */
|
|
374
|
+
font-size: var(--text-compact);
|
|
373
375
|
}
|
|
374
376
|
.ui-dt-body .ui-dt-row {
|
|
375
377
|
transition: background-color 0.12s ease;
|
|
@@ -869,7 +871,7 @@
|
|
|
869
871
|
}
|
|
870
872
|
.ui-dt-detail {
|
|
871
873
|
background: var(--surface);
|
|
872
|
-
border-bottom: 1px solid var(--line);
|
|
874
|
+
border-bottom: 1px solid var(--line-soft);
|
|
873
875
|
}
|
|
874
876
|
.ui-dt-detail.is-even {
|
|
875
877
|
background: var(--dt-zebra);
|
package/dist/css/Grid.css
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
@layer theme, base, ui, components, utilities;
|
|
2
2
|
@layer ui.tokens, ui.components;
|
|
3
3
|
@layer ui.components {
|
|
4
|
+
/* Blocks stacked on a page are block-gap apart (32 px, 16 px on phones), whether a Page, the rows of a Grid or a Page
|
|
5
|
+
inside a Grid stacks them: two neighbouring blocks are always the same distance apart. */
|
|
4
6
|
.ui-page {
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
|
-
gap: var(--
|
|
9
|
+
gap: var(--block-gap);
|
|
8
10
|
}
|
|
9
11
|
.ui-grid {
|
|
10
12
|
display: grid;
|
|
11
|
-
|
|
13
|
+
/* Columns 24 px apart; rows (and a Grid folded into one column) the block distance. */
|
|
14
|
+
column-gap: var(--space-6);
|
|
15
|
+
row-gap: var(--block-gap);
|
|
12
16
|
grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
|
|
13
17
|
}
|
|
14
18
|
.ui-grid.is-1 {
|
|
@@ -38,9 +42,8 @@
|
|
|
38
42
|
.ui-grid.is-start {
|
|
39
43
|
align-items: start;
|
|
40
44
|
}
|
|
41
|
-
/* A Page as one cell: several cards stacked in one column,
|
|
45
|
+
/* A Page as one cell: several cards stacked in one column, the block distance apart like every other stack. */
|
|
42
46
|
.ui-grid > .ui-page {
|
|
43
|
-
gap: var(--space-6);
|
|
44
47
|
min-width: 0;
|
|
45
48
|
}
|
|
46
49
|
@media (max-width: 1279px) {
|
|
@@ -62,10 +65,6 @@
|
|
|
62
65
|
@media (max-width: 599px) {
|
|
63
66
|
.ui-grid {
|
|
64
67
|
--cols: 1 !important;
|
|
65
|
-
gap: var(--space-4);
|
|
66
|
-
}
|
|
67
|
-
.ui-grid > .ui-page {
|
|
68
|
-
gap: var(--space-4);
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}
|
package/dist/css/Markdown.css
CHANGED
|
@@ -136,8 +136,8 @@ button.ui-md-link.is-row {
|
|
|
136
136
|
.ui-md-table th,
|
|
137
137
|
.ui-md-table td {
|
|
138
138
|
padding: 10px 12px;
|
|
139
|
-
border-right: 1px solid var(--line);
|
|
140
|
-
border-bottom: 1px solid var(--line);
|
|
139
|
+
border-right: 1px solid var(--line-soft);
|
|
140
|
+
border-bottom: 1px solid var(--line-soft);
|
|
141
141
|
vertical-align: top;
|
|
142
142
|
}
|
|
143
143
|
.ui-md-table th:last-child,
|
|
@@ -263,7 +263,7 @@ button.ui-md-link.is-row {
|
|
|
263
263
|
}
|
|
264
264
|
.ui-md-table tr {
|
|
265
265
|
padding: var(--space-2) var(--space-3);
|
|
266
|
-
border-bottom: 1px solid var(--line);
|
|
266
|
+
border-bottom: 1px solid var(--line-soft);
|
|
267
267
|
}
|
|
268
268
|
.ui-md-table tbody tr:last-child {
|
|
269
269
|
border-bottom: 0;
|
package/dist/css/PageHeader.css
CHANGED
package/dist/css/Section.css
CHANGED
package/dist/css/TopBar.css
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
}
|
|
20
20
|
.ui-topbar-title {
|
|
21
21
|
margin: 0;
|
|
22
|
-
font-size: var(--text-
|
|
23
|
-
line-height:
|
|
22
|
+
font-size: var(--text-h3);
|
|
23
|
+
line-height: 32px;
|
|
24
24
|
font-weight: 700;
|
|
25
25
|
white-space: nowrap;
|
|
26
26
|
overflow: hidden;
|
|
@@ -105,4 +105,11 @@
|
|
|
105
105
|
flex: 0 0 auto;
|
|
106
106
|
margin-left: calc(-1 * var(--space-2));
|
|
107
107
|
}
|
|
108
|
+
/* Phones: the page title stays 20 px beside the project switcher and search (24 px leaves the title no room). */
|
|
109
|
+
@media (max-width: 599px) {
|
|
110
|
+
.ui-topbar-title {
|
|
111
|
+
font-size: var(--text-h4);
|
|
112
|
+
line-height: 28px;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
108
115
|
}
|
|
@@ -6,19 +6,19 @@ const DEFAULT_ACCENT = "#2457d6";
|
|
|
6
6
|
const GROUNDS = {
|
|
7
7
|
bg: {
|
|
8
8
|
light: "#fcfbfb",
|
|
9
|
-
dark: "#
|
|
9
|
+
dark: "#292725"
|
|
10
10
|
},
|
|
11
11
|
surface: {
|
|
12
12
|
light: "#ffffff",
|
|
13
|
-
dark: "#
|
|
13
|
+
dark: "#393632"
|
|
14
14
|
},
|
|
15
15
|
"surface-sub": {
|
|
16
16
|
light: "#f6f5f4",
|
|
17
|
-
dark: "#
|
|
17
|
+
dark: "#413d38"
|
|
18
18
|
},
|
|
19
19
|
"surface-chrome": {
|
|
20
20
|
light: "#ffffff",
|
|
21
|
-
dark: "#
|
|
21
|
+
dark: "#34312e"
|
|
22
22
|
},
|
|
23
23
|
ink: {
|
|
24
24
|
light: "#171512",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeDefaults.js","names":[],"sources":["../../src/generated/themeDefaults.ts"],"sourcesContent":["/* Generated from packages/tokens/tokens.json by scripts/theme-defaults.ts. Do not edit by hand. */\n\n/** The default accent (the light theme's accent token). */\nexport const DEFAULT_ACCENT = '#2457d6';\n\n/** Light and dark values of the grounds setAccent checks contrast on, used when tokens.css is not loaded. */\nexport const GROUNDS = {\n bg: {\n light: '#fcfbfb',\n dark: '#
|
|
1
|
+
{"version":3,"file":"themeDefaults.js","names":[],"sources":["../../src/generated/themeDefaults.ts"],"sourcesContent":["/* Generated from packages/tokens/tokens.json by scripts/theme-defaults.ts. Do not edit by hand. */\n\n/** The default accent (the light theme's accent token). */\nexport const DEFAULT_ACCENT = '#2457d6';\n\n/** Light and dark values of the grounds setAccent checks contrast on, used when tokens.css is not loaded. */\nexport const GROUNDS = {\n bg: {\n light: '#fcfbfb',\n dark: '#292725',\n },\n surface: {\n light: '#ffffff',\n dark: '#393632',\n },\n 'surface-sub': {\n light: '#f6f5f4',\n dark: '#413d38',\n },\n 'surface-chrome': {\n light: '#ffffff',\n dark: '#34312e',\n },\n ink: {\n light: '#171512',\n dark: '#f6f5f4',\n },\n} as const;\n\n/** The presets of tokens.json: their color scheme and accent. */\nexport const PRESETS = {\n teaching: {\n scheme: 'light',\n accent: '#027874',\n },\n} as const;\n\nexport type ThemePreset = keyof typeof PRESETS;\n"],"mappings":";;;AAGA,MAAa,iBAAiB;;AAG9B,MAAa,UAAU;CACrB,IAAI;EACF,OAAO;EACP,MAAM;CACR;CACA,SAAS;EACP,OAAO;EACP,MAAM;CACR;CACA,eAAe;EACb,OAAO;EACP,MAAM;CACR;CACA,kBAAkB;EAChB,OAAO;EACP,MAAM;CACR;CACA,KAAK;EACH,OAAO;EACP,MAAM;CACR;AACF;;AAGA,MAAa,UAAU,EACrB,UAAU;CACR,QAAQ;CACR,QAAQ;AACV,EACF"}
|
package/dist/styles.css
CHANGED
|
@@ -2510,8 +2510,8 @@ div.ui-toast[role='status'] {
|
|
|
2510
2510
|
}
|
|
2511
2511
|
.ui-topbar-title {
|
|
2512
2512
|
margin: 0;
|
|
2513
|
-
font-size: var(--text-
|
|
2514
|
-
line-height:
|
|
2513
|
+
font-size: var(--text-h3);
|
|
2514
|
+
line-height: 32px;
|
|
2515
2515
|
font-weight: 700;
|
|
2516
2516
|
white-space: nowrap;
|
|
2517
2517
|
overflow: hidden;
|
|
@@ -2596,6 +2596,13 @@ div.ui-toast[role='status'] {
|
|
|
2596
2596
|
flex: 0 0 auto;
|
|
2597
2597
|
margin-left: calc(-1 * var(--space-2));
|
|
2598
2598
|
}
|
|
2599
|
+
/* Phones: the page title stays 20 px beside the project switcher and search (24 px leaves the title no room). */
|
|
2600
|
+
@media (max-width: 599px) {
|
|
2601
|
+
.ui-topbar-title {
|
|
2602
|
+
font-size: var(--text-h4);
|
|
2603
|
+
line-height: 28px;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2599
2606
|
.ui-sidenav {
|
|
2600
2607
|
position: relative;
|
|
2601
2608
|
box-sizing: border-box;
|
|
@@ -2973,7 +2980,7 @@ div.ui-toast[role='status'] {
|
|
|
2973
2980
|
.ui-pagehead-title {
|
|
2974
2981
|
min-width: 0;
|
|
2975
2982
|
margin: 0;
|
|
2976
|
-
font-size: var(--text-
|
|
2983
|
+
font-size: var(--text-h3);
|
|
2977
2984
|
line-height: 40px;
|
|
2978
2985
|
font-weight: 700;
|
|
2979
2986
|
white-space: nowrap;
|
|
@@ -3629,11 +3636,11 @@ div.ui-toast[role='status'] {
|
|
|
3629
3636
|
--dt-zebra: var(--surface-sub);
|
|
3630
3637
|
--dt-hover: color-mix(in srgb, var(--surface), var(--ink) 6%);
|
|
3631
3638
|
}
|
|
3632
|
-
/* Dark:
|
|
3633
|
-
|
|
3639
|
+
/* Dark: rows go darker, toward the page ground, not lighter. Text colors are made to read on both the surface and the
|
|
3640
|
+
page ground, so every row between them keeps 4.5:1 for ink-muted and every accent and *-text color. */
|
|
3634
3641
|
[data-theme='dark'] .ui-dt {
|
|
3635
|
-
--dt-zebra: color-mix(in srgb, var(--surface), var(--
|
|
3636
|
-
--dt-hover: color-mix(in srgb, var(--surface), var(--
|
|
3642
|
+
--dt-zebra: color-mix(in srgb, var(--surface), var(--bg) 30%);
|
|
3643
|
+
--dt-hover: color-mix(in srgb, var(--surface), var(--bg) 60%);
|
|
3637
3644
|
}
|
|
3638
3645
|
.ui-dt-caption {
|
|
3639
3646
|
/* The same size as a Card title: a table's heading is a block heading whether or not it sits in a card. */
|
|
@@ -3963,7 +3970,7 @@ div.ui-toast[role='status'] {
|
|
|
3963
3970
|
display: grid;
|
|
3964
3971
|
align-items: center;
|
|
3965
3972
|
min-height: 48px;
|
|
3966
|
-
border-bottom: 1px solid var(--line);
|
|
3973
|
+
border-bottom: 1px solid var(--line-soft);
|
|
3967
3974
|
background: var(--dt-row-bg);
|
|
3968
3975
|
}
|
|
3969
3976
|
.ui-dt-body .ui-dt-row.is-even {
|
|
@@ -3971,6 +3978,8 @@ div.ui-toast[role='status'] {
|
|
|
3971
3978
|
}
|
|
3972
3979
|
.ui-dt-body {
|
|
3973
3980
|
position: relative;
|
|
3981
|
+
/* Table text 14 px; headings, toolbar and secondary lines keep their own sizes. */
|
|
3982
|
+
font-size: var(--text-compact);
|
|
3974
3983
|
}
|
|
3975
3984
|
.ui-dt-body .ui-dt-row {
|
|
3976
3985
|
transition: background-color 0.12s ease;
|
|
@@ -4470,7 +4479,7 @@ div.ui-toast[role='status'] {
|
|
|
4470
4479
|
}
|
|
4471
4480
|
.ui-dt-detail {
|
|
4472
4481
|
background: var(--surface);
|
|
4473
|
-
border-bottom: 1px solid var(--line);
|
|
4482
|
+
border-bottom: 1px solid var(--line-soft);
|
|
4474
4483
|
}
|
|
4475
4484
|
.ui-dt-detail.is-even {
|
|
4476
4485
|
background: var(--dt-zebra);
|
|
@@ -5636,7 +5645,7 @@ div.ui-toast[role='status'] {
|
|
|
5636
5645
|
max-width: 760px;
|
|
5637
5646
|
display: flex;
|
|
5638
5647
|
flex-direction: column;
|
|
5639
|
-
gap: var(--
|
|
5648
|
+
gap: var(--block-gap);
|
|
5640
5649
|
}
|
|
5641
5650
|
.ui-settings-section {
|
|
5642
5651
|
padding: var(--space-4);
|
|
@@ -6362,7 +6371,7 @@ div.ui-toast[role='status'] {
|
|
|
6362
6371
|
flex: 1 1 8em;
|
|
6363
6372
|
min-width: min(8em, 100%);
|
|
6364
6373
|
margin: 0;
|
|
6365
|
-
font-size: var(--text-
|
|
6374
|
+
font-size: var(--text-lead);
|
|
6366
6375
|
font-weight: 700;
|
|
6367
6376
|
white-space: nowrap;
|
|
6368
6377
|
overflow: hidden;
|
|
@@ -8322,14 +8331,18 @@ div.ui-toast[role='status'] {
|
|
|
8322
8331
|
transition: none;
|
|
8323
8332
|
}
|
|
8324
8333
|
}
|
|
8334
|
+
/* Blocks stacked on a page are block-gap apart (32 px, 16 px on phones), whether a Page, the rows of a Grid or a Page
|
|
8335
|
+
inside a Grid stacks them: two neighbouring blocks are always the same distance apart. */
|
|
8325
8336
|
.ui-page {
|
|
8326
8337
|
display: flex;
|
|
8327
8338
|
flex-direction: column;
|
|
8328
|
-
gap: var(--
|
|
8339
|
+
gap: var(--block-gap);
|
|
8329
8340
|
}
|
|
8330
8341
|
.ui-grid {
|
|
8331
8342
|
display: grid;
|
|
8332
|
-
|
|
8343
|
+
/* Columns 24 px apart; rows (and a Grid folded into one column) the block distance. */
|
|
8344
|
+
column-gap: var(--space-6);
|
|
8345
|
+
row-gap: var(--block-gap);
|
|
8333
8346
|
grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
|
|
8334
8347
|
}
|
|
8335
8348
|
.ui-grid.is-1 {
|
|
@@ -8359,9 +8372,8 @@ div.ui-toast[role='status'] {
|
|
|
8359
8372
|
.ui-grid.is-start {
|
|
8360
8373
|
align-items: start;
|
|
8361
8374
|
}
|
|
8362
|
-
/* A Page as one cell: several cards stacked in one column,
|
|
8375
|
+
/* A Page as one cell: several cards stacked in one column, the block distance apart like every other stack. */
|
|
8363
8376
|
.ui-grid > .ui-page {
|
|
8364
|
-
gap: var(--space-6);
|
|
8365
8377
|
min-width: 0;
|
|
8366
8378
|
}
|
|
8367
8379
|
@media (max-width: 1279px) {
|
|
@@ -8383,10 +8395,6 @@ div.ui-toast[role='status'] {
|
|
|
8383
8395
|
@media (max-width: 599px) {
|
|
8384
8396
|
.ui-grid {
|
|
8385
8397
|
--cols: 1 !important;
|
|
8386
|
-
gap: var(--space-4);
|
|
8387
|
-
}
|
|
8388
|
-
.ui-grid > .ui-page {
|
|
8389
|
-
gap: var(--space-4);
|
|
8390
8398
|
}
|
|
8391
8399
|
}
|
|
8392
8400
|
/* SplitPane: a main area and a side panel with a draggable divider. Under 960 px (its own width) they stack. */
|
|
@@ -8556,7 +8564,7 @@ div.ui-toast[role='status'] {
|
|
|
8556
8564
|
.ui-sec-title {
|
|
8557
8565
|
flex: none;
|
|
8558
8566
|
max-width: 100%;
|
|
8559
|
-
font-size: var(--text-
|
|
8567
|
+
font-size: var(--text-lead);
|
|
8560
8568
|
line-height: 28px;
|
|
8561
8569
|
font-weight: 700;
|
|
8562
8570
|
white-space: nowrap;
|
|
@@ -8731,8 +8739,8 @@ button.ui-md-link.is-row {
|
|
|
8731
8739
|
.ui-md-table th,
|
|
8732
8740
|
.ui-md-table td {
|
|
8733
8741
|
padding: 10px 12px;
|
|
8734
|
-
border-right: 1px solid var(--line);
|
|
8735
|
-
border-bottom: 1px solid var(--line);
|
|
8742
|
+
border-right: 1px solid var(--line-soft);
|
|
8743
|
+
border-bottom: 1px solid var(--line-soft);
|
|
8736
8744
|
vertical-align: top;
|
|
8737
8745
|
}
|
|
8738
8746
|
.ui-md-table th:last-child,
|
|
@@ -8858,7 +8866,7 @@ button.ui-md-link.is-row {
|
|
|
8858
8866
|
}
|
|
8859
8867
|
.ui-md-table tr {
|
|
8860
8868
|
padding: var(--space-2) var(--space-3);
|
|
8861
|
-
border-bottom: 1px solid var(--line);
|
|
8869
|
+
border-bottom: 1px solid var(--line-soft);
|
|
8862
8870
|
}
|
|
8863
8871
|
.ui-md-table tbody tr:last-child {
|
|
8864
8872
|
border-bottom: 0;
|
package/dist/theme.js
CHANGED
|
@@ -184,9 +184,9 @@ const ACCENT_VARS = [
|
|
|
184
184
|
];
|
|
185
185
|
/** Every accent token for one color on one theme's grounds. */
|
|
186
186
|
function accentVars(hex, dark, surface, bg, sub, chrome) {
|
|
187
|
-
const soft = dark ? mixHex(
|
|
187
|
+
const soft = dark ? mixHex(bg, hex, .18) : mixHex("#ffffff", hex, .12);
|
|
188
188
|
const text = accentText(hex, dark, bg, surface, sub, chrome, soft);
|
|
189
|
-
const fill = accentFill(hex, dark, bg, surface, sub, chrome, soft);
|
|
189
|
+
const fill = dark ? text : accentFill(hex, dark, bg, surface, sub, chrome, soft);
|
|
190
190
|
const away = dark ? "#ffffff" : "#000000";
|
|
191
191
|
return {
|
|
192
192
|
"--accent": fill,
|
package/dist/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":[],"sources":["../src/theme.ts"],"sourcesContent":["import { ensureAnnouncer } from './announce';\nimport { DEFAULT_ACCENT, GROUNDS, PRESETS, type ThemePreset } from './generated/themeDefaults';\nimport { installFocusMain } from './internal/focusMain';\nimport { readStored, writeStored } from './internal/stored';\nimport { reduced } from './internal/util';\n\n/* Theme and accent color. 'auto' follows prefers-color-scheme; colors cross-fade for 300 ms on a change.\n The choice is kept in localStorage, so initTheme() on the next visit restores it. A preset (data-theme-preset on\n <html>, or initTheme({ preset })) replaces light and dark: the teaching preset is light only. The accent comes from\n tokens.css until the person picks one (setAccent); only then are inline --accent variables written. */\n\nexport type ThemeSetting = 'auto' | 'light' | 'dark';\nexport type { ThemePreset };\nexport { DEFAULT_ACCENT };\n\nexport const THEME_KEY = 'ui-theme';\nexport const ACCENT_KEY = 'ui-accent';\n/** The picked accent's derived tokens, for themeScript. */\nconst ACCENT_VARS_KEY = 'ui-accent-vars';\nconst PRESET_ATTR = 'data-theme-preset';\n\nconst isSetting = (v: string | null): v is ThemeSetting => v === 'auto' || v === 'light' || v === 'dark';\nconst hasDom = () => typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/** A stored theme setting as text to the setting, 'auto' for anything else. */\nexport const parseTheme = (raw: string): ThemeSetting => (isSetting(raw) ? raw : 'auto');\n\n/** The stored theme setting, 'auto' when there is none (and on the server). */\nexport function storedTheme(): ThemeSetting {\n return hasDom() ? parseTheme(readStored(THEME_KEY) ?? '') : 'auto';\n}\n\n/** The preset on <html data-theme-preset>, or null (the light and dark themes). */\nexport function themePreset(): ThemePreset | null {\n if (typeof document === 'undefined') return null;\n const v = document.documentElement.getAttribute(PRESET_ATTR);\n return v && Object.hasOwn(PRESETS, v) ? (v as ThemePreset) : null;\n}\n\nfunction resolveTheme(t: ThemeSetting): 'light' | 'dark' {\n if (t !== 'auto') return t;\n return typeof window.matchMedia === 'function' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n}\n\nlet fadeTimer: ReturnType<typeof setTimeout> | undefined;\n\n/** Switches the theme on <html data-theme> and remembers it. Under a preset the setting is remembered but the\n * preset stays (the teaching preset is light only). */\nexport function setTheme(t: ThemeSetting): void {\n if (!hasDom()) return;\n const root = document.documentElement;\n if (!reduced()) {\n root.classList.add('ui-theme-fade');\n clearTimeout(fadeTimer);\n fadeTimer = setTimeout(() => root.classList.remove('ui-theme-fade'), 320);\n }\n root.setAttribute('data-theme', themePreset() ?? resolveTheme(t));\n root.setAttribute('data-theme-setting', t);\n writeStored(THEME_KEY, t);\n // The accent's text and soft colors depend on the theme.\n applyAccent();\n}\n\n/** Swatches whose color changed so they read as text on every ground: a stored old value moves to the new one. */\nconst RENAMED_SWATCHES: Record<string, string> = {\n '#8a4fd6': '#864ad1',\n '#c2407a': '#ba3873',\n '#cd3a2f': '#c53228',\n '#b85a0e': '#ab5101',\n '#1a844a': '#077b42',\n '#0e827d': '#027874',\n};\n\n/** A stored accent as text to #rrggbb, an old swatch value moved to its current one; null for anything else. */\nexport function parseAccent(raw: string): string | null {\n const v = raw.trim().toLowerCase();\n if (!/^#[0-9a-f]{6}$/.test(v)) return null;\n return RENAMED_SWATCHES[v] ?? v;\n}\n\n/** The accent the person picked (stored), with an old swatch value moved to its current one (and stored again);\n * null when they picked none, so tokens.css decides. */\nexport function pickedAccent(): string | null {\n if (!hasDom()) return null;\n const raw = readStored(ACCENT_KEY);\n const v = raw ? parseAccent(raw) : null;\n if (v && v !== raw) writeStored(ACCENT_KEY, v);\n return v;\n}\n\n/** The accent in use: the picked one, else the preset's accent, else the default (DEFAULT_ACCENT). */\nexport function storedAccent(): string {\n return pickedAccent() ?? defaultAccent();\n}\n\n/** The accent tokens.css gives when nothing is picked: the preset's, else DEFAULT_ACCENT. */\nexport function defaultAccent(): string {\n const p = themePreset();\n return p ? PRESETS[p].accent : DEFAULT_ACCENT;\n}\n\nconst hexRgb = (x: string): number[] => [1, 3, 5].map((i) => parseInt(x.slice(i, i + 2), 16));\n\n/** A CSS color as #rrggbb: #rgb, #rgba, #rrggbb, #rrggbbaa (alpha dropped), rgb() and rgba() with commas or spaces.\n * null for anything else (a name, a var(), an empty value). Bundlers shorten #ffffff to #fff in tokens.css, so the\n * short form must read the same. */\nexport function toHex(c: string): string | null {\n const v = c.trim().toLowerCase();\n const short = /^#([0-9a-f])([0-9a-f])([0-9a-f])[0-9a-f]?$/.exec(v);\n if (short) return '#' + short[1] + short[1] + short[2] + short[2] + short[3] + short[3];\n const long = /^#([0-9a-f]{6})(?:[0-9a-f]{2})?$/.exec(v);\n if (long) return '#' + long[1];\n const fn = /^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)(?:\\s*[,/]\\s*[\\d.]+%?)?\\s*\\)$/.exec(v);\n if (fn) {\n const n = fn.slice(1, 4).map(Number);\n if (n.every((x) => x >= 0 && x <= 255)) return '#' + n.map((x) => Math.round(x).toString(16).padStart(2, '0')).join('');\n }\n return null;\n}\n\nfunction mixHex(a: string, b: string, t: number): string {\n const p = hexRgb(a);\n const q = hexRgb(b);\n return (\n '#' +\n p\n .map((v, i) =>\n Math.round(v + (q[i] - v) * t)\n .toString(16)\n .padStart(2, '0'),\n )\n .join('')\n );\n}\n\nfunction lum(x: string): number {\n const w = [0.2126, 0.7152, 0.0722];\n return hexRgb(x)\n .map((v) => {\n v /= 255;\n return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;\n })\n .reduce((s, v, i) => s + v * w[i], 0);\n}\n\nfunction contrast(a: string, b: string): number {\n const x = lum(a);\n const y = lum(b);\n return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);\n}\n\n/** The accent's text color (accent-text, and the focus outline): the accent itself when it reads (4.5:1) on bg,\n * surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft); else, in\n * light, the accent mixed with black 4 % at a time, in dark with white 5 % at a time, until it reads on all of them. */\nexport function accentText(hex: string, dark: boolean, bg: string, surface: string, ...grounds: string[]): string {\n const all = [bg, surface, ...grounds].map(toHex);\n // A background that cannot be read: keep the accent itself rather than mixing it toward black or white blindly.\n if (all.some((g) => !g)) return hex;\n const reads = (c: string) => all.every((g) => contrast(c, g as string) >= 4.5);\n const toward = dark ? '#ffffff' : '#000000';\n const step = dark ? 0.05 : 0.04;\n let text = hex;\n for (let k = 1; k * step <= 1 && !reads(text); k++) text = mixHex(hex, toward, k * step);\n return text;\n}\n\nconst INK = GROUNDS.ink.light;\n\n/** The text on an accent fill (on-accent): white or the near-black ink (#171512), whichever contrasts more. */\nexport function onFill(fill: string): '#ffffff' | '#171512' {\n return contrast('#ffffff', fill) >= contrast(INK, fill) ? '#ffffff' : INK;\n}\n\n/** The accent's fill color (accent: buttons, switches, progress, selected marks): the accent itself when it reaches\n * 3:1 on bg, surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft) and\n * its on-accent text reaches 4.5:1 on it; else, in light, the accent mixed with black 4 % at a time, in dark with\n * white 5 % at a time, until both hold. The preset swatches pass in light as they are. */\nexport function accentFill(hex: string, dark: boolean, bg: string, surface: string, ...grounds: string[]): string {\n const all = [bg, surface, ...grounds].map(toHex);\n if (all.some((g) => !g)) return hex;\n const ok = (c: string) => all.every((g) => contrast(c, g as string) >= 3) && contrast(onFill(c), c) >= 4.5;\n const toward = dark ? '#ffffff' : '#000000';\n const step = dark ? 0.05 : 0.04;\n let fill = hex;\n for (let k = 1; k * step <= 1 && !ok(fill); k++) fill = mixHex(hex, toward, k * step);\n return fill;\n}\n\n/** The preset swatches of AccentPicker. In light (and the teaching preset) each one reads as text by itself (4.5:1 on\n * bg, surface, surface-sub, surface-chrome and its own accent-soft), so accentText returns it unchanged; white text\n * reads on it (4.5:1). In dark, accentText lightens it. Checked in tokens-contrast.test.tsx. */\nexport const ACCENT_SWATCHES: readonly (readonly [name: string, hex: string])[] = [\n ['藍', '#2457d6'],\n ['靛', '#5b4fd6'],\n ['紫', '#864ad1'],\n ['桃紅', '#ba3873'],\n ['紅', '#c53228'],\n ['橘', '#ab5101'],\n ['綠', '#077b42'],\n ['青', '#027874'],\n];\n\nconst ACCENT_VARS = ['--accent', '--accent-hover', '--accent-press', '--accent-soft', '--accent-text', '--on-accent', '--focus', '--focus-ring'];\n\n/** Every accent token for one color on one theme's grounds. */\nfunction accentVars(hex: string, dark: boolean, surface: string, bg: string, sub: string, chrome: string): Record<string, string> {\n const soft = dark ? mixHex(surface, hex, 0.22) : mixHex('#ffffff', hex, 0.12);\n // Text in the accent also sits on zebra rows, code blocks, the top bar and its own soft fill (a selected row).\n const text = accentText(hex, dark, bg, surface, sub, chrome, soft);\n // The fill reaches 3:1 on the same grounds (a checked box in a selected row); hover and press go away from the page:\n // darker in light, lighter in dark, so they keep 3:1 and their text.\n const fill = accentFill(hex, dark, bg, surface, sub, chrome, soft);\n const away = dark ? '#ffffff' : '#000000';\n return {\n '--accent': fill,\n '--accent-hover': mixHex(fill, away, 0.12),\n '--accent-press': mixHex(fill, away, 0.22),\n '--accent-soft': soft,\n '--accent-text': text,\n '--on-accent': onFill(fill),\n // One focus style everywhere: a 2 px outline in the accent's text color, 3:1 or more on every ground.\n '--focus': text,\n // Old name of --focus, kept for pages written before it.\n '--focus-ring': text,\n };\n}\n\n/** Derives every accent token from one color (自訂強調色的換算 in docs/theme.md) and writes them on <html>.\n * Returns false for anything but #rrggbb. quiet: apply without storing. */\nexport function setAccent(hex: string, quiet = false): boolean {\n if (!/^#[0-9a-fA-F]{6}$/.test(hex)) return false;\n if (!hasDom()) return true;\n hex = hex.toLowerCase();\n const root = document.documentElement;\n const dark = root.getAttribute('data-theme') === 'dark';\n const mode = dark ? 'dark' : 'light';\n const cs = getComputedStyle(root);\n // Read the theme's colors as #rrggbb (bundlers may have shortened #ffffff to #fff); the theme's defaults when unset.\n const surface = toHex(cs.getPropertyValue('--surface')) ?? GROUNDS.surface[mode];\n const bg = toHex(cs.getPropertyValue('--bg')) ?? GROUNDS.bg[mode];\n const sub = toHex(cs.getPropertyValue('--surface-sub')) ?? GROUNDS['surface-sub'][mode];\n const chrome = toHex(cs.getPropertyValue('--surface-chrome')) ?? GROUNDS['surface-chrome'][mode];\n const vars = accentVars(hex, dark, surface, bg, sub, chrome);\n for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);\n if (!quiet) writeStored(ACCENT_KEY, hex);\n // The picked accent's tokens for themeScript, which applies them before the first paint: this theme as drawn, the\n // other from the theme defaults (a preset is light only).\n if (readStored(ACCENT_KEY) === hex) {\n const other = !dark;\n const o = other ? 'dark' : 'light';\n const cache: Record<string, unknown> = { hex, [mode]: vars };\n if (!themePreset()) cache[o] = accentVars(hex, other, GROUNDS.surface[o], GROUNDS.bg[o], GROUNDS['surface-sub'][o], GROUNDS['surface-chrome'][o]);\n writeStored(ACCENT_VARS_KEY, JSON.stringify(cache));\n }\n return true;\n}\n\n/** Forgets the picked accent and removes the inline accent variables, so tokens.css (the theme or preset) decides. */\nexport function resetAccent(): void {\n if (!hasDom()) return;\n for (const k of ACCENT_VARS) document.documentElement.style.removeProperty(k);\n writeStored(ACCENT_KEY, null);\n writeStored(ACCENT_VARS_KEY, null);\n}\n\n/** Applies the picked accent for the current theme, or removes the inline variables when none is picked. */\nfunction applyAccent(): void {\n const picked = pickedAccent();\n if (picked) setAccent(picked, true);\n else for (const k of ACCENT_VARS) document.documentElement.style.removeProperty(k);\n}\n\nlet following = false;\n\n/** Applies the stored theme and accent; call once when the page starts. preset: a preset of tokens.json (such as\n * 'teaching') that replaces light and dark, kept on <html data-theme-preset>; null removes it; without the option a\n * data-theme-preset already on <html> is kept. Pages do not set data-theme themselves. */\nexport function initTheme(options: { preset?: ThemePreset | null } = {}): void {\n if (!hasDom()) return;\n const root = document.documentElement;\n if (options.preset === null) root.removeAttribute(PRESET_ATTR);\n else if (options.preset) root.setAttribute(PRESET_ATTR, options.preset);\n setTheme(storedTheme());\n ensureAnnouncer();\n installFocusMain();\n if (following || typeof window.matchMedia !== 'function') return;\n following = true;\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n if (storedTheme() === 'auto') setTheme('auto');\n });\n}\n\n/** The text color for something drawn on a fill (a heat-scale zone, a status band): the near-black ink of the light\n * theme (#171512) or white, whichever contrasts more with the fill. `fill` is a color (#hex, rgb()) or a token name\n * such as 'heat-6', read from el (default: the root) so it follows the theme. Every step of heat-*, diverge-* and\n * chart-* reaches 4.5:1 with its pick. Unreadable colors give the near-black ink. */\nexport function textOn(fill: string, el?: Element): '#171512' | '#ffffff' {\n let c = fill.trim();\n if (/^[a-z][a-z0-9-]*$/.test(c) && typeof document !== 'undefined') c = getComputedStyle(el ?? document.documentElement).getPropertyValue('--' + c);\n const hex = toHex(c);\n if (!hex) return '#171512';\n return contrast(hex, '#171512') >= contrast(hex, '#ffffff') ? '#171512' : '#ffffff';\n}\n\n/** The heat-scale token for a value: min (or below) is heat-1, max (or above) is heat-7, evenly in between. */\nexport function heatToken(value: number, min: number, max: number): `heat-${1 | 2 | 3 | 4 | 5 | 6 | 7}` {\n const t = max > min ? (value - min) / (max - min) : 0;\n const step = Math.min(7, Math.max(1, Math.round(t * 6) + 1)) as 1 | 2 | 3 | 4 | 5 | 6 | 7;\n return `heat-${step}`;\n}\n\n/** The diverging-scale token for a difference: within ±zero it is diverge-zero; from ±strong on, the -strong step. */\nexport function divergeToken(\n diff: number,\n limits: { zero: number; strong: number },\n): 'diverge-neg-strong' | 'diverge-neg' | 'diverge-zero' | 'diverge-pos' | 'diverge-pos-strong' {\n const a = Math.abs(diff);\n if (a <= limits.zero) return 'diverge-zero';\n const strong = a >= limits.strong;\n return diff < 0 ? (strong ? 'diverge-neg-strong' : 'diverge-neg') : strong ? 'diverge-pos-strong' : 'diverge-pos';\n}\n\n/**\n * A small script for an inline <script> in <head> of a server-rendered page: applies the stored theme (data-theme,\n * data-theme-setting) and the picked accent before the first paint, so the page does not flash the light theme or the\n * default accent until initTheme runs. A preset goes on <html data-theme-preset> in the server's markup; the script\n * keeps it. Still call initTheme() at startup.\n */\nexport const themeScript = `(function(){try{var d=document.documentElement,s=localStorage,t=s.getItem('${THEME_KEY}');if(t!=='light'&&t!=='dark')t='auto';var p=d.getAttribute('${PRESET_ATTR}');var m=t!=='auto'?t:window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';d.setAttribute('data-theme',p||m);d.setAttribute('data-theme-setting',t);var a=s.getItem('${ACCENT_KEY}'),c=JSON.parse(s.getItem('${ACCENT_VARS_KEY}')||'null'),v=a&&c&&c.hex===a&&c[p?'light':m];if(v)for(var k in v)d.style.setProperty(k,v[k])}catch(e){}})();`;\n"],"mappings":";;;;;;;AAeA,MAAa,YAAY;AACzB,MAAa,aAAa;;AAE1B,MAAM,kBAAkB;AACxB,MAAM,cAAc;AAEpB,MAAM,aAAa,MAAwC,MAAM,UAAU,MAAM,WAAW,MAAM;AAClG,MAAM,eAAe,OAAO,WAAW,eAAe,OAAO,aAAa;;AAG1E,MAAa,cAAc,QAA+B,UAAU,GAAG,IAAI,MAAM;;AAGjF,SAAgB,cAA4B;CAC1C,OAAO,OAAO,IAAI,WAAW,WAAA,UAAoB,KAAK,EAAE,IAAI;AAC9D;;AAGA,SAAgB,cAAkC;CAChD,IAAI,OAAO,aAAa,aAAa,OAAO;CAC5C,MAAM,IAAI,SAAS,gBAAgB,aAAa,WAAW;CAC3D,OAAO,KAAK,OAAO,OAAO,SAAS,CAAC,IAAK,IAAoB;AAC/D;AAEA,SAAS,aAAa,GAAmC;CACvD,IAAI,MAAM,QAAQ,OAAO;CACzB,OAAO,OAAO,OAAO,eAAe,cAAc,OAAO,WAAW,8BAA8B,CAAC,CAAC,UAAU,SAAS;AACzH;AAEA,IAAI;;;AAIJ,SAAgB,SAAS,GAAuB;CAC9C,IAAI,CAAC,OAAO,GAAG;CACf,MAAM,OAAO,SAAS;CACtB,IAAI,CAAC,QAAQ,GAAG;EACd,KAAK,UAAU,IAAI,eAAe;EAClC,aAAa,SAAS;EACtB,YAAY,iBAAiB,KAAK,UAAU,OAAO,eAAe,GAAG,GAAG;CAC1E;CACA,KAAK,aAAa,cAAc,YAAY,KAAK,aAAa,CAAC,CAAC;CAChE,KAAK,aAAa,sBAAsB,CAAC;CACzC,YAAY,WAAW,CAAC;CAExB,YAAY;AACd;;AA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,SAAS,KAAK,SAAS,KAAK,SAAS,KAAK,SAAS,IAAI,YAAY;AAC5E;;AAGA,SAAgB,UAAU,OAAe,KAAa,KAAkD;CACtG,MAAM,IAAI,MAAM,OAAO,QAAQ,QAAQ,MAAM,OAAO;CAEpD,OAAO,QADM,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,CACxC;AACpB;;AAGA,SAAgB,aACd,MACA,QAC8F;CAC9F,MAAM,IAAI,KAAK,IAAI,IAAI;CACvB,IAAI,KAAK,OAAO,MAAM,OAAO;CAC7B,MAAM,SAAS,KAAK,OAAO;CAC3B,OAAO,OAAO,IAAK,SAAS,uBAAuB,gBAAiB,SAAS,uBAAuB;AACtG;;;;;;;AAQA,MAAa,cAAc,8EAA8E,UAAU,+DAA+D,YAAY,uMAAuM,WAAW,6BAA6B,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"theme.js","names":[],"sources":["../src/theme.ts"],"sourcesContent":["import { ensureAnnouncer } from './announce';\nimport { DEFAULT_ACCENT, GROUNDS, PRESETS, type ThemePreset } from './generated/themeDefaults';\nimport { installFocusMain } from './internal/focusMain';\nimport { readStored, writeStored } from './internal/stored';\nimport { reduced } from './internal/util';\n\n/* Theme and accent color. 'auto' follows prefers-color-scheme; colors cross-fade for 300 ms on a change.\n The choice is kept in localStorage, so initTheme() on the next visit restores it. A preset (data-theme-preset on\n <html>, or initTheme({ preset })) replaces light and dark: the teaching preset is light only. The accent comes from\n tokens.css until the person picks one (setAccent); only then are inline --accent variables written. */\n\nexport type ThemeSetting = 'auto' | 'light' | 'dark';\nexport type { ThemePreset };\nexport { DEFAULT_ACCENT };\n\nexport const THEME_KEY = 'ui-theme';\nexport const ACCENT_KEY = 'ui-accent';\n/** The picked accent's derived tokens, for themeScript. */\nconst ACCENT_VARS_KEY = 'ui-accent-vars';\nconst PRESET_ATTR = 'data-theme-preset';\n\nconst isSetting = (v: string | null): v is ThemeSetting => v === 'auto' || v === 'light' || v === 'dark';\nconst hasDom = () => typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/** A stored theme setting as text to the setting, 'auto' for anything else. */\nexport const parseTheme = (raw: string): ThemeSetting => (isSetting(raw) ? raw : 'auto');\n\n/** The stored theme setting, 'auto' when there is none (and on the server). */\nexport function storedTheme(): ThemeSetting {\n return hasDom() ? parseTheme(readStored(THEME_KEY) ?? '') : 'auto';\n}\n\n/** The preset on <html data-theme-preset>, or null (the light and dark themes). */\nexport function themePreset(): ThemePreset | null {\n if (typeof document === 'undefined') return null;\n const v = document.documentElement.getAttribute(PRESET_ATTR);\n return v && Object.hasOwn(PRESETS, v) ? (v as ThemePreset) : null;\n}\n\nfunction resolveTheme(t: ThemeSetting): 'light' | 'dark' {\n if (t !== 'auto') return t;\n return typeof window.matchMedia === 'function' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n}\n\nlet fadeTimer: ReturnType<typeof setTimeout> | undefined;\n\n/** Switches the theme on <html data-theme> and remembers it. Under a preset the setting is remembered but the\n * preset stays (the teaching preset is light only). */\nexport function setTheme(t: ThemeSetting): void {\n if (!hasDom()) return;\n const root = document.documentElement;\n if (!reduced()) {\n root.classList.add('ui-theme-fade');\n clearTimeout(fadeTimer);\n fadeTimer = setTimeout(() => root.classList.remove('ui-theme-fade'), 320);\n }\n root.setAttribute('data-theme', themePreset() ?? resolveTheme(t));\n root.setAttribute('data-theme-setting', t);\n writeStored(THEME_KEY, t);\n // The accent's text and soft colors depend on the theme.\n applyAccent();\n}\n\n/** Swatches whose color changed so they read as text on every ground: a stored old value moves to the new one. */\nconst RENAMED_SWATCHES: Record<string, string> = {\n '#8a4fd6': '#864ad1',\n '#c2407a': '#ba3873',\n '#cd3a2f': '#c53228',\n '#b85a0e': '#ab5101',\n '#1a844a': '#077b42',\n '#0e827d': '#027874',\n};\n\n/** A stored accent as text to #rrggbb, an old swatch value moved to its current one; null for anything else. */\nexport function parseAccent(raw: string): string | null {\n const v = raw.trim().toLowerCase();\n if (!/^#[0-9a-f]{6}$/.test(v)) return null;\n return RENAMED_SWATCHES[v] ?? v;\n}\n\n/** The accent the person picked (stored), with an old swatch value moved to its current one (and stored again);\n * null when they picked none, so tokens.css decides. */\nexport function pickedAccent(): string | null {\n if (!hasDom()) return null;\n const raw = readStored(ACCENT_KEY);\n const v = raw ? parseAccent(raw) : null;\n if (v && v !== raw) writeStored(ACCENT_KEY, v);\n return v;\n}\n\n/** The accent in use: the picked one, else the preset's accent, else the default (DEFAULT_ACCENT). */\nexport function storedAccent(): string {\n return pickedAccent() ?? defaultAccent();\n}\n\n/** The accent tokens.css gives when nothing is picked: the preset's, else DEFAULT_ACCENT. */\nexport function defaultAccent(): string {\n const p = themePreset();\n return p ? PRESETS[p].accent : DEFAULT_ACCENT;\n}\n\nconst hexRgb = (x: string): number[] => [1, 3, 5].map((i) => parseInt(x.slice(i, i + 2), 16));\n\n/** A CSS color as #rrggbb: #rgb, #rgba, #rrggbb, #rrggbbaa (alpha dropped), rgb() and rgba() with commas or spaces.\n * null for anything else (a name, a var(), an empty value). Bundlers shorten #ffffff to #fff in tokens.css, so the\n * short form must read the same. */\nexport function toHex(c: string): string | null {\n const v = c.trim().toLowerCase();\n const short = /^#([0-9a-f])([0-9a-f])([0-9a-f])[0-9a-f]?$/.exec(v);\n if (short) return '#' + short[1] + short[1] + short[2] + short[2] + short[3] + short[3];\n const long = /^#([0-9a-f]{6})(?:[0-9a-f]{2})?$/.exec(v);\n if (long) return '#' + long[1];\n const fn = /^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)(?:\\s*[,/]\\s*[\\d.]+%?)?\\s*\\)$/.exec(v);\n if (fn) {\n const n = fn.slice(1, 4).map(Number);\n if (n.every((x) => x >= 0 && x <= 255)) return '#' + n.map((x) => Math.round(x).toString(16).padStart(2, '0')).join('');\n }\n return null;\n}\n\nfunction mixHex(a: string, b: string, t: number): string {\n const p = hexRgb(a);\n const q = hexRgb(b);\n return (\n '#' +\n p\n .map((v, i) =>\n Math.round(v + (q[i] - v) * t)\n .toString(16)\n .padStart(2, '0'),\n )\n .join('')\n );\n}\n\nfunction lum(x: string): number {\n const w = [0.2126, 0.7152, 0.0722];\n return hexRgb(x)\n .map((v) => {\n v /= 255;\n return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;\n })\n .reduce((s, v, i) => s + v * w[i], 0);\n}\n\nfunction contrast(a: string, b: string): number {\n const x = lum(a);\n const y = lum(b);\n return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);\n}\n\n/** The accent's text color (accent-text, and the focus outline): the accent itself when it reads (4.5:1) on bg,\n * surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft); else, in\n * light, the accent mixed with black 4 % at a time, in dark with white 5 % at a time, until it reads on all of them. */\nexport function accentText(hex: string, dark: boolean, bg: string, surface: string, ...grounds: string[]): string {\n const all = [bg, surface, ...grounds].map(toHex);\n // A background that cannot be read: keep the accent itself rather than mixing it toward black or white blindly.\n if (all.some((g) => !g)) return hex;\n const reads = (c: string) => all.every((g) => contrast(c, g as string) >= 4.5);\n const toward = dark ? '#ffffff' : '#000000';\n const step = dark ? 0.05 : 0.04;\n let text = hex;\n for (let k = 1; k * step <= 1 && !reads(text); k++) text = mixHex(hex, toward, k * step);\n return text;\n}\n\nconst INK = GROUNDS.ink.light;\n\n/** The text on an accent fill (on-accent): white or the near-black ink (#171512), whichever contrasts more. */\nexport function onFill(fill: string): '#ffffff' | '#171512' {\n return contrast('#ffffff', fill) >= contrast(INK, fill) ? '#ffffff' : INK;\n}\n\n/** The accent's fill color (accent: buttons, switches, progress, selected marks): the accent itself when it reaches\n * 3:1 on bg, surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft) and\n * its on-accent text reaches 4.5:1 on it; else, in light, the accent mixed with black 4 % at a time, in dark with\n * white 5 % at a time, until both hold. The preset swatches pass in light as they are. */\nexport function accentFill(hex: string, dark: boolean, bg: string, surface: string, ...grounds: string[]): string {\n const all = [bg, surface, ...grounds].map(toHex);\n if (all.some((g) => !g)) return hex;\n const ok = (c: string) => all.every((g) => contrast(c, g as string) >= 3) && contrast(onFill(c), c) >= 4.5;\n const toward = dark ? '#ffffff' : '#000000';\n const step = dark ? 0.05 : 0.04;\n let fill = hex;\n for (let k = 1; k * step <= 1 && !ok(fill); k++) fill = mixHex(hex, toward, k * step);\n return fill;\n}\n\n/** The preset swatches of AccentPicker. In light (and the teaching preset) each one reads as text by itself (4.5:1 on\n * bg, surface, surface-sub, surface-chrome and its own accent-soft), so accentText returns it unchanged; white text\n * reads on it (4.5:1). In dark, accentText lightens it. Checked in tokens-contrast.test.tsx. */\nexport const ACCENT_SWATCHES: readonly (readonly [name: string, hex: string])[] = [\n ['藍', '#2457d6'],\n ['靛', '#5b4fd6'],\n ['紫', '#864ad1'],\n ['桃紅', '#ba3873'],\n ['紅', '#c53228'],\n ['橘', '#ab5101'],\n ['綠', '#077b42'],\n ['青', '#027874'],\n];\n\nconst ACCENT_VARS = ['--accent', '--accent-hover', '--accent-press', '--accent-soft', '--accent-text', '--on-accent', '--focus', '--focus-ring'];\n\n/** Every accent token for one color on one theme's grounds. */\nfunction accentVars(hex: string, dark: boolean, surface: string, bg: string, sub: string, chrome: string): Record<string, string> {\n // Dark: the accent 18 % into the page ground, so muted and status text still read 4.5:1 on a selected row.\n const soft = dark ? mixHex(bg, hex, 0.18) : mixHex('#ffffff', hex, 0.12);\n // Text in the accent also sits on zebra rows, code blocks, the top bar and its own soft fill (a selected row).\n const text = accentText(hex, dark, bg, surface, sub, chrome, soft);\n // The fill reaches 3:1 on the same grounds (a checked box in a selected row); hover and press go away from the page:\n // darker in light, lighter in dark, so they keep 3:1 and their text.\n // Dark uses one accent color: the fill is the text color (lighter than a 3:1 fill would need), so buttons, links and\n // marks read as the same blue.\n const fill = dark ? text : accentFill(hex, dark, bg, surface, sub, chrome, soft);\n const away = dark ? '#ffffff' : '#000000';\n return {\n '--accent': fill,\n '--accent-hover': mixHex(fill, away, 0.12),\n '--accent-press': mixHex(fill, away, 0.22),\n '--accent-soft': soft,\n '--accent-text': text,\n '--on-accent': onFill(fill),\n // One focus style everywhere: a 2 px outline in the accent's text color, 3:1 or more on every ground.\n '--focus': text,\n // Old name of --focus, kept for pages written before it.\n '--focus-ring': text,\n };\n}\n\n/** Derives every accent token from one color (自訂強調色的換算 in docs/theme.md) and writes them on <html>.\n * Returns false for anything but #rrggbb. quiet: apply without storing. */\nexport function setAccent(hex: string, quiet = false): boolean {\n if (!/^#[0-9a-fA-F]{6}$/.test(hex)) return false;\n if (!hasDom()) return true;\n hex = hex.toLowerCase();\n const root = document.documentElement;\n const dark = root.getAttribute('data-theme') === 'dark';\n const mode = dark ? 'dark' : 'light';\n const cs = getComputedStyle(root);\n // Read the theme's colors as #rrggbb (bundlers may have shortened #ffffff to #fff); the theme's defaults when unset.\n const surface = toHex(cs.getPropertyValue('--surface')) ?? GROUNDS.surface[mode];\n const bg = toHex(cs.getPropertyValue('--bg')) ?? GROUNDS.bg[mode];\n const sub = toHex(cs.getPropertyValue('--surface-sub')) ?? GROUNDS['surface-sub'][mode];\n const chrome = toHex(cs.getPropertyValue('--surface-chrome')) ?? GROUNDS['surface-chrome'][mode];\n const vars = accentVars(hex, dark, surface, bg, sub, chrome);\n for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);\n if (!quiet) writeStored(ACCENT_KEY, hex);\n // The picked accent's tokens for themeScript, which applies them before the first paint: this theme as drawn, the\n // other from the theme defaults (a preset is light only).\n if (readStored(ACCENT_KEY) === hex) {\n const other = !dark;\n const o = other ? 'dark' : 'light';\n const cache: Record<string, unknown> = { hex, [mode]: vars };\n if (!themePreset()) cache[o] = accentVars(hex, other, GROUNDS.surface[o], GROUNDS.bg[o], GROUNDS['surface-sub'][o], GROUNDS['surface-chrome'][o]);\n writeStored(ACCENT_VARS_KEY, JSON.stringify(cache));\n }\n return true;\n}\n\n/** Forgets the picked accent and removes the inline accent variables, so tokens.css (the theme or preset) decides. */\nexport function resetAccent(): void {\n if (!hasDom()) return;\n for (const k of ACCENT_VARS) document.documentElement.style.removeProperty(k);\n writeStored(ACCENT_KEY, null);\n writeStored(ACCENT_VARS_KEY, null);\n}\n\n/** Applies the picked accent for the current theme, or removes the inline variables when none is picked. */\nfunction applyAccent(): void {\n const picked = pickedAccent();\n if (picked) setAccent(picked, true);\n else for (const k of ACCENT_VARS) document.documentElement.style.removeProperty(k);\n}\n\nlet following = false;\n\n/** Applies the stored theme and accent; call once when the page starts. preset: a preset of tokens.json (such as\n * 'teaching') that replaces light and dark, kept on <html data-theme-preset>; null removes it; without the option a\n * data-theme-preset already on <html> is kept. Pages do not set data-theme themselves. */\nexport function initTheme(options: { preset?: ThemePreset | null } = {}): void {\n if (!hasDom()) return;\n const root = document.documentElement;\n if (options.preset === null) root.removeAttribute(PRESET_ATTR);\n else if (options.preset) root.setAttribute(PRESET_ATTR, options.preset);\n setTheme(storedTheme());\n ensureAnnouncer();\n installFocusMain();\n if (following || typeof window.matchMedia !== 'function') return;\n following = true;\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n if (storedTheme() === 'auto') setTheme('auto');\n });\n}\n\n/** The text color for something drawn on a fill (a heat-scale zone, a status band): the near-black ink of the light\n * theme (#171512) or white, whichever contrasts more with the fill. `fill` is a color (#hex, rgb()) or a token name\n * such as 'heat-6', read from el (default: the root) so it follows the theme. Every step of heat-*, diverge-* and\n * chart-* reaches 4.5:1 with its pick. Unreadable colors give the near-black ink. */\nexport function textOn(fill: string, el?: Element): '#171512' | '#ffffff' {\n let c = fill.trim();\n if (/^[a-z][a-z0-9-]*$/.test(c) && typeof document !== 'undefined') c = getComputedStyle(el ?? document.documentElement).getPropertyValue('--' + c);\n const hex = toHex(c);\n if (!hex) return '#171512';\n return contrast(hex, '#171512') >= contrast(hex, '#ffffff') ? '#171512' : '#ffffff';\n}\n\n/** The heat-scale token for a value: min (or below) is heat-1, max (or above) is heat-7, evenly in between. */\nexport function heatToken(value: number, min: number, max: number): `heat-${1 | 2 | 3 | 4 | 5 | 6 | 7}` {\n const t = max > min ? (value - min) / (max - min) : 0;\n const step = Math.min(7, Math.max(1, Math.round(t * 6) + 1)) as 1 | 2 | 3 | 4 | 5 | 6 | 7;\n return `heat-${step}`;\n}\n\n/** The diverging-scale token for a difference: within ±zero it is diverge-zero; from ±strong on, the -strong step. */\nexport function divergeToken(\n diff: number,\n limits: { zero: number; strong: number },\n): 'diverge-neg-strong' | 'diverge-neg' | 'diverge-zero' | 'diverge-pos' | 'diverge-pos-strong' {\n const a = Math.abs(diff);\n if (a <= limits.zero) return 'diverge-zero';\n const strong = a >= limits.strong;\n return diff < 0 ? (strong ? 'diverge-neg-strong' : 'diverge-neg') : strong ? 'diverge-pos-strong' : 'diverge-pos';\n}\n\n/**\n * A small script for an inline <script> in <head> of a server-rendered page: applies the stored theme (data-theme,\n * data-theme-setting) and the picked accent before the first paint, so the page does not flash the light theme or the\n * default accent until initTheme runs. A preset goes on <html data-theme-preset> in the server's markup; the script\n * keeps it. Still call initTheme() at startup.\n */\nexport const themeScript = `(function(){try{var d=document.documentElement,s=localStorage,t=s.getItem('${THEME_KEY}');if(t!=='light'&&t!=='dark')t='auto';var p=d.getAttribute('${PRESET_ATTR}');var m=t!=='auto'?t:window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';d.setAttribute('data-theme',p||m);d.setAttribute('data-theme-setting',t);var a=s.getItem('${ACCENT_KEY}'),c=JSON.parse(s.getItem('${ACCENT_VARS_KEY}')||'null'),v=a&&c&&c.hex===a&&c[p?'light':m];if(v)for(var k in v)d.style.setProperty(k,v[k])}catch(e){}})();`;\n"],"mappings":";;;;;;;AAeA,MAAa,YAAY;AACzB,MAAa,aAAa;;AAE1B,MAAM,kBAAkB;AACxB,MAAM,cAAc;AAEpB,MAAM,aAAa,MAAwC,MAAM,UAAU,MAAM,WAAW,MAAM;AAClG,MAAM,eAAe,OAAO,WAAW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AM,SAAS,KAAK,OAAO;CAC3B,OAAO,OAAO,IAAK,SAAS,uBAAuB,gBAAiB,SAAS,uBAAuB;AACtG;;;;;;;AAQA,MAAa,cAAc,8EAA8E,UAAU,+DAA+D,YAAY,uMAAuM,WAAW,6BAA6B,gBAAgB"}
|
package/dist/tokens.css
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
--ink-muted: #6d645a;
|
|
14
14
|
--line: #e2dfdc;
|
|
15
15
|
--line-strong: #8c8073;
|
|
16
|
+
--line-soft: #f1efed;
|
|
16
17
|
--graph-edge: #8c8073;
|
|
17
18
|
--graph-node: #f6f5f4;
|
|
18
19
|
--code-keyword: #2457d6;
|
|
@@ -88,12 +89,13 @@
|
|
|
88
89
|
--space-5: 20px;
|
|
89
90
|
--space-6: 24px;
|
|
90
91
|
--space-8: 32px;
|
|
92
|
+
--block-gap: 32px;
|
|
91
93
|
--space-12: 48px;
|
|
92
94
|
--radius-xs: 4px;
|
|
93
|
-
--radius-sm:
|
|
95
|
+
--radius-sm: 8px;
|
|
94
96
|
--radius-chip: 8px;
|
|
95
97
|
--radius-md: 10px;
|
|
96
|
-
--radius-lg:
|
|
98
|
+
--radius-lg: 12px;
|
|
97
99
|
--radius-full: 9999px;
|
|
98
100
|
--shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.12);
|
|
99
101
|
--shadow-chip: 0 1px 2px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.08);
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
--chip-height: 32px;
|
|
105
107
|
--touch-target: 48px;
|
|
106
108
|
--header-height: 64px;
|
|
107
|
-
--sidebar-width:
|
|
109
|
+
--sidebar-width: 208px;
|
|
108
110
|
--sidebar-collapsed: 72px;
|
|
109
111
|
--tabbar-height: 68px;
|
|
110
112
|
--icon-stroke: 2px;
|
|
@@ -113,14 +115,14 @@
|
|
|
113
115
|
--bp-desktop: 960px;
|
|
114
116
|
--bp-wide: 1280px;
|
|
115
117
|
--text-mini: 12px;
|
|
116
|
-
--text-small:
|
|
118
|
+
--text-small: 12px;
|
|
117
119
|
--text-compact: 14px;
|
|
118
120
|
--text-control: 15px;
|
|
119
121
|
--text-body: 16px;
|
|
120
122
|
--text-title: 17px;
|
|
121
123
|
--text-lead: 18px;
|
|
122
124
|
--text-h4: 20px;
|
|
123
|
-
--text-h3:
|
|
125
|
+
--text-h3: 24px;
|
|
124
126
|
--text-h2: 31px;
|
|
125
127
|
--text-h1: 39px;
|
|
126
128
|
--text-display: 49px;
|
|
@@ -156,40 +158,41 @@
|
|
|
156
158
|
}
|
|
157
159
|
[data-theme="dark"] {
|
|
158
160
|
color-scheme: dark;
|
|
159
|
-
--bg: #
|
|
160
|
-
--surface: #
|
|
161
|
-
--surface-sub: #
|
|
162
|
-
--surface-chrome: #
|
|
161
|
+
--bg: #292725;
|
|
162
|
+
--surface: #393632;
|
|
163
|
+
--surface-sub: #413d38;
|
|
164
|
+
--surface-chrome: #34312e;
|
|
163
165
|
--surface-input: #26221e;
|
|
164
166
|
--ink: #f6f5f4;
|
|
165
|
-
--ink-muted: #
|
|
167
|
+
--ink-muted: #ada8a0;
|
|
166
168
|
--line: #4c4844;
|
|
167
169
|
--line-strong: #988c80;
|
|
168
|
-
--
|
|
169
|
-
--graph-
|
|
170
|
+
--line-soft: #433f3b;
|
|
171
|
+
--graph-edge: #ada8a0;
|
|
172
|
+
--graph-node: #413d38;
|
|
170
173
|
--code-keyword: #a3b7ee;
|
|
171
174
|
--code-constant: #3cc4ae;
|
|
172
|
-
--accent: #
|
|
173
|
-
--accent-hover: #
|
|
174
|
-
--accent-press: #
|
|
175
|
+
--accent: #92abeb;
|
|
176
|
+
--accent-hover: #9fb5ed;
|
|
177
|
+
--accent-press: #aabdef;
|
|
175
178
|
--accent-text: #92abeb;
|
|
176
|
-
--accent-soft: #
|
|
179
|
+
--accent-soft: #283045;
|
|
177
180
|
--on-accent: #171512;
|
|
178
181
|
--focus: #92abeb;
|
|
179
182
|
--focus-ring: #92abeb;
|
|
180
|
-
--success: #
|
|
181
|
-
--success-text: #
|
|
183
|
+
--success: #80cba5;
|
|
184
|
+
--success-text: #80cba5;
|
|
182
185
|
--success-soft: #2c3e2d;
|
|
183
|
-
--warning: #
|
|
184
|
-
--warning-text: #
|
|
186
|
+
--warning: #e6b66d;
|
|
187
|
+
--warning-text: #e6b66d;
|
|
185
188
|
--warning-soft: #4a3922;
|
|
186
|
-
--danger: #
|
|
189
|
+
--danger: #e58d8d;
|
|
187
190
|
--on-danger: #171512;
|
|
188
|
-
--danger-text: #
|
|
191
|
+
--danger-text: #e69292;
|
|
189
192
|
--danger-soft: #482a25;
|
|
190
193
|
--info-text: #90aaea;
|
|
191
194
|
--info-soft: #2d3141;
|
|
192
|
-
--danger-ring: #
|
|
195
|
+
--danger-ring: #e69292;
|
|
193
196
|
--mark: #7c5d12;
|
|
194
197
|
--chart-1: #819ee7;
|
|
195
198
|
--chart-2: #3cc4ae;
|
|
@@ -208,10 +211,10 @@
|
|
|
208
211
|
--diverge-pos: #d9772f;
|
|
209
212
|
--diverge-pos-strong: #f0a35e;
|
|
210
213
|
--forecast-stripe: rgba(246, 245, 244, 0.14);
|
|
211
|
-
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.
|
|
212
|
-
--shadow-chip: 0 1px 2px rgba(0, 0, 0, 0.
|
|
213
|
-
--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.
|
|
214
|
-
--shadow-card-hover: 0 2px
|
|
214
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
|
|
215
|
+
--shadow-chip: 0 1px 2px rgba(0, 0, 0, 0.28);
|
|
216
|
+
--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.24);
|
|
217
|
+
--shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.3);
|
|
215
218
|
--shadow-overlay: 0 20px 48px rgba(0, 0, 0, 0.5);
|
|
216
219
|
}
|
|
217
220
|
[data-theme="teaching"] {
|
|
@@ -234,4 +237,9 @@
|
|
|
234
237
|
--shadow-card: none;
|
|
235
238
|
--shadow-card-hover: none;
|
|
236
239
|
}
|
|
240
|
+
@media (max-width: 599px) {
|
|
241
|
+
:root {
|
|
242
|
+
--block-gap: 16px;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
237
245
|
}
|
package/docs/AiMark.md
CHANGED