@inkra/react 0.9.0 → 0.10.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 +48 -2
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/Xiaolai-OFL.txt +94 -0
- package/dist/PencilText.js +4 -1
- package/dist/assets/ui-hand-xiaolai-extended.woff2 +0 -0
- package/dist/assets/ui-hand-xiaolai.woff2 +0 -0
- package/dist/assets/xiaolai.css +17 -0
- package/dist/form/EditablePencilText.js +4 -2
- package/dist/i18n/catalog.d.ts +1 -1
- package/dist/i18n/catalog.js +2 -0
- package/dist/internal/surfaceRenderer.d.ts +4 -4
- package/dist/internal/surfaceRenderer.js +2 -2
- package/dist/internal/textRenderer.d.ts +1 -1
- package/dist/internal/textRenderer.js +23 -11
- package/dist/selection/CircularSwitchVisual.d.ts +8 -0
- package/dist/selection/CircularSwitchVisual.js +82 -0
- package/dist/selection/Switch.d.ts +7 -0
- package/dist/selection/Switch.js +15 -3
- package/dist/slider/circular.d.ts +35 -0
- package/dist/slider/circular.js +196 -0
- package/dist/slider/circularMath.d.ts +10 -0
- package/dist/slider/circularMath.js +34 -0
- package/dist/slider/index.d.ts +5 -0
- package/dist/slider/index.js +5 -3
- package/dist/styles/base.css +4 -2
- package/dist/styles/breadcrumb.css +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/number-ticker.css +1 -1
- package/dist/styles/selection.css +50 -0
- package/dist/styles/slider.css +65 -0
- package/dist/styles/slot.css +1 -1
- package/dist/styles.css +123 -6
- package/dist/tokens.css +13 -10
- package/package.json +3 -2
package/dist/styles.css
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
@import "./tokens.css";
|
|
2
2
|
|
|
3
|
+
@import "./assets/xiaolai.css";
|
|
4
|
+
|
|
3
5
|
@font-face {
|
|
4
6
|
font-family: "Trip Map Hand";
|
|
5
7
|
font-style: normal;
|
|
@@ -129,13 +131,13 @@
|
|
|
129
131
|
.inkra-pencil-text__source {
|
|
130
132
|
color: inherit;
|
|
131
133
|
font: inherit;
|
|
132
|
-
font-family: "Trip Map Hand", "HanziPen SC", "Hannotate SC", "Kaiti SC", "STKaiti", cursive;
|
|
133
134
|
font-kerning: none;
|
|
134
135
|
font-variant-ligatures: none;
|
|
135
136
|
letter-spacing: 0;
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
.inkra-pencil-text {
|
|
140
|
+
font-family: var(--inkra-font-hand);
|
|
139
141
|
display: inline-block;
|
|
140
142
|
max-width: 100%;
|
|
141
143
|
min-width: 0;
|
|
@@ -216,7 +218,7 @@
|
|
|
216
218
|
color: var(--inkra-on-accent, var(--inkra-accent-strong));
|
|
217
219
|
cursor: pointer;
|
|
218
220
|
display: inline-flex;
|
|
219
|
-
font-family:
|
|
221
|
+
font-family: var(--inkra-font-hand);
|
|
220
222
|
font-weight: var(--inkra-weight-regular);
|
|
221
223
|
justify-content: center;
|
|
222
224
|
letter-spacing: var(--inkra-letter-spacing);
|
|
@@ -1412,6 +1414,17 @@
|
|
|
1412
1414
|
width: var(--inkra-slider-thumb-size);
|
|
1413
1415
|
}
|
|
1414
1416
|
|
|
1417
|
+
/* Radix insets its measured hit target by half a thumb at each endpoint.
|
|
1418
|
+
Translate the whole target back so its visual center follows the track;
|
|
1419
|
+
percentages use the actual thumb box and preserve its 44px hit area. */
|
|
1420
|
+
.inkra-slider[data-thumb-alignment="edge"] .inkra-slider__thumb {
|
|
1421
|
+
translate: var(--inkra-slider-thumb-offset) 0;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
.inkra-slider[data-thumb-alignment="edge"][data-orientation="vertical"] .inkra-slider__thumb {
|
|
1425
|
+
translate: 0 var(--inkra-slider-thumb-offset);
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1415
1428
|
.inkra-slider__thumb:focus-visible {
|
|
1416
1429
|
outline: none;
|
|
1417
1430
|
}
|
|
@@ -1458,6 +1471,60 @@
|
|
|
1458
1471
|
}
|
|
1459
1472
|
}
|
|
1460
1473
|
|
|
1474
|
+
.inkra-circular-slider {
|
|
1475
|
+
box-sizing: border-box;
|
|
1476
|
+
color: var(--inkra-ink);
|
|
1477
|
+
cursor: pointer;
|
|
1478
|
+
display: inline-flex;
|
|
1479
|
+
flex: none;
|
|
1480
|
+
align-items: center;
|
|
1481
|
+
justify-content: center;
|
|
1482
|
+
width: var(--inkra-circular-slider-diameter);
|
|
1483
|
+
height: var(--inkra-circular-slider-diameter);
|
|
1484
|
+
position: relative;
|
|
1485
|
+
touch-action: none;
|
|
1486
|
+
user-select: none;
|
|
1487
|
+
vertical-align: middle;
|
|
1488
|
+
outline: none;
|
|
1489
|
+
}
|
|
1490
|
+
.inkra-circular-slider[data-disabled] { cursor: not-allowed; opacity: .55; }
|
|
1491
|
+
.inkra-circular-slider[data-readonly] { cursor: default; }
|
|
1492
|
+
.inkra-circular-slider__arc { position: absolute; inset: 16px; pointer-events: none; }
|
|
1493
|
+
.inkra-circular-slider__track, .inkra-circular-slider__range { position: absolute; inset: 0; }
|
|
1494
|
+
.inkra-circular-slider__track { color: var(--inkra-ink-muted); opacity: .3; }
|
|
1495
|
+
.inkra-circular-slider__range { color: var(--inkra-accent-strong); }
|
|
1496
|
+
/* ProgressRing shares the stable pencil texture; these scoped rules also support slider-only styles. */
|
|
1497
|
+
.inkra-circular-slider .inkra-progress__ring { color: inherit; }
|
|
1498
|
+
.inkra-circular-slider .inkra-progress__ring,
|
|
1499
|
+
.inkra-circular-slider .inkra-progress__ring-rotation,
|
|
1500
|
+
.inkra-circular-slider .inkra-progress__ring-direction,
|
|
1501
|
+
.inkra-circular-slider .inkra-progress__ring-ink,
|
|
1502
|
+
.inkra-circular-slider .inkra-progress__ring-fallback { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
|
|
1503
|
+
.inkra-circular-slider .inkra-progress__ring-ink { visibility: hidden; }
|
|
1504
|
+
.inkra-circular-slider .inkra-progress__ring-ink[data-ready="true"] { visibility: visible; }
|
|
1505
|
+
.inkra-circular-slider .inkra-progress__ring-ink[data-ready="true"] + .inkra-progress__ring-fallback { visibility: hidden; }
|
|
1506
|
+
.inkra-circular-slider__center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px; box-sizing: border-box; width: var(--inkra-circular-slider-center-width); max-height: var(--inkra-circular-slider-center-height); min-width: 0; overflow: hidden; pointer-events: none; text-align: center; }
|
|
1507
|
+
.inkra-circular-slider__center-icon { display: flex; align-items: center; justify-content: center; flex: none; width: min(var(--inkra-circular-slider-center-icon-size), 100%); height: var(--inkra-circular-slider-center-icon-size); }
|
|
1508
|
+
.inkra-circular-slider__center-icon > * { max-width: 100%; max-height: 100%; }
|
|
1509
|
+
.inkra-circular-slider__center-content { width: 100%; min-width: 0; max-width: 100%; max-height: var(--inkra-circular-slider-center-height); overflow-wrap: anywhere; }
|
|
1510
|
+
.inkra-circular-slider__center-content > * { max-width: 100%; }
|
|
1511
|
+
.inkra-circular-slider__value { display: block; white-space: nowrap; max-width: 100%; pointer-events: none; text-align: center; font-size: var(--inkra-circular-slider-center-font-size); line-height: var(--inkra-circular-slider-center-line-height); }
|
|
1512
|
+
.inkra-circular-slider__thumb { position: absolute; transform: translate(-50%, -50%); width: var(--inkra-touch-target); height: var(--inkra-touch-target); display: flex; align-items: center; justify-content: center; pointer-events: none; }
|
|
1513
|
+
.inkra-circular-slider__thumb-surface { display: block !important; width: var(--inkra-circular-slider-thumb-size); height: var(--inkra-circular-slider-thumb-size); border-radius: 50%; }
|
|
1514
|
+
.inkra-circular-slider__focus-ring { --inkra-ink: var(--inkra-focus); position: absolute !important; inset: -4px; opacity: 0; pointer-events: none; }
|
|
1515
|
+
.inkra-circular-slider:focus-visible .inkra-circular-slider__focus-ring { opacity: 1; }
|
|
1516
|
+
@media (forced-colors: active) {
|
|
1517
|
+
.inkra-circular-slider__track { color: GrayText; opacity: 1; }
|
|
1518
|
+
.inkra-circular-slider__range { color: Highlight; }
|
|
1519
|
+
.inkra-circular-slider__thumb-surface { border: 2px solid ButtonText; background: Canvas; }
|
|
1520
|
+
.inkra-circular-slider:focus-visible .inkra-circular-slider__thumb-surface { outline: var(--inkra-focus-width) solid Highlight; outline-offset: var(--inkra-focus-offset); }
|
|
1521
|
+
.inkra-circular-slider__focus-ring { display: none !important; }
|
|
1522
|
+
}
|
|
1523
|
+
@media (forced-colors: active), print {
|
|
1524
|
+
.inkra-circular-slider .inkra-progress__ring-ink[data-ready="true"] { visibility: hidden; }
|
|
1525
|
+
.inkra-circular-slider .inkra-progress__ring-ink[data-ready="true"] + .inkra-progress__ring-fallback { visibility: visible; }
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1461
1528
|
.inkra-selection-control {
|
|
1462
1529
|
align-items: center;
|
|
1463
1530
|
color: var(--inkra-ink);
|
|
@@ -1723,6 +1790,56 @@
|
|
|
1723
1790
|
}
|
|
1724
1791
|
}
|
|
1725
1792
|
|
|
1793
|
+
/* Circular switches retain the native checkbox while sharing the dial's pencil geometry. */
|
|
1794
|
+
.inkra-switch--circular {
|
|
1795
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1796
|
+
justify-items: center;
|
|
1797
|
+
align-content: start;
|
|
1798
|
+
width: var(--inkra-circular-switch-diameter);
|
|
1799
|
+
gap: 2px;
|
|
1800
|
+
}
|
|
1801
|
+
.inkra-switch--circular > .inkra-selection-control__input {
|
|
1802
|
+
width: var(--inkra-circular-switch-diameter);
|
|
1803
|
+
height: var(--inkra-circular-switch-diameter);
|
|
1804
|
+
inset: 0 auto auto 0;
|
|
1805
|
+
touch-action: manipulation;
|
|
1806
|
+
}
|
|
1807
|
+
.inkra-switch--circular > .inkra-selection-control__copy { width: 100%; text-align: center; }
|
|
1808
|
+
.inkra-switch[data-readonly="true"] { cursor: default; }
|
|
1809
|
+
.inkra-switch__circular { display: flex; align-items: center; justify-content: center; position: relative; width: var(--inkra-circular-switch-diameter); height: var(--inkra-circular-switch-diameter); pointer-events: none; user-select: none; }
|
|
1810
|
+
.inkra-switch__circular-arc { position: absolute; inset: 16px; transform: rotate(225deg); }
|
|
1811
|
+
.inkra-switch__circular-track, .inkra-switch__circular-range { position: absolute; inset: 0; }
|
|
1812
|
+
.inkra-switch__circular-track { color: var(--inkra-ink-muted); opacity: .3; }
|
|
1813
|
+
.inkra-switch__circular-range { color: var(--inkra-accent-strong); }
|
|
1814
|
+
.inkra-switch__circular .inkra-progress__ring { color: inherit; }
|
|
1815
|
+
.inkra-switch__circular .inkra-progress__ring,
|
|
1816
|
+
.inkra-switch__circular .inkra-progress__ring-rotation,
|
|
1817
|
+
.inkra-switch__circular .inkra-progress__ring-direction,
|
|
1818
|
+
.inkra-switch__circular .inkra-progress__ring-ink,
|
|
1819
|
+
.inkra-switch__circular .inkra-progress__ring-fallback { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
|
|
1820
|
+
.inkra-switch__circular .inkra-progress__ring-ink { visibility: hidden; }
|
|
1821
|
+
.inkra-switch__circular .inkra-progress__ring-ink[data-ready="true"] { visibility: visible; }
|
|
1822
|
+
.inkra-switch__circular .inkra-progress__ring-ink[data-ready="true"] + .inkra-progress__ring-fallback { visibility: hidden; }
|
|
1823
|
+
.inkra-switch__circular-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px; box-sizing: border-box; width: var(--inkra-circular-switch-center-width); max-height: var(--inkra-circular-switch-center-height); min-width: 0; overflow: hidden; pointer-events: none; text-align: center; }
|
|
1824
|
+
.inkra-switch__circular-icon { display: flex; align-items: center; justify-content: center; flex: none; width: min(var(--inkra-circular-switch-icon-size), 100%); height: var(--inkra-circular-switch-icon-size); }
|
|
1825
|
+
.inkra-switch__circular-icon > * { max-width: 100%; max-height: 100%; }
|
|
1826
|
+
.inkra-switch__circular-content { width: 100%; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
|
|
1827
|
+
.inkra-switch__circular-content > * { max-width: 100%; }
|
|
1828
|
+
.inkra-switch__circular-value { display: block; white-space: nowrap; max-width: 100%; text-align: center; font-size: var(--inkra-circular-switch-value-size); line-height: var(--inkra-circular-switch-value-line); }
|
|
1829
|
+
.inkra-switch__circular-focus { --inkra-ink: var(--inkra-focus); --inkra-accent-strong: var(--inkra-focus); position: absolute !important; inset: 10px; opacity: 0; pointer-events: none; border-radius: 50%; }
|
|
1830
|
+
.inkra-switch--circular:has(.inkra-selection-control__input:focus-visible) .inkra-switch__circular-focus { opacity: 1; }
|
|
1831
|
+
@media (forced-colors: active) {
|
|
1832
|
+
.inkra-switch--circular > .inkra-selection-control__input { position: absolute; opacity: 0; z-index: 2; }
|
|
1833
|
+
.inkra-switch__circular-track { color: GrayText; opacity: 1; }
|
|
1834
|
+
.inkra-switch__circular-range { color: Highlight; }
|
|
1835
|
+
.inkra-switch--circular:has(.inkra-selection-control__input:focus-visible) .inkra-switch__circular { outline: var(--inkra-focus-width) solid Highlight; outline-offset: -10px; border-radius: 50%; }
|
|
1836
|
+
.inkra-switch__circular-focus { display: none !important; }
|
|
1837
|
+
}
|
|
1838
|
+
@media (forced-colors: active), print {
|
|
1839
|
+
.inkra-switch__circular .inkra-progress__ring-ink[data-ready="true"] { visibility: hidden; }
|
|
1840
|
+
.inkra-switch__circular .inkra-progress__ring-ink[data-ready="true"] + .inkra-progress__ring-fallback { visibility: visible; }
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1726
1843
|
.inkra-portal-theme-bridge {
|
|
1727
1844
|
display: contents;
|
|
1728
1845
|
font-family: var(--inkra-font-body);
|
|
@@ -4269,7 +4386,7 @@
|
|
|
4269
4386
|
|
|
4270
4387
|
.inkra-slot__empty-mark {
|
|
4271
4388
|
color: var(--inkra-ink-muted);
|
|
4272
|
-
font-family:
|
|
4389
|
+
font-family: var(--inkra-font-hand);
|
|
4273
4390
|
font-size: calc(var(--inkra-slot-size) * 0.4);
|
|
4274
4391
|
line-height: 1;
|
|
4275
4392
|
}
|
|
@@ -4734,7 +4851,7 @@
|
|
|
4734
4851
|
|
|
4735
4852
|
.inkra-number-ticker__native-value {
|
|
4736
4853
|
font: inherit;
|
|
4737
|
-
font-family:
|
|
4854
|
+
font-family: var(--inkra-font-hand);
|
|
4738
4855
|
}
|
|
4739
4856
|
|
|
4740
4857
|
.inkra-number-ticker__reels {
|
|
@@ -8835,7 +8952,7 @@ div.inkra-choice-grid > .inkra-radio-group {
|
|
|
8835
8952
|
.inkra-markdown__code-surface {
|
|
8836
8953
|
background: transparent;
|
|
8837
8954
|
color: var(--inkra-ink);
|
|
8838
|
-
font-family:
|
|
8955
|
+
font-family: var(--inkra-font-hand);
|
|
8839
8956
|
font-size: var(--inkra-text-md);
|
|
8840
8957
|
font-weight: var(--inkra-weight-regular);
|
|
8841
8958
|
line-height: 1.8;
|
|
@@ -9700,7 +9817,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
|
9700
9817
|
align-items: center;
|
|
9701
9818
|
box-sizing: border-box;
|
|
9702
9819
|
display: inline-flex;
|
|
9703
|
-
font-family:
|
|
9820
|
+
font-family: var(--inkra-font-hand);
|
|
9704
9821
|
font-size: var(--inkra-breadcrumb-item-font-size);
|
|
9705
9822
|
gap: var(--inkra-breadcrumb-item-gap);
|
|
9706
9823
|
justify-content: center;
|
package/dist/tokens.css
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Color scopes inherit the selected typeface and lettering material. */
|
|
3
|
+
--inkra-font-hand: "Inkra Xiaolai", "Trip Map Hand", "Kaiti SC", "STKaiti", cursive;
|
|
4
|
+
--inkra-font-body: var(--inkra-font-hand);
|
|
5
|
+
--inkra-font-display: var(--inkra-font-hand);
|
|
6
|
+
--inkra-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
7
|
+
--inkra-letter-variation: 0.1;
|
|
8
|
+
--inkra-letter-breaks: 0.31;
|
|
9
|
+
--inkra-letter-outline: 0.44;
|
|
10
|
+
--inkra-letter-fill: 0.85;
|
|
11
|
+
--inkra-letter-grain: 0.4;
|
|
12
|
+
}
|
|
13
|
+
|
|
1
14
|
:root,
|
|
2
15
|
[data-theme="light"],
|
|
3
16
|
[data-inkra-theme="light"],
|
|
@@ -98,11 +111,6 @@
|
|
|
98
111
|
--inkra-overlay: rgb(24 35 28 / 20%);
|
|
99
112
|
--inkra-shadow-overlay: 0 3px 12px rgb(24 35 28 / 20%);
|
|
100
113
|
|
|
101
|
-
--inkra-font-hand: "HanziPen SC", "Hannotate SC", "Kaiti SC", "STKaiti",
|
|
102
|
-
"Trip Map Hand", cursive;
|
|
103
|
-
--inkra-font-body: var(--inkra-font-hand);
|
|
104
|
-
--inkra-font-display: var(--inkra-font-hand);
|
|
105
|
-
--inkra-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
106
114
|
--inkra-text-xs: 12px;
|
|
107
115
|
--inkra-text-sm: 13px;
|
|
108
116
|
--inkra-text-md: 15px;
|
|
@@ -194,11 +202,6 @@
|
|
|
194
202
|
--inkra-quiet-wash-strength: 0.18;
|
|
195
203
|
--inkra-badge-wash-strength: 0.25;
|
|
196
204
|
|
|
197
|
-
--inkra-letter-variation: 0.2;
|
|
198
|
-
--inkra-letter-breaks: 0.5;
|
|
199
|
-
--inkra-letter-outline: 0.9;
|
|
200
|
-
--inkra-letter-fill: 0.9;
|
|
201
|
-
--inkra-letter-grain: 0.6;
|
|
202
205
|
--inkra-paper-tile-size: 384px;
|
|
203
206
|
--inkra-render-dpr-cap: 2;
|
|
204
207
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkra/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Hand-drawn React controls with native semantics and deterministic decoration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -496,7 +496,8 @@
|
|
|
496
496
|
"README.md",
|
|
497
497
|
"LICENSE",
|
|
498
498
|
"THIRD_PARTY_NOTICES.md",
|
|
499
|
-
"Yozai-OFL.txt"
|
|
499
|
+
"Yozai-OFL.txt",
|
|
500
|
+
"Xiaolai-OFL.txt"
|
|
500
501
|
],
|
|
501
502
|
"sideEffects": [
|
|
502
503
|
"**/*.css"
|