@octane-xplat/ui 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/dist/native/octane-client-build.json +1 -1
- package/dist/native/ui.js +26 -23
- package/dist/native/ui14.js +16 -1
- package/dist/native/ui16.js +2 -2
- package/dist/native/ui24.js +2 -1
- package/dist/native/ui3.js +22 -1
- package/dist/native/ui39.js +89 -91
- package/dist/native/ui40.js +180 -53
- package/dist/native/ui41.js +55 -16
- package/dist/native/ui42.js +15 -6
- package/dist/native/ui43.js +18 -37
- package/dist/native/ui44.js +6 -265
- package/dist/native/ui45.js +24 -14
- package/dist/native/ui46.js +261 -29
- package/dist/native/ui47.js +17 -30
- package/dist/native/ui48.js +28 -65
- package/dist/native/ui49.js +21 -46
- package/dist/native/ui50.js +58 -13
- package/dist/native/ui51.js +65 -12
- package/dist/native/ui52.js +58 -86
- package/dist/native/ui53.js +8 -15
- package/dist/native/ui54.js +11 -15
- package/dist/native/ui55.js +82 -146
- package/dist/native/ui56.js +18 -17
- package/dist/native/ui57.js +18 -13
- package/dist/native/ui58.js +155 -21
- package/dist/native/ui59.js +32 -7
- package/dist/native/ui6.js +54 -12
- package/dist/native/ui60.js +8 -102
- package/dist/native/ui61.js +20 -74
- package/dist/native/ui62.js +8 -0
- package/dist/native/ui63.js +108 -0
- package/dist/native/ui64.js +76 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +26 -24
- package/dist/web/ui13.js +106 -41
- package/dist/web/ui34.js +147 -67
- package/dist/web/ui35.js +136 -51
- package/dist/web/ui36.js +86 -18
- package/dist/web/ui37.js +20 -5
- package/dist/web/ui38.js +6 -37
- package/dist/web/ui39.js +26 -142
- package/dist/web/ui40.js +143 -32
- package/dist/web/ui41.js +42 -41
- package/dist/web/ui42.js +40 -74
- package/dist/web/ui43.js +47 -13
- package/dist/web/ui44.js +13 -33
- package/dist/web/ui45.js +60 -7
- package/dist/web/ui46.js +47 -42
- package/dist/web/ui47.js +7 -11
- package/dist/web/ui48.js +30 -48
- package/dist/web/ui49.js +12 -46
- package/dist/web/ui50.js +62 -16
- package/dist/web/ui51.js +33 -135
- package/dist/web/ui52.js +18 -41
- package/dist/web/ui53.js +266 -10
- package/dist/web/ui54.js +41 -8
- package/dist/web/ui55.js +16 -21
- package/dist/web/ui56.js +7 -6
- package/dist/web/ui57.js +20 -42
- package/dist/web/ui58.js +6 -44
- package/dist/web/ui59.js +44 -0
- package/dist/web/ui60.js +46 -0
- package/package.json +5 -1
- package/src/theme/tokens.css +255 -30
- package/types/index.d.ts +10 -0
- package/types/props.d.ts +59 -4
package/src/theme/tokens.css
CHANGED
|
@@ -3,10 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
:root,
|
|
5
5
|
.ns-root {
|
|
6
|
-
--color-primary: #
|
|
7
|
-
|
|
6
|
+
--color-primary: #171717;
|
|
7
|
+
/* Token names double as the future Tailwind theme keys: text-onprimary
|
|
8
|
+
resolves --color-onprimary, bg-danger resolves --color-danger. Keep
|
|
9
|
+
class-name segments and var-name segments identical. */
|
|
10
|
+
--color-onprimary: #fafafa;
|
|
8
11
|
--color-surface: #ffffff;
|
|
9
|
-
--color-
|
|
12
|
+
--color-surface-secondary: #fafafa;
|
|
13
|
+
--color-text: #0a0a0a;
|
|
14
|
+
--color-text-secondary: #666666;
|
|
15
|
+
--color-border: #eaeaea;
|
|
16
|
+
--color-border-strong: #d4d4d4;
|
|
17
|
+
--color-danger: #dc2626;
|
|
18
|
+
/* Family lists are deliberately generic. Apps override these with their
|
|
19
|
+
web @font-face family and the platform's registered native name. */
|
|
20
|
+
--font-sans: system-ui, sans-serif;
|
|
21
|
+
--font-mono: ui-monospace, monospace;
|
|
10
22
|
--space-4: 16px;
|
|
11
23
|
/* Corner scale — rounded-rectangle radii. Smooth (squircle) corners are
|
|
12
24
|
the default corner treatment: every class that consumes a token also
|
|
@@ -20,9 +32,52 @@
|
|
|
20
32
|
|
|
21
33
|
.ns-dark,
|
|
22
34
|
.dark {
|
|
23
|
-
--color-
|
|
24
|
-
--color-
|
|
35
|
+
--color-primary: #ededed;
|
|
36
|
+
--color-onprimary: #171717;
|
|
37
|
+
--color-surface: #0a0a0a;
|
|
38
|
+
--color-surface-secondary: #141414;
|
|
39
|
+
--color-text: #ededed;
|
|
40
|
+
--color-text-secondary: #a1a1a1;
|
|
41
|
+
--color-border: #2e2e2e;
|
|
42
|
+
--color-border-strong: #4a4a4a;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* xplat-web-only:start — DOM normalization. NativeScript is the reference
|
|
46
|
+
box model: dip sizes are outer boxes, and a border paints from
|
|
47
|
+
width+color alone. The DOM's UA stylesheet diverges on both counts, so
|
|
48
|
+
normalize the deltas once instead of patching individual rules:
|
|
49
|
+
- border-box keeps padding/borders inside declared sizes (a 40dip box
|
|
50
|
+
is 40px, not 40px + padding + border).
|
|
51
|
+
- border-width 0 + border-style solid makes the DOM behave like native:
|
|
52
|
+
any shared border-*-width declaration paints on both targets — the
|
|
53
|
+
DOM's initial border-width is `medium`, so style alone would draw
|
|
54
|
+
phantom ~3px edges wherever a rule sets only one side's width.
|
|
55
|
+
- <img> is a leaf, not inline text (no baseline descender gap).
|
|
56
|
+
- .vx-app columns are flex like their native screen containers. */
|
|
57
|
+
*,
|
|
58
|
+
*::before,
|
|
59
|
+
*::after {
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
}
|
|
62
|
+
* {
|
|
63
|
+
border-width: 0;
|
|
64
|
+
border-style: solid;
|
|
65
|
+
}
|
|
66
|
+
img {
|
|
67
|
+
display: block;
|
|
25
68
|
}
|
|
69
|
+
.vx-app {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
}
|
|
73
|
+
/* Native has no scroll chaining — a ScrollView/ListView just bounces
|
|
74
|
+
inside itself because the parent is never a scroller. contain is the
|
|
75
|
+
DOM equivalent: scroll stays in the leaf it started in. */
|
|
76
|
+
.vx-scroll,
|
|
77
|
+
.vx-list {
|
|
78
|
+
overscroll-behavior: contain;
|
|
79
|
+
}
|
|
80
|
+
/* xplat-web-only:end */
|
|
26
81
|
|
|
27
82
|
/* vocabulary base styles */
|
|
28
83
|
|
|
@@ -70,7 +125,7 @@
|
|
|
70
125
|
.vx-drawer-backdrop {
|
|
71
126
|
position: absolute;
|
|
72
127
|
inset: 0;
|
|
73
|
-
background: rgba(
|
|
128
|
+
background: rgba(0, 0, 0, 0.4);
|
|
74
129
|
}
|
|
75
130
|
.vx-drawer-panel {
|
|
76
131
|
position: absolute;
|
|
@@ -140,7 +195,7 @@
|
|
|
140
195
|
.vx-overlay-shade {
|
|
141
196
|
position: absolute;
|
|
142
197
|
inset: 0;
|
|
143
|
-
background-color: rgba(0, 0, 0, 0.
|
|
198
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
144
199
|
}
|
|
145
200
|
|
|
146
201
|
.vx-overlay-content {
|
|
@@ -193,7 +248,7 @@
|
|
|
193
248
|
max-width: 90%;
|
|
194
249
|
max-height: 90%;
|
|
195
250
|
padding: 24px;
|
|
196
|
-
border:
|
|
251
|
+
border: 1px solid var(--color-border);
|
|
197
252
|
border-radius: var(--radius-xl);
|
|
198
253
|
corner-shape: squircle;
|
|
199
254
|
color: var(--color-text);
|
|
@@ -201,7 +256,7 @@
|
|
|
201
256
|
}
|
|
202
257
|
|
|
203
258
|
.vx-modal::backdrop {
|
|
204
|
-
background: rgba(
|
|
259
|
+
background: rgba(0, 0, 0, 0.4);
|
|
205
260
|
}
|
|
206
261
|
|
|
207
262
|
.vx-modal--dialog {
|
|
@@ -246,7 +301,7 @@
|
|
|
246
301
|
inset: 0;
|
|
247
302
|
border: 0;
|
|
248
303
|
padding: 0;
|
|
249
|
-
background: rgba(
|
|
304
|
+
background: rgba(0, 0, 0, 0.4);
|
|
250
305
|
cursor: default;
|
|
251
306
|
}
|
|
252
307
|
|
|
@@ -260,10 +315,22 @@
|
|
|
260
315
|
}
|
|
261
316
|
/* xplat-web-only:end */
|
|
262
317
|
|
|
263
|
-
/* xplat-web-only:start — placeholder pseudos are DOM-only
|
|
318
|
+
/* xplat-web-only:start — placeholder pseudos are DOM-only. Muted like
|
|
319
|
+
real placeholder text, not currentColor (a full-opacity hint reads as
|
|
320
|
+
a typed value); --placeholder-color is the per-field prop escape. */
|
|
264
321
|
input::placeholder,
|
|
265
322
|
textarea::placeholder {
|
|
266
|
-
color: var(--placeholder-color,
|
|
323
|
+
color: var(--placeholder-color, var(--color-text-secondary));
|
|
324
|
+
}
|
|
325
|
+
/* xplat-web-only:end */
|
|
326
|
+
|
|
327
|
+
/* xplat-web-only:start — form controls don't inherit the body font in the
|
|
328
|
+
DOM (UA stylesheet wins); without this they render in the UA face. */
|
|
329
|
+
input,
|
|
330
|
+
textarea,
|
|
331
|
+
select,
|
|
332
|
+
button {
|
|
333
|
+
font-family: inherit;
|
|
267
334
|
}
|
|
268
335
|
/* xplat-web-only:end */
|
|
269
336
|
|
|
@@ -340,10 +407,15 @@ textarea::placeholder {
|
|
|
340
407
|
}
|
|
341
408
|
/* xplat-web-only:end */
|
|
342
409
|
|
|
343
|
-
/* utilities (hand-written subset
|
|
410
|
+
/* utilities (hand-written subset — do NOT adopt Tailwind until
|
|
411
|
+
NativeScript/tailwind#226 is resolved; the plugin strips core-supported
|
|
412
|
+
props incl. gap, drops all @media, and rewrites invisible→collapse) */
|
|
344
413
|
|
|
414
|
+
/* flex-1 keeps Tailwind v4's exact emission (`flex: 1 1 0%`) — web gets
|
|
415
|
+
identical semantics, NS parses grow/shrink out of the shorthand and
|
|
416
|
+
ignores the basis token it can't model. */
|
|
345
417
|
.flex-1 {
|
|
346
|
-
flex
|
|
418
|
+
flex: 1 1 0%;
|
|
347
419
|
}
|
|
348
420
|
/* Flex divergence guards — NS FlexboxLayout diverges from web flexbox on
|
|
349
421
|
* shrinkability: grow children never shrink below intrinsic width, fixed
|
|
@@ -365,19 +437,52 @@ textarea::placeholder {
|
|
|
365
437
|
.items-center {
|
|
366
438
|
align-items: center;
|
|
367
439
|
}
|
|
440
|
+
.items-baseline {
|
|
441
|
+
align-items: baseline;
|
|
442
|
+
}
|
|
443
|
+
.items-start {
|
|
444
|
+
align-items: flex-start;
|
|
445
|
+
}
|
|
368
446
|
.justify-center {
|
|
369
447
|
justify-content: center;
|
|
370
448
|
}
|
|
449
|
+
.justify-between {
|
|
450
|
+
justify-content: space-between;
|
|
451
|
+
}
|
|
452
|
+
.flex-wrap {
|
|
453
|
+
flex-wrap: wrap;
|
|
454
|
+
}
|
|
371
455
|
.gap-4 {
|
|
372
456
|
gap: 16px;
|
|
373
457
|
}
|
|
458
|
+
.gap-3 {
|
|
459
|
+
gap: 12px;
|
|
460
|
+
}
|
|
461
|
+
.gap-6 {
|
|
462
|
+
gap: 24px;
|
|
463
|
+
}
|
|
374
464
|
|
|
465
|
+
.text-2xl {
|
|
466
|
+
font-size: 28px;
|
|
467
|
+
}
|
|
375
468
|
.text-xl {
|
|
376
469
|
font-size: 20px;
|
|
377
470
|
}
|
|
471
|
+
.text-lg {
|
|
472
|
+
font-size: 18px;
|
|
473
|
+
}
|
|
474
|
+
.text-sm {
|
|
475
|
+
font-size: 13px;
|
|
476
|
+
}
|
|
378
477
|
.font-bold {
|
|
379
478
|
font-weight: bold;
|
|
380
479
|
}
|
|
480
|
+
.font-semibold {
|
|
481
|
+
font-weight: 600;
|
|
482
|
+
}
|
|
483
|
+
.text-muted {
|
|
484
|
+
color: var(--color-text-secondary);
|
|
485
|
+
}
|
|
381
486
|
|
|
382
487
|
/* Corner utilities — consume the --radius-* scale and carry the smooth
|
|
383
488
|
(squircle) corner treatment. Circles stay circular: .rounded-full omits
|
|
@@ -407,10 +512,10 @@ textarea::placeholder {
|
|
|
407
512
|
background-color: var(--color-primary);
|
|
408
513
|
}
|
|
409
514
|
.text-onprimary {
|
|
410
|
-
color: var(--color-
|
|
515
|
+
color: var(--color-onprimary);
|
|
411
516
|
}
|
|
412
517
|
.bg-danger {
|
|
413
|
-
background-color:
|
|
518
|
+
background-color: var(--color-danger);
|
|
414
519
|
}
|
|
415
520
|
/* xplat-web-only:start — box-shadow is inert on native (elevation is
|
|
416
521
|
Android-only; no shared mapping yet) */
|
|
@@ -420,14 +525,89 @@ textarea::placeholder {
|
|
|
420
525
|
/* xplat-web-only:end */
|
|
421
526
|
|
|
422
527
|
.btn {
|
|
423
|
-
padding-top:
|
|
424
|
-
padding-right:
|
|
425
|
-
padding-bottom:
|
|
426
|
-
padding-left:
|
|
528
|
+
padding-top: 10px;
|
|
529
|
+
padding-right: 16px;
|
|
530
|
+
padding-bottom: 10px;
|
|
531
|
+
padding-left: 16px;
|
|
427
532
|
border-radius: var(--radius-md);
|
|
428
533
|
corner-shape: squircle;
|
|
534
|
+
font-size: 14px;
|
|
535
|
+
font-weight: 500;
|
|
536
|
+
align-items: center;
|
|
537
|
+
justify-content: center;
|
|
538
|
+
text-decoration: none;
|
|
539
|
+
color: var(--color-text);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/* Secondary = the same control reading quiet: hairline border, surface
|
|
543
|
+
fill, body-text label. Reserve .bg-primary for the one decisive action
|
|
544
|
+
in a group. */
|
|
545
|
+
.btn-secondary {
|
|
546
|
+
background-color: var(--color-surface);
|
|
547
|
+
border-width: 1px;
|
|
548
|
+
border-color: var(--color-border);
|
|
549
|
+
color: var(--color-text);
|
|
429
550
|
}
|
|
430
551
|
|
|
552
|
+
/* xplat-web-only:start — controls that render as real <a>/<button> need
|
|
553
|
+
inline layout and UA resets; the pressable/nav-link leaves are divs on
|
|
554
|
+
web and don't hit these rules. */
|
|
555
|
+
a.btn {
|
|
556
|
+
display: inline-flex;
|
|
557
|
+
}
|
|
558
|
+
a.chip {
|
|
559
|
+
display: inline-flex;
|
|
560
|
+
align-items: center;
|
|
561
|
+
}
|
|
562
|
+
/* xplat-web-only:end */
|
|
563
|
+
|
|
564
|
+
/* Tab shell — web divs/buttons + the Android SwapTabs fallback (iOS draws
|
|
565
|
+
its own UITabBar and never sees these). */
|
|
566
|
+
.vx-tabbar {
|
|
567
|
+
border-bottom-width: 1px;
|
|
568
|
+
border-bottom-color: var(--color-border);
|
|
569
|
+
background-color: var(--color-surface);
|
|
570
|
+
}
|
|
571
|
+
.vx-tab {
|
|
572
|
+
align-items: center;
|
|
573
|
+
justify-content: center;
|
|
574
|
+
padding-top: 10px;
|
|
575
|
+
padding-right: 16px;
|
|
576
|
+
padding-bottom: 10px;
|
|
577
|
+
padding-left: 16px;
|
|
578
|
+
font-size: 14px;
|
|
579
|
+
color: var(--color-text-secondary);
|
|
580
|
+
}
|
|
581
|
+
.vx-tab.active {
|
|
582
|
+
color: var(--color-text);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/* xplat-web-only:start — DOM defaults are display:block (div) and
|
|
586
|
+
inline-block (button); every flex-bearing vx- class needs an explicit
|
|
587
|
+
display or flex-direction/align-items/justify-content are inert. */
|
|
588
|
+
.vx-tabs {
|
|
589
|
+
display: flex;
|
|
590
|
+
flex-direction: column;
|
|
591
|
+
flex: 1;
|
|
592
|
+
min-height: 0;
|
|
593
|
+
}
|
|
594
|
+
.vx-tabbar {
|
|
595
|
+
display: flex;
|
|
596
|
+
flex-direction: row;
|
|
597
|
+
}
|
|
598
|
+
.vx-tabpane {
|
|
599
|
+
flex: 1;
|
|
600
|
+
min-height: 0;
|
|
601
|
+
display: flex;
|
|
602
|
+
flex-direction: column;
|
|
603
|
+
}
|
|
604
|
+
button.vx-tab {
|
|
605
|
+
display: flex;
|
|
606
|
+
background: none;
|
|
607
|
+
cursor: pointer;
|
|
608
|
+
}
|
|
609
|
+
/* xplat-web-only:end */
|
|
610
|
+
|
|
431
611
|
/* harness experiment styles */
|
|
432
612
|
|
|
433
613
|
.vx-app {
|
|
@@ -442,28 +622,71 @@ textarea::placeholder {
|
|
|
442
622
|
color: var(--color-text);
|
|
443
623
|
}
|
|
444
624
|
|
|
625
|
+
/* `.vx-app label` above (descendant + type) outranks single-class text
|
|
626
|
+
colors inside the app root — roles that must win escalate here. */
|
|
627
|
+
.vx-app .text-onprimary {
|
|
628
|
+
color: var(--color-onprimary);
|
|
629
|
+
}
|
|
630
|
+
.vx-app .text-muted {
|
|
631
|
+
color: var(--color-text-secondary);
|
|
632
|
+
}
|
|
633
|
+
.vx-app .vx-tab label {
|
|
634
|
+
color: var(--color-text-secondary);
|
|
635
|
+
}
|
|
636
|
+
.vx-app .vx-tab.active label {
|
|
637
|
+
color: var(--color-text);
|
|
638
|
+
}
|
|
639
|
+
.vx-app .chip-on label {
|
|
640
|
+
color: var(--color-onprimary);
|
|
641
|
+
}
|
|
642
|
+
/* Danger surfaces keep white text in both themes (on-primary flips). */
|
|
643
|
+
.bg-danger .text-onprimary {
|
|
644
|
+
color: #ffffff;
|
|
645
|
+
}
|
|
646
|
+
|
|
445
647
|
.input {
|
|
446
|
-
padding: 10px;
|
|
648
|
+
padding-top: 10px;
|
|
649
|
+
padding-right: 12px;
|
|
650
|
+
padding-bottom: 10px;
|
|
651
|
+
padding-left: 12px;
|
|
447
652
|
border-width: 1px;
|
|
448
|
-
border-color:
|
|
449
|
-
border-radius: var(--radius-
|
|
653
|
+
border-color: var(--color-border);
|
|
654
|
+
border-radius: var(--radius-md);
|
|
450
655
|
corner-shape: squircle;
|
|
451
|
-
font-size:
|
|
656
|
+
font-size: 14px;
|
|
657
|
+
background-color: var(--color-surface);
|
|
658
|
+
color: var(--color-text);
|
|
659
|
+
/* NS TextField/TextView placeholder color (ignored on web — the
|
|
660
|
+
::placeholder pseudo above covers it there). */
|
|
661
|
+
placeholder-color: var(--color-text-secondary);
|
|
452
662
|
}
|
|
453
663
|
|
|
454
664
|
.chip {
|
|
455
|
-
background-color: var(--color-
|
|
456
|
-
color: var(--color-
|
|
457
|
-
padding:
|
|
458
|
-
|
|
665
|
+
background-color: var(--color-surface);
|
|
666
|
+
color: var(--color-text);
|
|
667
|
+
padding-top: 5px;
|
|
668
|
+
padding-right: 12px;
|
|
669
|
+
padding-bottom: 5px;
|
|
670
|
+
padding-left: 12px;
|
|
671
|
+
border-width: 1px;
|
|
672
|
+
border-color: var(--color-border);
|
|
673
|
+
border-radius: var(--radius-md);
|
|
459
674
|
corner-shape: squircle;
|
|
460
675
|
font-size: 13px;
|
|
676
|
+
text-decoration: none;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/* Selected chip — the one filled element in a group of bordered peers. */
|
|
680
|
+
.chip-on {
|
|
681
|
+
background-color: var(--color-primary);
|
|
682
|
+
border-color: var(--color-primary);
|
|
683
|
+
color: var(--color-onprimary);
|
|
461
684
|
}
|
|
462
685
|
|
|
463
686
|
.cell {
|
|
464
687
|
padding: 12px;
|
|
465
688
|
border-bottom-width: 1px;
|
|
466
|
-
border-bottom-color:
|
|
689
|
+
border-bottom-color: var(--color-border);
|
|
467
690
|
}
|
|
468
691
|
|
|
469
692
|
.vx-list {
|
|
@@ -486,7 +709,7 @@ textarea::placeholder {
|
|
|
486
709
|
.vx-sheet-backdrop {
|
|
487
710
|
position: absolute;
|
|
488
711
|
inset: 0;
|
|
489
|
-
background: rgba(
|
|
712
|
+
background: rgba(0, 0, 0, 0.4);
|
|
490
713
|
pointer-events: auto;
|
|
491
714
|
}
|
|
492
715
|
|
|
@@ -498,6 +721,8 @@ textarea::placeholder {
|
|
|
498
721
|
max-height: 85%;
|
|
499
722
|
padding: 24px;
|
|
500
723
|
overflow: auto;
|
|
724
|
+
border-width: 1px;
|
|
725
|
+
border-color: var(--color-border);
|
|
501
726
|
border-top-left-radius: var(--radius-xl);
|
|
502
727
|
border-top-right-radius: var(--radius-xl);
|
|
503
728
|
corner-shape: squircle;
|
package/types/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
DrawerProps,
|
|
18
18
|
GridProps,
|
|
19
19
|
HeadingProps,
|
|
20
|
+
HoverableProps,
|
|
20
21
|
IconGlyph,
|
|
21
22
|
IconProps,
|
|
22
23
|
ImageProps,
|
|
@@ -28,6 +29,8 @@ import type {
|
|
|
28
29
|
ModalProps,
|
|
29
30
|
ModalOpenOptions,
|
|
30
31
|
ModalOpenResult,
|
|
32
|
+
MeasureBounds,
|
|
33
|
+
MeasureResult,
|
|
31
34
|
NavLinkProps,
|
|
32
35
|
OpenModal,
|
|
33
36
|
OpenWindowOptions,
|
|
@@ -64,6 +67,7 @@ import type {
|
|
|
64
67
|
ToastContent,
|
|
65
68
|
ToastOptions,
|
|
66
69
|
ToastPosition,
|
|
70
|
+
UseMeasureOptions,
|
|
67
71
|
ViewProps,
|
|
68
72
|
} from './props'
|
|
69
73
|
|
|
@@ -77,6 +81,7 @@ export type {
|
|
|
77
81
|
DrawerProps,
|
|
78
82
|
GridProps,
|
|
79
83
|
HeadingProps,
|
|
84
|
+
HoverableProps,
|
|
80
85
|
IconGlyph,
|
|
81
86
|
IconProps,
|
|
82
87
|
ImageProps,
|
|
@@ -87,6 +92,8 @@ export type {
|
|
|
87
92
|
ModalProps,
|
|
88
93
|
ModalOpenOptions,
|
|
89
94
|
ModalOpenResult,
|
|
95
|
+
MeasureBounds,
|
|
96
|
+
MeasureResult,
|
|
90
97
|
NavLinkProps,
|
|
91
98
|
OpenModal,
|
|
92
99
|
OpenWindowOptions,
|
|
@@ -125,6 +132,7 @@ export type {
|
|
|
125
132
|
ToastContent,
|
|
126
133
|
ToastOptions,
|
|
127
134
|
ToastPosition,
|
|
135
|
+
UseMeasureOptions,
|
|
128
136
|
ViewProps,
|
|
129
137
|
} from './props'
|
|
130
138
|
|
|
@@ -175,6 +183,7 @@ export declare const openModal: OpenModal
|
|
|
175
183
|
export declare function openWindow(options?: OpenWindowOptions): any
|
|
176
184
|
export declare const Overlay: UniversalComponent<OverlayProps>
|
|
177
185
|
export declare const Popover: UniversalComponent<PopoverProps>
|
|
186
|
+
export declare const Hoverable: UniversalComponent<HoverableProps>
|
|
178
187
|
export declare function showToast(content: ToastContent, options?: ToastOptions): void
|
|
179
188
|
export declare const Tabs: UniversalComponent<TabsProps>
|
|
180
189
|
|
|
@@ -223,6 +232,7 @@ export declare function deriveRouteManifest(
|
|
|
223
232
|
// ---------- animation / theme ----------
|
|
224
233
|
|
|
225
234
|
export declare function useAnimation(initial?: number, prop?: string): AnimatedValue
|
|
235
|
+
export declare function useMeasure(options?: UseMeasureOptions): MeasureResult
|
|
226
236
|
export declare function getColorScheme(): ColorScheme
|
|
227
237
|
export declare function useColorScheme(): ColorScheme
|
|
228
238
|
export interface SafeAreaInsets {
|
package/types/props.d.ts
CHANGED
|
@@ -160,6 +160,9 @@ export interface RowProps extends LayoutChildProps, FlexContainerProps, GlassSur
|
|
|
160
160
|
android?: any;
|
|
161
161
|
web?: any;
|
|
162
162
|
}
|
|
163
|
+
/** Shared accessibility roles. The native leaf maps the ARIA spellings that
|
|
164
|
+
* NativeScript names differently (for example `heading` → `header`). */
|
|
165
|
+
export type Role = 'button' | 'link' | 'search' | 'image' | 'heading' | 'adjustable' | 'summary' | 'text' | 'none' | 'progressbar' | 'checkbox' | 'switch' | 'radio' | 'spinbutton' | 'tab';
|
|
163
166
|
export interface TextProps extends LayoutChildProps {
|
|
164
167
|
className?: any;
|
|
165
168
|
style?: any;
|
|
@@ -169,6 +172,9 @@ export interface TextProps extends LayoutChildProps {
|
|
|
169
172
|
/** Native Label does not expose text selection; implemented with CSS on web. */
|
|
170
173
|
selectable?: boolean;
|
|
171
174
|
ellipsize?: boolean;
|
|
175
|
+
accessible?: boolean;
|
|
176
|
+
accessibilityLabel?: string;
|
|
177
|
+
accessibilityRole?: Role;
|
|
172
178
|
accessibilityHint?: string;
|
|
173
179
|
accessibilityValue?: string;
|
|
174
180
|
/** NativeScript supports one state at a time (disabled/selected/checked); busy and expanded are web-only. */
|
|
@@ -221,7 +227,7 @@ export interface PressableProps extends LayoutChildProps, FlexContainerProps, Gl
|
|
|
221
227
|
onLongPress?: () => void;
|
|
222
228
|
accessible?: boolean;
|
|
223
229
|
accessibilityLabel?: string;
|
|
224
|
-
accessibilityRole?:
|
|
230
|
+
accessibilityRole?: Role;
|
|
225
231
|
onPressIn?: () => void;
|
|
226
232
|
onPressOut?: () => void;
|
|
227
233
|
onDoublePress?: () => void;
|
|
@@ -273,6 +279,9 @@ export interface TextInputProps {
|
|
|
273
279
|
web?: any;
|
|
274
280
|
}
|
|
275
281
|
export interface TextAreaProps extends TextInputProps {
|
|
282
|
+
/** Submit on native only when `returnKeyType` is `done` or `send`; other
|
|
283
|
+
* returns insert newlines because TextView emits returnPress per newline.
|
|
284
|
+
* Web submits on Cmd/Ctrl+Enter. */
|
|
276
285
|
/** Height in text rows. Web: the `rows` attr (fixed box); native:
|
|
277
286
|
* minHeight at the widget's measured line height. With `autoGrow` it
|
|
278
287
|
* becomes the starting height instead of a fixed one. */
|
|
@@ -439,8 +448,11 @@ export interface IconProps {
|
|
|
439
448
|
/** One registered icon representation. `svg` contains path `d` data;
|
|
440
449
|
* `markup` is full inner-SVG markup (groups, transforms, several paths)
|
|
441
450
|
* rendered inside an `<svg viewBox>` shell on web and through `svgview`
|
|
442
|
-
* (ui-svg) on native. `font`, `src`, and `text` are
|
|
443
|
-
*
|
|
451
|
+
* (ui-svg) on native. `font`, `src`, and `text` are fallback
|
|
452
|
+
* representations, in that order after SVG. `src` may be a raster source or
|
|
453
|
+
* an SVG source; SVG is auto-detected for inline markup, SVG data URIs, and
|
|
454
|
+
* `.svg` paths/URLs. Opaque resource names need `markup`/`svg` when their
|
|
455
|
+
* format cannot be inferred from the string. */
|
|
444
456
|
export interface IconGlyph {
|
|
445
457
|
svg?: string;
|
|
446
458
|
markup?: string;
|
|
@@ -496,15 +508,51 @@ export interface PopoverProps {
|
|
|
496
508
|
android?: Record<string, any>;
|
|
497
509
|
web?: Record<string, any>;
|
|
498
510
|
}
|
|
511
|
+
export interface HoverableProps {
|
|
512
|
+
/** Content shown after the pointer rests over the children on web. */
|
|
513
|
+
card: any;
|
|
514
|
+
/** Styling for the card's wrapper view inside the popover — e.g. a
|
|
515
|
+
* pointer bridge covering the anchor↔card gap or a positional offset. */
|
|
516
|
+
cardClassName?: any;
|
|
517
|
+
cardStyle?: any;
|
|
518
|
+
children?: any;
|
|
519
|
+
openDelay?: number;
|
|
520
|
+
closeDelay?: number;
|
|
521
|
+
placement?: PopoverPlacement;
|
|
522
|
+
className?: any;
|
|
523
|
+
style?: any;
|
|
524
|
+
ios?: Record<string, any>;
|
|
525
|
+
android?: Record<string, any>;
|
|
526
|
+
web?: Record<string, any>;
|
|
527
|
+
}
|
|
499
528
|
export type ToastContent = string | (() => any);
|
|
500
|
-
export type ToastPosition = 'top' | 'bottom';
|
|
529
|
+
export type ToastPosition = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
|
|
501
530
|
export interface ToastOptions {
|
|
502
531
|
duration?: number;
|
|
503
532
|
position?: ToastPosition;
|
|
533
|
+
/** When set, the toast is positioned by Popover relative to this view. */
|
|
534
|
+
anchor?: PopoverAnchorRef;
|
|
535
|
+
/** Placement used with `anchor`; `position` supplies the top/bottom default. */
|
|
536
|
+
placement?: PopoverPlacement;
|
|
504
537
|
ios?: Record<string, any>;
|
|
505
538
|
android?: Record<string, any>;
|
|
506
539
|
web?: Record<string, any>;
|
|
507
540
|
}
|
|
541
|
+
export interface MeasureBounds {
|
|
542
|
+
x: number;
|
|
543
|
+
y: number;
|
|
544
|
+
width: number;
|
|
545
|
+
height: number;
|
|
546
|
+
}
|
|
547
|
+
export interface UseMeasureOptions {
|
|
548
|
+
/** Re-measure on layout, resize, scroll, and content-size changes. Defaults to true. */
|
|
549
|
+
observe?: boolean;
|
|
550
|
+
}
|
|
551
|
+
export interface MeasureResult {
|
|
552
|
+
/** Pass to a View's `bind` prop. */
|
|
553
|
+
bind: (element: any) => void;
|
|
554
|
+
bounds: MeasureBounds | null;
|
|
555
|
+
}
|
|
508
556
|
export interface ModalProps {
|
|
509
557
|
open?: boolean;
|
|
510
558
|
onClose?: (result?: ModalOpenResult) => void;
|
|
@@ -664,6 +712,13 @@ export interface OpenWindowOptions {
|
|
|
664
712
|
/** Optional URL used by the web window. */
|
|
665
713
|
url?: string;
|
|
666
714
|
}
|
|
715
|
+
/**
|
|
716
|
+
* Value returned by `useAnimation(initial, prop)`. On web, `prop` supports
|
|
717
|
+
* translateX/translateY/translateZ, scale/scaleX/scaleY, rotate/rotateX/
|
|
718
|
+
* rotateY, and skewX/skewY as CSS transforms, plus `opacity` and other CSS
|
|
719
|
+
* style properties. On NativeScript, `prop` is the name of a NativeScript
|
|
720
|
+
* view property (for example, `translateX` or `opacity`).
|
|
721
|
+
*/
|
|
667
722
|
export interface AnimatedValue {
|
|
668
723
|
readonly value: number;
|
|
669
724
|
bind(el: any): void;
|