@whatsaaaa/design-system 0.4.0 → 0.5.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/README.md +2 -2
- package/assets/manifest.json +12 -0
- package/assets/whatsaaaa/ghost-on-dark.svg +1 -0
- package/assets/whatsaaaa/ghost-on-light.svg +1 -0
- package/dist/css/base.css +14 -0
- package/dist/css/code.css +18 -0
- package/dist/css/ghost.css +27 -0
- package/dist/css/icons.css +1 -0
- package/dist/css/pairs.css +57 -0
- package/dist/css/segmented.css +71 -0
- package/dist/ghost/bubble.d.ts +2 -2
- package/dist/ghost/bubble.js +18 -10
- package/dist/ghost/index.d.ts +8 -2
- package/dist/ghost/index.js +50 -10
- package/dist/ghost/svg.d.ts +4 -0
- package/dist/ghost/svg.js +9 -0
- package/dist/index.css +211 -0
- package/dist/shiki/index.d.ts +19 -0
- package/dist/shiki/index.js +25 -0
- package/dist/tokens.css +42 -0
- package/dist/tokens.d.ts +7 -0
- package/dist/tokens.js +14 -0
- package/docs/usage.md +106 -32
- package/package.json +2 -1
- package/src/vitepress/styles/vars.css +2 -2
- package/tokens/contrast.json +18 -0
- package/tokens/core.tokens.json +53 -0
- package/tokens/theme-dark.tokens.json +16 -0
- package/tokens/theme-light.tokens.json +16 -0
package/dist/index.css
CHANGED
|
@@ -154,11 +154,14 @@
|
|
|
154
154
|
--ws-radius-sm: 4px;
|
|
155
155
|
--ws-radius-xl: 12px;
|
|
156
156
|
--ws-radius-xs: 3px;
|
|
157
|
+
--ws-size-check: 1.25rem;
|
|
157
158
|
--ws-size-content: 50rem;
|
|
159
|
+
--ws-size-control: 2.5rem;
|
|
158
160
|
--ws-size-frame: 90rem;
|
|
159
161
|
--ws-size-outline: 15rem;
|
|
160
162
|
--ws-size-sidebar: 17rem;
|
|
161
163
|
--ws-size-status-line: 2rem;
|
|
164
|
+
--ws-size-step: 1.5rem;
|
|
162
165
|
--ws-size-tab-bar: 3rem;
|
|
163
166
|
--ws-space-2: .125rem;
|
|
164
167
|
--ws-space-4: .25rem;
|
|
@@ -278,6 +281,18 @@
|
|
|
278
281
|
--ws-text-overline-font-weight: 700;
|
|
279
282
|
--ws-text-overline-letter-spacing: .06875rem;
|
|
280
283
|
--ws-text-overline-line-height: 1.5;
|
|
284
|
+
--ws-text-tagline: var(--ws-text-tagline-font-weight) var(--ws-text-tagline-font-size)/var(--ws-text-tagline-line-height) var(--ws-text-tagline-font-family);
|
|
285
|
+
--ws-text-tagline-compact: var(--ws-text-tagline-compact-font-weight) var(--ws-text-tagline-compact-font-size)/var(--ws-text-tagline-compact-line-height) var(--ws-text-tagline-compact-font-family);
|
|
286
|
+
--ws-text-tagline-compact-font-family: var(--ws-font-family-sans);
|
|
287
|
+
--ws-text-tagline-compact-font-size: 1.125rem;
|
|
288
|
+
--ws-text-tagline-compact-font-weight: 500;
|
|
289
|
+
--ws-text-tagline-compact-letter-spacing: 0rem;
|
|
290
|
+
--ws-text-tagline-compact-line-height: 1.5;
|
|
291
|
+
--ws-text-tagline-font-family: var(--ws-font-family-sans);
|
|
292
|
+
--ws-text-tagline-font-size: 1.25rem;
|
|
293
|
+
--ws-text-tagline-font-weight: 500;
|
|
294
|
+
--ws-text-tagline-letter-spacing: 0rem;
|
|
295
|
+
--ws-text-tagline-line-height: 1.5;
|
|
281
296
|
}
|
|
282
297
|
|
|
283
298
|
:root, [data-theme="dark"], .dark:where(:not([data-theme], .light)) {
|
|
@@ -294,6 +309,8 @@
|
|
|
294
309
|
--ws-color-danger-tint: #eb6f9217;
|
|
295
310
|
--ws-color-field-border: var(--ws-palette-main-muted);
|
|
296
311
|
--ws-color-interactive: var(--ws-palette-main-foam);
|
|
312
|
+
--ws-color-interactive-active: #bcf0f9;
|
|
313
|
+
--ws-color-interactive-hover: #acdfe8;
|
|
297
314
|
--ws-color-note: var(--ws-palette-main-iris);
|
|
298
315
|
--ws-color-note-text: var(--ws-palette-main-iris);
|
|
299
316
|
--ws-color-note-tint: #c4a7e717;
|
|
@@ -329,6 +346,8 @@
|
|
|
329
346
|
--ws-color-danger-tint: #b4637a17;
|
|
330
347
|
--ws-color-field-border: var(--ws-palette-dawn-subtle);
|
|
331
348
|
--ws-color-interactive: var(--ws-palette-dawn-pine);
|
|
349
|
+
--ws-color-interactive-active: #004d65;
|
|
350
|
+
--ws-color-interactive-hover: #165b74;
|
|
332
351
|
--ws-color-note: var(--ws-palette-dawn-iris);
|
|
333
352
|
--ws-color-note-text: var(--ws-palette-dawn-text);
|
|
334
353
|
--ws-color-note-tint: #907aa917;
|
|
@@ -365,6 +384,8 @@
|
|
|
365
384
|
--ws-color-danger-tint: #b4637a17;
|
|
366
385
|
--ws-color-field-border: var(--ws-palette-dawn-subtle);
|
|
367
386
|
--ws-color-interactive: var(--ws-palette-dawn-pine);
|
|
387
|
+
--ws-color-interactive-active: #004d65;
|
|
388
|
+
--ws-color-interactive-hover: #165b74;
|
|
368
389
|
--ws-color-note: var(--ws-palette-dawn-iris);
|
|
369
390
|
--ws-color-note-text: var(--ws-palette-dawn-text);
|
|
370
391
|
--ws-color-note-tint: #907aa917;
|
|
@@ -392,6 +413,7 @@
|
|
|
392
413
|
--ws-icon-tip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 1.8a4.3 4.3 0 0 0-2.3 7.9v1.5h4.6V9.7A4.3 4.3 0 0 0 8 1.8ZM6.4 13.6h3.2'/%3E%3C/svg%3E");
|
|
393
414
|
--ws-icon-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.2 14.2 13H1.8ZM8 6.6v3M8 11.3v.2'/%3E%3C/svg%3E");
|
|
394
415
|
--ws-icon-danger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.4 1.8h5.2l3.6 3.6v5.2l-3.6 3.6H5.4l-3.6-3.6V5.4ZM8 5v3.6M8 10.9v.2'/%3E%3C/svg%3E");
|
|
416
|
+
--ws-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E");
|
|
395
417
|
--ws-icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 2 8 7 2 12'/%3E%3C/svg%3E");
|
|
396
418
|
--ws-icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9 9 3M4.25 3H9v4.75'/%3E%3C/svg%3E");
|
|
397
419
|
}
|
|
@@ -436,6 +458,20 @@ code, kbd, samp, pre {
|
|
|
436
458
|
font-variant-ligatures: none;
|
|
437
459
|
}
|
|
438
460
|
|
|
461
|
+
input[type="number"] {
|
|
462
|
+
appearance: textfield;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
input[type="number"]::-webkit-inner-spin-button {
|
|
466
|
+
appearance: none;
|
|
467
|
+
margin: 0;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
471
|
+
appearance: none;
|
|
472
|
+
margin: 0;
|
|
473
|
+
}
|
|
474
|
+
|
|
439
475
|
:focus-visible {
|
|
440
476
|
border-radius: var(--ws-radius-sm);
|
|
441
477
|
outline: var(--ws-border-width-medium) solid var(--ws-color-interactive);
|
|
@@ -804,6 +840,24 @@ code, kbd, samp, pre {
|
|
|
804
840
|
overflow-x: auto;
|
|
805
841
|
}
|
|
806
842
|
|
|
843
|
+
.ws-code--wrap {
|
|
844
|
+
--ws-code-hang: 0;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.ws-code--wrap > pre {
|
|
848
|
+
white-space: pre-wrap;
|
|
849
|
+
overflow-wrap: anywhere;
|
|
850
|
+
overflow-x: visible;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.ws-code--wrap .line {
|
|
854
|
+
box-sizing: border-box;
|
|
855
|
+
width: 100%;
|
|
856
|
+
text-indent: calc(var(--ws-code-hang) * -1ch);
|
|
857
|
+
padding-inline-start: calc(var(--ws-code-hang) * 1ch);
|
|
858
|
+
display: inline-block;
|
|
859
|
+
}
|
|
860
|
+
|
|
807
861
|
.ws-code code {
|
|
808
862
|
font: inherit;
|
|
809
863
|
}
|
|
@@ -884,6 +938,136 @@ code, kbd, samp, pre {
|
|
|
884
938
|
margin: 0;
|
|
885
939
|
}
|
|
886
940
|
|
|
941
|
+
.ws-segmented {
|
|
942
|
+
max-width: 100%;
|
|
943
|
+
display: inline-flex;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.ws-segmented > button {
|
|
947
|
+
min-width: 0;
|
|
948
|
+
min-height: var(--ws-size-control);
|
|
949
|
+
padding: 0 var(--ws-space-16);
|
|
950
|
+
border: var(--ws-border-width-thin) solid var(--ws-color-field-border);
|
|
951
|
+
color: var(--ws-color-text-secondary);
|
|
952
|
+
font: var(--ws-text-label);
|
|
953
|
+
cursor: pointer;
|
|
954
|
+
background: none;
|
|
955
|
+
border-radius: 0;
|
|
956
|
+
margin: 0;
|
|
957
|
+
position: relative;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.ws-segmented > button:first-child {
|
|
961
|
+
border-start-start-radius: var(--ws-radius-md);
|
|
962
|
+
border-end-start-radius: var(--ws-radius-md);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.ws-segmented > button:last-child {
|
|
966
|
+
border-start-end-radius: var(--ws-radius-md);
|
|
967
|
+
border-end-end-radius: var(--ws-radius-md);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.ws-segmented > button + button {
|
|
971
|
+
margin-inline-start: calc(-1 * var(--ws-border-width-thin));
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.ws-segmented > button:hover {
|
|
975
|
+
z-index: 1;
|
|
976
|
+
border-color: var(--ws-color-text-secondary);
|
|
977
|
+
background: var(--ws-color-raised);
|
|
978
|
+
color: var(--ws-color-text);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.ws-segmented > button[aria-pressed="true"] {
|
|
982
|
+
z-index: 2;
|
|
983
|
+
border-color: var(--ws-color-interactive);
|
|
984
|
+
background: var(--ws-color-raised);
|
|
985
|
+
box-shadow: inset 0 0 0 var(--ws-border-width-thin) var(--ws-color-interactive);
|
|
986
|
+
color: var(--ws-color-text);
|
|
987
|
+
cursor: default;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.ws-segmented > button:focus-visible {
|
|
991
|
+
z-index: 3;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.ws-segmented > button:disabled {
|
|
995
|
+
z-index: 0;
|
|
996
|
+
border-color: var(--ws-color-text-faint);
|
|
997
|
+
color: var(--ws-color-text-faint);
|
|
998
|
+
cursor: not-allowed;
|
|
999
|
+
background: none;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
@media (forced-colors: active) {
|
|
1003
|
+
.ws-segmented > button[aria-pressed="true"] {
|
|
1004
|
+
box-shadow: none;
|
|
1005
|
+
color: highlighttext;
|
|
1006
|
+
forced-color-adjust: none;
|
|
1007
|
+
background: highlight;
|
|
1008
|
+
border-color: highlight;
|
|
1009
|
+
outline-color: highlight;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.ws-pairs {
|
|
1014
|
+
column-gap: var(--ws-space-16);
|
|
1015
|
+
border-bottom: var(--ws-border-width-thin) dashed var(--ws-color-border);
|
|
1016
|
+
grid-template-columns: fit-content(40%) minmax(0, 1fr);
|
|
1017
|
+
margin: 0;
|
|
1018
|
+
display: grid;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.ws-pairs > div {
|
|
1022
|
+
grid-column: 1 / -1;
|
|
1023
|
+
grid-template-columns: inherit;
|
|
1024
|
+
column-gap: inherit;
|
|
1025
|
+
padding-block: var(--ws-space-8);
|
|
1026
|
+
border-top: var(--ws-border-width-thin) dashed var(--ws-color-border);
|
|
1027
|
+
align-items: baseline;
|
|
1028
|
+
display: grid;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
@supports (grid-template-columns: subgrid) {
|
|
1032
|
+
.ws-pairs > div {
|
|
1033
|
+
grid-template-columns: subgrid;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.ws-pairs dt {
|
|
1038
|
+
color: var(--ws-color-text-secondary);
|
|
1039
|
+
font: var(--ws-text-label);
|
|
1040
|
+
overflow-wrap: anywhere;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
.ws-pairs dd {
|
|
1044
|
+
color: var(--ws-color-text);
|
|
1045
|
+
font-family: var(--ws-font-family-sans);
|
|
1046
|
+
font-size: var(--ws-font-size-16);
|
|
1047
|
+
line-height: var(--ws-font-line-height-normal);
|
|
1048
|
+
overflow-wrap: anywhere;
|
|
1049
|
+
margin: 0;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.ws-pairs--amounts {
|
|
1053
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
.ws-pairs--amounts dd {
|
|
1057
|
+
font-variant-numeric: tabular-nums;
|
|
1058
|
+
text-align: end;
|
|
1059
|
+
white-space: nowrap;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
.ws-pairs > .ws-pairs__total {
|
|
1063
|
+
border-top-style: solid;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.ws-pairs__total :is(dt, dd) {
|
|
1067
|
+
color: var(--ws-color-text);
|
|
1068
|
+
font-weight: var(--ws-font-weight-semibold);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
887
1071
|
:is(.ws-theme-dark, .ws-status-line__item--dark):where(:is([data-theme="light"], .light:where(:not([data-theme], .dark))), :is([data-theme="light"], .light:where(:not([data-theme], .dark))) *):not(:is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))), :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) *), :is(.ws-theme-dark, .ws-status-line__item--dark):where(:is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))), :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) *):not(:is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))), :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) *), :is(.ws-theme-light, .ws-status-line__item--light):where(:is([data-theme="dark"], .dark:where(:not([data-theme], .light))), :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) *):not(:is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))), :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) *), :is(.ws-theme-light, .ws-status-line__item--light):where(:is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))), :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) *):not(:is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))), :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) :is([data-theme="dark"], .dark:where(:not([data-theme], .light))) :is([data-theme="light"], .light:where(:not([data-theme], .dark))) *) {
|
|
888
1072
|
display: none !important;
|
|
889
1073
|
}
|
|
@@ -1374,6 +1558,33 @@ ws-ghost {
|
|
|
1374
1558
|
display: block;
|
|
1375
1559
|
}
|
|
1376
1560
|
|
|
1561
|
+
@media (width < 64rem) {
|
|
1562
|
+
ws-ghost[compact-px="1"] .ws-ghost__sprite {
|
|
1563
|
+
width: 10px;
|
|
1564
|
+
height: 12px;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
ws-ghost[compact-px="2"] .ws-ghost__sprite {
|
|
1568
|
+
width: 20px;
|
|
1569
|
+
height: 24px;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
ws-ghost[compact-px="3"] .ws-ghost__sprite {
|
|
1573
|
+
width: 30px;
|
|
1574
|
+
height: 36px;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
ws-ghost[compact-px="4"] .ws-ghost__sprite {
|
|
1578
|
+
width: 40px;
|
|
1579
|
+
height: 48px;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
ws-ghost[compact-px="5"] .ws-ghost__sprite {
|
|
1583
|
+
width: 50px;
|
|
1584
|
+
height: 60px;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1377
1588
|
.ws-ghost__body {
|
|
1378
1589
|
fill: currentColor;
|
|
1379
1590
|
}
|
package/dist/shiki/index.d.ts
CHANGED
|
@@ -18,3 +18,22 @@ export declare const codeTheme: {
|
|
|
18
18
|
};
|
|
19
19
|
}[];
|
|
20
20
|
};
|
|
21
|
+
/** The part of a Shiki line element the transformer writes to. */
|
|
22
|
+
interface LineElement {
|
|
23
|
+
properties: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A Shiki transformer for a code block that wraps, `ws-code--wrap`: it gives each line its
|
|
27
|
+
* hanging indent, `--ws-code-hang`, the width of its indent plus two, a tab counted as two as
|
|
28
|
+
* the block sets it. The rest of a wrapped line then starts one level in from the line's own
|
|
29
|
+
* text, so the shape of the code still reads.
|
|
30
|
+
*
|
|
31
|
+
* codeToHtml(code, { lang: 'json', theme: codeTheme, transformers: [hangingIndent()] })
|
|
32
|
+
*/
|
|
33
|
+
export declare function hangingIndent(): {
|
|
34
|
+
name: string;
|
|
35
|
+
line(this: {
|
|
36
|
+
source: string;
|
|
37
|
+
}, node: LineElement, line: number): void;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
package/dist/shiki/index.js
CHANGED
|
@@ -62,3 +62,28 @@ export const codeTheme = {
|
|
|
62
62
|
rule(['markup.deleted'], hex('syntax.keyword')),
|
|
63
63
|
],
|
|
64
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* A Shiki transformer for a code block that wraps, `ws-code--wrap`: it gives each line its
|
|
67
|
+
* hanging indent, `--ws-code-hang`, the width of its indent plus two, a tab counted as two as
|
|
68
|
+
* the block sets it. The rest of a wrapped line then starts one level in from the line's own
|
|
69
|
+
* text, so the shape of the code still reads.
|
|
70
|
+
*
|
|
71
|
+
* codeToHtml(code, { lang: 'json', theme: codeTheme, transformers: [hangingIndent()] })
|
|
72
|
+
*/
|
|
73
|
+
export function hangingIndent() {
|
|
74
|
+
let source = '';
|
|
75
|
+
let lines = [];
|
|
76
|
+
return {
|
|
77
|
+
name: 'whatsaaaa:hanging-indent',
|
|
78
|
+
line(node, line) {
|
|
79
|
+
if (this.source !== source) {
|
|
80
|
+
source = this.source;
|
|
81
|
+
lines = source.split(/\r?\n/);
|
|
82
|
+
}
|
|
83
|
+
const indent = /^[\t ]*/.exec(lines[line - 1] ?? '')[0];
|
|
84
|
+
const hang = indent.replaceAll('\t', ' ').length + 2;
|
|
85
|
+
const style = node.properties.style;
|
|
86
|
+
node.properties.style = `${typeof style === 'string' && style ? `${style.replace(/;?$/, ';')}` : ''}--ws-code-hang:${hang}`;
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
package/dist/tokens.css
CHANGED
|
@@ -120,8 +120,12 @@
|
|
|
120
120
|
--ws-radius-xl: 12px;
|
|
121
121
|
/* Key caps. */
|
|
122
122
|
--ws-radius-xs: 3px;
|
|
123
|
+
/* A checkbox or a radio button. */
|
|
124
|
+
--ws-size-check: 1.25rem;
|
|
123
125
|
/* Widest a column of long-form text gets, padding included. */
|
|
124
126
|
--ws-size-content: 50rem;
|
|
127
|
+
/* Height of a one-line field, a button and a segmented control. */
|
|
128
|
+
--ws-size-control: 2.5rem;
|
|
125
129
|
/* Widest a page frame gets. */
|
|
126
130
|
--ws-size-frame: 90rem;
|
|
127
131
|
/* Page outline. */
|
|
@@ -130,6 +134,8 @@
|
|
|
130
134
|
--ws-size-sidebar: 17rem;
|
|
131
135
|
/* Height of the status line. */
|
|
132
136
|
--ws-size-status-line: 2rem;
|
|
137
|
+
/* The number of a step in its circle. */
|
|
138
|
+
--ws-size-step: 1.5rem;
|
|
133
139
|
/* Height of the tab bar. */
|
|
134
140
|
--ws-size-tab-bar: 3rem;
|
|
135
141
|
--ws-space-2: 0.125rem;
|
|
@@ -346,6 +352,30 @@
|
|
|
346
352
|
--ws-text-overline-letter-spacing: 0.06875rem;
|
|
347
353
|
/* Group headings and table heads. Set in uppercase. */
|
|
348
354
|
--ws-text-overline-line-height: 1.5;
|
|
355
|
+
/* The line under the display name on a home page. */
|
|
356
|
+
--ws-text-tagline: var(--ws-text-tagline-font-weight) var(--ws-text-tagline-font-size)/var(--ws-text-tagline-line-height) var(--ws-text-tagline-font-family);
|
|
357
|
+
/* The tagline on phones. */
|
|
358
|
+
--ws-text-tagline-compact: var(--ws-text-tagline-compact-font-weight) var(--ws-text-tagline-compact-font-size)/var(--ws-text-tagline-compact-line-height) var(--ws-text-tagline-compact-font-family);
|
|
359
|
+
/* The tagline on phones. */
|
|
360
|
+
--ws-text-tagline-compact-font-family: var(--ws-font-family-sans);
|
|
361
|
+
/* The tagline on phones. */
|
|
362
|
+
--ws-text-tagline-compact-font-size: 1.125rem;
|
|
363
|
+
/* The tagline on phones. */
|
|
364
|
+
--ws-text-tagline-compact-font-weight: 500;
|
|
365
|
+
/* The tagline on phones. */
|
|
366
|
+
--ws-text-tagline-compact-letter-spacing: 0rem;
|
|
367
|
+
/* The tagline on phones. */
|
|
368
|
+
--ws-text-tagline-compact-line-height: 1.5;
|
|
369
|
+
/* The line under the display name on a home page. */
|
|
370
|
+
--ws-text-tagline-font-family: var(--ws-font-family-sans);
|
|
371
|
+
/* The line under the display name on a home page. */
|
|
372
|
+
--ws-text-tagline-font-size: 1.25rem;
|
|
373
|
+
/* The line under the display name on a home page. */
|
|
374
|
+
--ws-text-tagline-font-weight: 500;
|
|
375
|
+
/* The line under the display name on a home page. */
|
|
376
|
+
--ws-text-tagline-letter-spacing: 0rem;
|
|
377
|
+
/* The line under the display name on a home page. */
|
|
378
|
+
--ws-text-tagline-line-height: 1.5;
|
|
349
379
|
}
|
|
350
380
|
|
|
351
381
|
:root,
|
|
@@ -372,6 +402,10 @@
|
|
|
372
402
|
--ws-color-field-border: var(--ws-palette-main-muted);
|
|
373
403
|
/* Links, the focus ring, checked controls and the primary button fill. */
|
|
374
404
|
--ws-color-interactive: var(--ws-palette-main-foam);
|
|
405
|
+
/* The interactive fill while it is pressed: 0.1 further from the page in OKLab lightness. */
|
|
406
|
+
--ws-color-interactive-active: #bcf0f9;
|
|
407
|
+
/* The interactive fill under the pointer, such as a hovered primary button: the interactive color 0.05 further from the page in OKLab lightness. */
|
|
408
|
+
--ws-color-interactive-hover: #acdfe8;
|
|
375
409
|
/* Status note: bar and icon. */
|
|
376
410
|
--ws-color-note: var(--ws-palette-main-iris);
|
|
377
411
|
/* Status note: label text. */
|
|
@@ -435,6 +469,10 @@
|
|
|
435
469
|
--ws-color-field-border: var(--ws-palette-dawn-subtle);
|
|
436
470
|
/* Links, the focus ring, checked controls and the primary button fill. */
|
|
437
471
|
--ws-color-interactive: var(--ws-palette-dawn-pine);
|
|
472
|
+
/* The interactive fill while it is pressed: 0.1 further from the page in OKLab lightness. */
|
|
473
|
+
--ws-color-interactive-active: #004d65;
|
|
474
|
+
/* The interactive fill under the pointer, such as a hovered primary button: the interactive color 0.05 further from the page in OKLab lightness. */
|
|
475
|
+
--ws-color-interactive-hover: #165b74;
|
|
438
476
|
/* Status note: bar and icon. */
|
|
439
477
|
--ws-color-note: var(--ws-palette-dawn-iris);
|
|
440
478
|
/* Status note: label text. */
|
|
@@ -498,6 +536,10 @@
|
|
|
498
536
|
--ws-color-field-border: var(--ws-palette-dawn-subtle);
|
|
499
537
|
/* Links, the focus ring, checked controls and the primary button fill. */
|
|
500
538
|
--ws-color-interactive: var(--ws-palette-dawn-pine);
|
|
539
|
+
/* The interactive fill while it is pressed: 0.1 further from the page in OKLab lightness. */
|
|
540
|
+
--ws-color-interactive-active: #004d65;
|
|
541
|
+
/* The interactive fill under the pointer, such as a hovered primary button: the interactive color 0.05 further from the page in OKLab lightness. */
|
|
542
|
+
--ws-color-interactive-hover: #165b74;
|
|
501
543
|
/* Status note: bar and icon. */
|
|
502
544
|
--ws-color-note: var(--ws-palette-dawn-iris);
|
|
503
545
|
/* Status note: label text. */
|
package/dist/tokens.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export interface Tokens {
|
|
|
51
51
|
"color.danger-tint": Color;
|
|
52
52
|
"color.field-border": Color;
|
|
53
53
|
"color.interactive": Color;
|
|
54
|
+
"color.interactive-active": Color;
|
|
55
|
+
"color.interactive-hover": Color;
|
|
54
56
|
"color.note": Color;
|
|
55
57
|
"color.note-text": Color;
|
|
56
58
|
"color.note-tint": Color;
|
|
@@ -141,11 +143,14 @@ export interface Tokens {
|
|
|
141
143
|
"radius.sm": Dimension;
|
|
142
144
|
"radius.xl": Dimension;
|
|
143
145
|
"radius.xs": Dimension;
|
|
146
|
+
"size.check": Dimension;
|
|
144
147
|
"size.content": Dimension;
|
|
148
|
+
"size.control": Dimension;
|
|
145
149
|
"size.frame": Dimension;
|
|
146
150
|
"size.outline": Dimension;
|
|
147
151
|
"size.sidebar": Dimension;
|
|
148
152
|
"size.status-line": Dimension;
|
|
153
|
+
"size.step": Dimension;
|
|
149
154
|
"size.tab-bar": Dimension;
|
|
150
155
|
"space.2": Dimension;
|
|
151
156
|
"space.4": Dimension;
|
|
@@ -185,6 +190,8 @@ export interface Tokens {
|
|
|
185
190
|
"text.label-sm": Typography;
|
|
186
191
|
"text.lead": Typography;
|
|
187
192
|
"text.overline": Typography;
|
|
193
|
+
"text.tagline": Typography;
|
|
194
|
+
"text.tagline-compact": Typography;
|
|
188
195
|
}
|
|
189
196
|
|
|
190
197
|
/** Produce a token set from a given input. */
|
package/dist/tokens.js
CHANGED
|
@@ -25,6 +25,8 @@ export const PERMUTATIONS = {
|
|
|
25
25
|
"color.danger-tint":{"$type":"color","$description":"Status danger: block background.","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"alpha":0.09,"hex":"#eb6f92"}},
|
|
26
26
|
"color.field-border":{"$type":"color","$description":"Input and button outlines. At least 3:1 on surface.","$value":{"colorSpace":"srgb","components":[0.4314,0.4157,0.5255],"hex":"#6e6a86","alpha":1}},
|
|
27
27
|
"color.interactive":{"$type":"color","$description":"Links, the focus ring, checked controls and the primary button fill.","$value":{"colorSpace":"srgb","components":[0.6118,0.8118,0.8471],"hex":"#9ccfd8","alpha":1}},
|
|
28
|
+
"color.interactive-active":{"$type":"color","$description":"The interactive fill while it is pressed: 0.1 further from the page in OKLab lightness.","$value":{"colorSpace":"srgb","components":[0.7373,0.9412,0.9765],"hex":"#bcf0f9","alpha":1}},
|
|
29
|
+
"color.interactive-hover":{"$type":"color","$description":"The interactive fill under the pointer, such as a hovered primary button: the interactive color 0.05 further from the page in OKLab lightness.","$value":{"colorSpace":"srgb","components":[0.6745,0.8745,0.9098],"hex":"#acdfe8","alpha":1}},
|
|
28
30
|
"color.note":{"$type":"color","$description":"Status note: bar and icon.","$value":{"colorSpace":"srgb","components":[0.7686,0.6549,0.9059],"hex":"#c4a7e7","alpha":1}},
|
|
29
31
|
"color.note-text":{"$type":"color","$description":"Status note: label text.","$value":{"colorSpace":"srgb","components":[0.7686,0.6549,0.9059],"hex":"#c4a7e7","alpha":1}},
|
|
30
32
|
"color.note-tint":{"$type":"color","$description":"Status note: block background.","$value":{"colorSpace":"srgb","components":[0.7686,0.6549,0.9059],"alpha":0.09,"hex":"#c4a7e7"}},
|
|
@@ -115,11 +117,14 @@ export const PERMUTATIONS = {
|
|
|
115
117
|
"radius.sm":{"$type":"dimension","$description":"Inline code, tags and the focus ring.","$value":{"value":4,"unit":"px"}},
|
|
116
118
|
"radius.xl":{"$type":"dimension","$description":"The terminal frame.","$value":{"value":12,"unit":"px"}},
|
|
117
119
|
"radius.xs":{"$type":"dimension","$description":"Key caps.","$value":{"value":3,"unit":"px"}},
|
|
120
|
+
"size.check":{"$type":"dimension","$description":"A checkbox or a radio button.","$value":{"value":1.25,"unit":"rem"}},
|
|
118
121
|
"size.content":{"$type":"dimension","$description":"Widest a column of long-form text gets, padding included.","$value":{"value":50,"unit":"rem"}},
|
|
122
|
+
"size.control":{"$type":"dimension","$description":"Height of a one-line field, a button and a segmented control.","$value":{"value":2.5,"unit":"rem"}},
|
|
119
123
|
"size.frame":{"$type":"dimension","$description":"Widest a page frame gets.","$value":{"value":90,"unit":"rem"}},
|
|
120
124
|
"size.outline":{"$type":"dimension","$description":"Page outline.","$value":{"value":15,"unit":"rem"}},
|
|
121
125
|
"size.sidebar":{"$type":"dimension","$description":"Side navigation.","$value":{"value":17,"unit":"rem"}},
|
|
122
126
|
"size.status-line":{"$type":"dimension","$description":"Height of the status line.","$value":{"value":2,"unit":"rem"}},
|
|
127
|
+
"size.step":{"$type":"dimension","$description":"The number of a step in its circle.","$value":{"value":1.5,"unit":"rem"}},
|
|
123
128
|
"size.tab-bar":{"$type":"dimension","$description":"Height of the tab bar.","$value":{"value":3,"unit":"rem"}},
|
|
124
129
|
"space.2":{"$type":"dimension","$value":{"value":0.125,"unit":"rem"}},
|
|
125
130
|
"space.4":{"$type":"dimension","$value":{"value":0.25,"unit":"rem"}},
|
|
@@ -159,6 +164,8 @@ export const PERMUTATIONS = {
|
|
|
159
164
|
"text.label-sm":{"$type":"typography","$description":"Side navigation and tags.","$value":{"fontFamily":["JetBrains Mono","ui-monospace","SFMono-Regular","Menlo","Consolas","monospace"],"fontSize":{"value":0.8125,"unit":"rem"},"fontWeight":400,"lineHeight":1.5,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
160
165
|
"text.lead":{"$type":"typography","$description":"The first paragraph of a page.","$value":{"fontFamily":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"],"fontSize":{"value":1.0625,"unit":"rem"},"fontWeight":400,"lineHeight":1.75,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
161
166
|
"text.overline":{"$type":"typography","$description":"Group headings and table heads. Set in uppercase.","$value":{"fontFamily":["JetBrains Mono","ui-monospace","SFMono-Regular","Menlo","Consolas","monospace"],"fontSize":{"value":0.6875,"unit":"rem"},"fontWeight":700,"lineHeight":1.5,"letterSpacing":{"value":0.06875,"unit":"rem"}}},
|
|
167
|
+
"text.tagline":{"$type":"typography","$description":"The line under the display name on a home page.","$value":{"fontFamily":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"],"fontSize":{"value":1.25,"unit":"rem"},"fontWeight":500,"lineHeight":1.5,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
168
|
+
"text.tagline-compact":{"$type":"typography","$description":"The tagline on phones.","$value":{"fontFamily":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"],"fontSize":{"value":1.125,"unit":"rem"},"fontWeight":500,"lineHeight":1.5,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
162
169
|
},
|
|
163
170
|
"{\"theme\":\"light\"}": {
|
|
164
171
|
"border-width.medium":{"$type":"dimension","$description":"Active markers and the focus ring.","$value":{"value":2,"unit":"px"}},
|
|
@@ -183,6 +190,8 @@ export const PERMUTATIONS = {
|
|
|
183
190
|
"color.danger-tint":{"$type":"color","$description":"Status danger: block background.","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"alpha":0.09,"hex":"#b4637a"}},
|
|
184
191
|
"color.field-border":{"$type":"color","$description":"Input and button outlines. At least 3:1 on surface.","$value":{"colorSpace":"srgb","components":[0.4745,0.4588,0.5765],"hex":"#797593","alpha":1}},
|
|
185
192
|
"color.interactive":{"$type":"color","$description":"Links, the focus ring, checked controls and the primary button fill.","$value":{"colorSpace":"srgb","components":[0.1569,0.4118,0.5137],"hex":"#286983","alpha":1}},
|
|
193
|
+
"color.interactive-active":{"$type":"color","$description":"The interactive fill while it is pressed: 0.1 further from the page in OKLab lightness.","$value":{"colorSpace":"srgb","components":[0,0.302,0.3961],"hex":"#004d65","alpha":1}},
|
|
194
|
+
"color.interactive-hover":{"$type":"color","$description":"The interactive fill under the pointer, such as a hovered primary button: the interactive color 0.05 further from the page in OKLab lightness.","$value":{"colorSpace":"srgb","components":[0.0863,0.3569,0.4549],"hex":"#165b74","alpha":1}},
|
|
186
195
|
"color.note":{"$type":"color","$description":"Status note: bar and icon.","$value":{"colorSpace":"srgb","components":[0.5647,0.4784,0.6627],"hex":"#907aa9","alpha":1}},
|
|
187
196
|
"color.note-text":{"$type":"color","$description":"Status note: label text.","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
|
|
188
197
|
"color.note-tint":{"$type":"color","$description":"Status note: block background.","$value":{"colorSpace":"srgb","components":[0.5647,0.4784,0.6627],"alpha":0.09,"hex":"#907aa9"}},
|
|
@@ -273,11 +282,14 @@ export const PERMUTATIONS = {
|
|
|
273
282
|
"radius.sm":{"$type":"dimension","$description":"Inline code, tags and the focus ring.","$value":{"value":4,"unit":"px"}},
|
|
274
283
|
"radius.xl":{"$type":"dimension","$description":"The terminal frame.","$value":{"value":12,"unit":"px"}},
|
|
275
284
|
"radius.xs":{"$type":"dimension","$description":"Key caps.","$value":{"value":3,"unit":"px"}},
|
|
285
|
+
"size.check":{"$type":"dimension","$description":"A checkbox or a radio button.","$value":{"value":1.25,"unit":"rem"}},
|
|
276
286
|
"size.content":{"$type":"dimension","$description":"Widest a column of long-form text gets, padding included.","$value":{"value":50,"unit":"rem"}},
|
|
287
|
+
"size.control":{"$type":"dimension","$description":"Height of a one-line field, a button and a segmented control.","$value":{"value":2.5,"unit":"rem"}},
|
|
277
288
|
"size.frame":{"$type":"dimension","$description":"Widest a page frame gets.","$value":{"value":90,"unit":"rem"}},
|
|
278
289
|
"size.outline":{"$type":"dimension","$description":"Page outline.","$value":{"value":15,"unit":"rem"}},
|
|
279
290
|
"size.sidebar":{"$type":"dimension","$description":"Side navigation.","$value":{"value":17,"unit":"rem"}},
|
|
280
291
|
"size.status-line":{"$type":"dimension","$description":"Height of the status line.","$value":{"value":2,"unit":"rem"}},
|
|
292
|
+
"size.step":{"$type":"dimension","$description":"The number of a step in its circle.","$value":{"value":1.5,"unit":"rem"}},
|
|
281
293
|
"size.tab-bar":{"$type":"dimension","$description":"Height of the tab bar.","$value":{"value":3,"unit":"rem"}},
|
|
282
294
|
"space.2":{"$type":"dimension","$value":{"value":0.125,"unit":"rem"}},
|
|
283
295
|
"space.4":{"$type":"dimension","$value":{"value":0.25,"unit":"rem"}},
|
|
@@ -317,6 +329,8 @@ export const PERMUTATIONS = {
|
|
|
317
329
|
"text.label-sm":{"$type":"typography","$description":"Side navigation and tags.","$value":{"fontFamily":["JetBrains Mono","ui-monospace","SFMono-Regular","Menlo","Consolas","monospace"],"fontSize":{"value":0.8125,"unit":"rem"},"fontWeight":400,"lineHeight":1.5,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
318
330
|
"text.lead":{"$type":"typography","$description":"The first paragraph of a page.","$value":{"fontFamily":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"],"fontSize":{"value":1.0625,"unit":"rem"},"fontWeight":400,"lineHeight":1.75,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
319
331
|
"text.overline":{"$type":"typography","$description":"Group headings and table heads. Set in uppercase.","$value":{"fontFamily":["JetBrains Mono","ui-monospace","SFMono-Regular","Menlo","Consolas","monospace"],"fontSize":{"value":0.6875,"unit":"rem"},"fontWeight":700,"lineHeight":1.5,"letterSpacing":{"value":0.06875,"unit":"rem"}}},
|
|
332
|
+
"text.tagline":{"$type":"typography","$description":"The line under the display name on a home page.","$value":{"fontFamily":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"],"fontSize":{"value":1.25,"unit":"rem"},"fontWeight":500,"lineHeight":1.5,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
333
|
+
"text.tagline-compact":{"$type":"typography","$description":"The tagline on phones.","$value":{"fontFamily":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"],"fontSize":{"value":1.125,"unit":"rem"},"fontWeight":500,"lineHeight":1.5,"letterSpacing":{"value":0,"unit":"rem"}}},
|
|
320
334
|
},
|
|
321
335
|
};
|
|
322
336
|
const INPUT_DEFAULTS = {"theme":"dark"};
|