@gjsify/adwaita-nativescript 0.12.0 → 0.13.1

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.
Files changed (54) hide show
  1. package/lib/esm/index.js +1 -1
  2. package/lib/esm/widgets/adw-action-row.js +1 -1
  3. package/lib/esm/widgets/adw-avatar.js +1 -1
  4. package/lib/esm/widgets/adw-button-content.js +1 -1
  5. package/lib/esm/widgets/adw-button-row.js +1 -1
  6. package/lib/esm/widgets/adw-combo-row.js +1 -1
  7. package/lib/esm/widgets/adw-expander-row.js +1 -1
  8. package/lib/esm/widgets/adw-icon.js +1 -1
  9. package/lib/esm/widgets/adw-image-button.js +1 -1
  10. package/lib/esm/widgets/adw-menu-button.js +1 -0
  11. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  12. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  13. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  14. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  15. package/lib/esm/widgets/adw-spin-row.js +1 -1
  16. package/lib/esm/widgets/adw-split-button.js +1 -1
  17. package/lib/esm/widgets/adw-status-page.js +1 -1
  18. package/lib/esm/widgets/adw-tab-view.js +1 -1
  19. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  20. package/lib/esm/widgets/adw-view-stack.js +1 -0
  21. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -0
  22. package/lib/esm/widgets/breakpoint.js +1 -0
  23. package/lib/esm/widgets/color-scheme.js +1 -0
  24. package/lib/esm/widgets/icon-path.js +2 -1
  25. package/lib/esm/widgets/icons.android.js +1 -1
  26. package/lib/esm/widgets/index.js +1 -1
  27. package/lib/esm/widgets/split-view-base.js +1 -1
  28. package/lib/esm/widgets/view-switcher-base.js +1 -1
  29. package/lib/types/index.d.ts +2 -2
  30. package/lib/types/widgets/adw-action-row.d.ts +11 -2
  31. package/lib/types/widgets/adw-avatar.d.ts +5 -0
  32. package/lib/types/widgets/adw-button-content.d.ts +11 -6
  33. package/lib/types/widgets/adw-button-row.d.ts +16 -6
  34. package/lib/types/widgets/adw-expander-row.d.ts +4 -3
  35. package/lib/types/widgets/adw-icon.d.ts +7 -1
  36. package/lib/types/widgets/adw-image-button.d.ts +6 -1
  37. package/lib/types/widgets/adw-menu-button.d.ts +32 -0
  38. package/lib/types/widgets/adw-password-entry-row.d.ts +8 -0
  39. package/lib/types/widgets/adw-preferences-group.d.ts +10 -0
  40. package/lib/types/widgets/adw-spin-row.d.ts +7 -6
  41. package/lib/types/widgets/adw-split-button.d.ts +23 -8
  42. package/lib/types/widgets/adw-status-page.d.ts +24 -6
  43. package/lib/types/widgets/adw-tab-view.d.ts +11 -0
  44. package/lib/types/widgets/adw-toggle-group.d.ts +16 -5
  45. package/lib/types/widgets/adw-view-stack.d.ts +46 -0
  46. package/lib/types/widgets/adw-view-switcher-bar.d.ts +29 -0
  47. package/lib/types/widgets/breakpoint.d.ts +69 -0
  48. package/lib/types/widgets/color-scheme.d.ts +22 -0
  49. package/lib/types/widgets/icon-path.d.ts +15 -0
  50. package/lib/types/widgets/index.d.ts +9 -0
  51. package/lib/types/widgets/split-view-base.d.ts +8 -0
  52. package/lib/types/widgets/view-switcher-base.d.ts +17 -2
  53. package/package.json +6 -6
  54. package/src/theme/adwaita.css +281 -49
@@ -65,17 +65,22 @@ Page.adw-window {
65
65
  /*
66
66
  * Hairline separator between rows in a boxed list — Adwaita draws a 1px
67
67
  * @borders line BETWEEN rows (not above the first / below the last). NS has no
68
- * `:not(:first-child)`, so we approximate with a 1px top border on the boxed
69
- * list's direct row children; the listbox clips the first row's border under
70
- * its rounded corner, which reads as "between rows".
68
+ * `:not(:first-child)`, so we put a 1px top border on every row and let the
69
+ * group's `_refreshRowEdges()` flag the FIRST row with `.adw-row-flush-top`
70
+ * (NS does NOT clip the first row's border under the card's rounded corner, so
71
+ * without the flag it reads as a stray line above the first row).
71
72
  */
72
73
  .boxed-list .adw-row {
73
74
  border-top-width: 1;
74
75
  border-top-color: rgba(0, 0, 0, 0.08);
75
76
  }
76
77
 
78
+ .boxed-list .adw-row-flush-top {
79
+ border-top-width: 0;
80
+ }
81
+
77
82
  .adw-action-row {
78
- /* GridLayout `*, auto` — sizing handled by the widget, only chrome here. */
83
+ /* GridLayout `auto, *, auto` — sizing handled by the widget, only chrome here. */
79
84
  color: rgba(0, 0, 0, 0.8);
80
85
  }
81
86
 
@@ -83,6 +88,13 @@ Page.adw-window {
83
88
  margin: 0;
84
89
  }
85
90
 
91
+ /* Leading symbolic icon (column 0) — Adwaita sets a 12px gap to the title and
92
+ * centers it vertically against the title/subtitle stack. */
93
+ .adw-row-prefix {
94
+ margin: 0 12 0 0;
95
+ vertical-align: center;
96
+ }
97
+
86
98
  .adw-row-title {
87
99
  font-size: 15;
88
100
  color: rgba(0, 0, 0, 0.8);
@@ -97,6 +109,7 @@ Page.adw-window {
97
109
 
98
110
  .adw-row-suffix {
99
111
  margin: 0;
112
+ vertical-align: center;
100
113
  }
101
114
 
102
115
  /* ===== Switch ===== */
@@ -165,23 +178,26 @@ Page.adw-window {
165
178
  margin: 0;
166
179
  }
167
180
 
168
- .adw-spin-button {
169
- width: 32;
170
- height: 32;
171
- border-radius: 9;
181
+ /* The stepper buttons are AdwImageButtons (symbolic value-decrease/increase
182
+ * icons). Compound selector so it beats the later `.adw-image-button` rule:
183
+ * keep the rounded-square shape but give the subtle persistent fill Adw.SpinRow's
184
+ * stepper shows (the bare image-button is transparent at rest). */
185
+ .adw-image-button.adw-spin-button {
186
+ width: 30;
187
+ height: 30;
172
188
  background-color: rgba(128, 128, 128, 0.12);
173
- color: rgba(0, 0, 0, 0.8);
174
- font-size: 18;
175
- font-weight: 700;
176
- padding: 0;
177
189
  margin: 0 2 0 2;
178
190
  }
179
191
 
192
+ .ns-dark .adw-image-button.adw-spin-button {
193
+ background-color: rgba(255, 255, 255, 0.1);
194
+ }
195
+
180
196
  .adw-spin-value {
181
197
  font-size: 15;
182
198
  color: rgba(0, 0, 0, 0.8);
183
- width: 48;
184
- margin: 0 4 0 4;
199
+ margin: 0 6 0 4;
200
+ vertical-align: center;
185
201
  }
186
202
 
187
203
  /* ===== Slider row (RANGE control — vertical card: title+value header over a slider) ===== */
@@ -300,15 +316,18 @@ Page.adw-window {
300
316
 
301
317
  /* ===== Image button (circular flat icon button — header bars) ===== */
302
318
 
303
- /* Adwaita header buttons are flat CIRCULAR icon buttons: transparent at rest,
319
+ /* Adwaita flat icon buttons are ROUNDED SQUARES, not circles: transparent at rest,
304
320
  * darkening on press (the flat-button `:active` shade). 34×34 with a 16px symbolic
305
- * icon, matching libadwaita's `button.image-button`. The `:highlighted` press state
306
- * is wired by `attachRowPressFeedback()` (NS only auto-highlights `Button`). */
321
+ * icon and the standard `$button_radius: 9px` corner, matching libadwaita's
322
+ * `button.image-button` (a full circle is the explicit `.circular` exception —
323
+ * window controls / FABs — which none of the storybook's icon buttons are). The
324
+ * `:highlighted` press state is wired by `attachRowPressFeedback()` (NS only
325
+ * auto-highlights `Button`). */
307
326
  .adw-image-button {
308
327
  background-color: transparent;
309
328
  width: 34;
310
329
  height: 34;
311
- border-radius: 9999;
330
+ border-radius: 9;
312
331
  margin: 0 2 0 2;
313
332
  }
314
333
 
@@ -421,6 +440,55 @@ Page.adw-window {
421
440
  border-top-color: rgba(0, 0, 0, 0.1);
422
441
  }
423
442
 
443
+ /* ===== View stack (page container) ===== */
444
+
445
+ .adw-view-stack {
446
+ background-color: transparent;
447
+ }
448
+
449
+ /* ===== View switcher bar (narrow policy: bottom bar, icon over label) ===== */
450
+
451
+ .adw-viewswitcherbar {
452
+ background-color: #ffffff;
453
+ border-top-width: 1;
454
+ border-top-color: rgba(0, 0, 0, 0.1);
455
+ }
456
+
457
+ .adw-viewswitcherbar-box {
458
+ background-color: transparent;
459
+ padding: 4 0 4 0;
460
+ }
461
+
462
+ /* Each button is a tappable vertical StackLayout (icon over label). The label
463
+ * carries the colour (NS does not inherit `color` to a child Label); the active
464
+ * label is accent-coloured. */
465
+ .adw-viewswitcherbar-button {
466
+ background-color: transparent;
467
+ border-radius: 8;
468
+ padding: 4 2 4 2;
469
+ margin: 2 4 2 4;
470
+ }
471
+
472
+ .adw-viewswitcherbar-button:highlighted {
473
+ background-color: rgba(0, 0, 0, 0.05);
474
+ }
475
+
476
+ .adw-viewswitcherbar-button-icon {
477
+ margin: 0 0 2 0;
478
+ horizontal-align: center;
479
+ }
480
+
481
+ .adw-viewswitcherbar-button-label {
482
+ font-size: 11;
483
+ color: rgba(0, 0, 0, 0.6);
484
+ horizontal-align: center;
485
+ text-align: center;
486
+ }
487
+
488
+ .adw-viewswitcherbar-button.active .adw-viewswitcherbar-button-label {
489
+ color: #3584e4;
490
+ }
491
+
424
492
  /* ===== Wrap box ===== */
425
493
 
426
494
  .adw-wrap-box {
@@ -443,7 +511,13 @@ Page.adw-window {
443
511
  padding: 24 32 24 32;
444
512
  }
445
513
 
514
+ /* The symbolic icon (AdwIcon) — only spacing; size/colour are baked by AdwIcon. */
446
515
  .adw-status-page-icon {
516
+ margin: 0 0 12 0;
517
+ }
518
+
519
+ /* The legacy glyph fallback (a Label) — large + dim. */
520
+ .adw-status-page-icon-glyph {
447
521
  font-size: 56;
448
522
  color: rgba(0, 0, 0, 0.35);
449
523
  margin: 0 0 12 0;
@@ -508,36 +582,113 @@ Page.adw-window {
508
582
  margin: 0;
509
583
  }
510
584
 
585
+ /* On a suggested/destructive button the label must take the button's foreground
586
+ * (the explicit dark label colour above would otherwise win over the inherited
587
+ * one). The matching ICON colour is pre-baked by the caller via AdwIcon.iconColor. */
588
+ .adw-button.suggested-action .adw-button-content-label {
589
+ color: #ffffff;
590
+ }
591
+
592
+ .adw-button.destructive-action .adw-button-content-label {
593
+ color: #c01c28;
594
+ }
595
+
511
596
  /* ===== Split button (action + dropdown) ===== */
512
597
 
513
598
  .adw-split-button-action {
514
599
  background-color: rgba(0, 0, 0, 0.08);
515
- color: rgba(0, 0, 0, 0.8);
516
600
  border-radius: 9;
517
- font-weight: 700;
518
- padding: 5 16 5 16;
601
+ padding: 5 14 5 14;
519
602
  height: 38;
520
603
  margin: 0;
521
604
  }
522
605
 
606
+ .adw-split-button-label {
607
+ font-size: 15;
608
+ font-weight: 700;
609
+ color: rgba(0, 0, 0, 0.8);
610
+ vertical-align: center;
611
+ }
612
+
523
613
  .adw-split-button-dropdown {
524
614
  background-color: rgba(0, 0, 0, 0.08);
525
- color: rgba(0, 0, 0, 0.8);
526
615
  border-radius: 9;
527
- font-size: 15;
528
616
  width: 36;
529
617
  height: 38;
530
618
  padding: 0;
531
619
  margin: 0 0 0 1;
532
620
  }
533
621
 
534
- /* ===== Toggle group (segmented control) ===== */
622
+ /* Flat variant — transparent at rest (header-bar / toolbar split buttons). */
623
+ .adw-split-button.flat .adw-split-button-action,
624
+ .adw-split-button.flat .adw-split-button-dropdown {
625
+ background-color: transparent;
626
+ }
535
627
 
628
+ .adw-split-button.flat .adw-split-button-action:highlighted,
629
+ .adw-split-button.flat .adw-split-button-dropdown:highlighted {
630
+ background-color: rgba(0, 0, 0, 0.08);
631
+ }
632
+
633
+ /* Non-flat press — darken the linked halves (Adwaita's `:active` shade). */
634
+ .adw-split-button-action:highlighted,
635
+ .adw-split-button-dropdown:highlighted {
636
+ background-color: rgba(0, 0, 0, 0.16);
637
+ }
638
+
639
+ /* ===== Toggle group (Adwaita LINKED segmented control) ===== */
640
+ /* A tinted rounded container; the selected segment is raised to a white pill
641
+ * (Adwaita has a soft shadow there — the NS subset has no shadow, so a white
642
+ * fill stands in). */
536
643
  .adw-toggle-group {
537
- color: #3584e4;
644
+ background-color: rgba(0, 0, 0, 0.08);
645
+ border-radius: 9;
646
+ padding: 3;
647
+ margin: 0;
648
+ }
649
+
650
+ .adw-toggle-button {
651
+ background-color: transparent;
652
+ border-radius: 7;
653
+ padding: 5 14 5 14;
538
654
  margin: 0;
539
655
  }
540
656
 
657
+ .adw-toggle-button.active {
658
+ background-color: #ffffff;
659
+ }
660
+
661
+ .adw-toggle-button:highlighted {
662
+ background-color: rgba(0, 0, 0, 0.08);
663
+ }
664
+
665
+ .adw-toggle-label {
666
+ font-size: 14;
667
+ font-weight: 700;
668
+ color: rgba(0, 0, 0, 0.8);
669
+ vertical-align: center;
670
+ }
671
+
672
+ .adw-toggle-icon {
673
+ margin: 0 6 0 0;
674
+ vertical-align: center;
675
+ }
676
+
677
+ /* Flat variant — no container fill (toolbar/header context). */
678
+ .adw-toggle-group.flat {
679
+ background-color: transparent;
680
+ padding: 0;
681
+ }
682
+
683
+ /* Round variant — fully-pill container + segments. */
684
+ .adw-toggle-group.round {
685
+ border-radius: 9999;
686
+ }
687
+
688
+ .adw-toggle-group.round .adw-toggle-button {
689
+ border-radius: 9999;
690
+ }
691
+
541
692
  /* ===== View switcher (top pill bar) ===== */
542
693
 
543
694
  .adw-view-switcher {
@@ -551,18 +702,33 @@ Page.adw-window {
551
702
  margin: 6;
552
703
  }
553
704
 
705
+ /* Each button is a tappable StackLayout (icon + label) — the label carries the
706
+ * text colour (NS does not inherit `color` to a child Label) and the icon its
707
+ * right margin. Active = raised white pill. */
554
708
  .adw-view-switcher-button {
555
709
  background-color: transparent;
556
- color: rgba(0, 0, 0, 0.65);
557
710
  border-radius: 7;
558
- font-weight: 700;
559
711
  padding: 5 14 5 14;
560
712
  margin: 0;
561
713
  }
562
714
 
563
715
  .adw-view-switcher-button.active {
564
716
  background-color: #ffffff;
565
- color: rgba(0, 0, 0, 0.85);
717
+ }
718
+
719
+ .adw-view-switcher-button:highlighted {
720
+ background-color: rgba(0, 0, 0, 0.07);
721
+ }
722
+
723
+ .adw-view-switcher-button-label {
724
+ color: rgba(0, 0, 0, 0.75);
725
+ font-weight: 700;
726
+ vertical-align: center;
727
+ }
728
+
729
+ .adw-view-switcher-button-icon {
730
+ margin: 0 6 0 0;
731
+ vertical-align: center;
566
732
  }
567
733
 
568
734
  /* ===== Inline view switcher (compact pill bar) ===== */
@@ -576,16 +742,28 @@ Page.adw-window {
576
742
 
577
743
  .adw-inline-view-switcher-button {
578
744
  background-color: transparent;
579
- color: rgba(0, 0, 0, 0.65);
580
745
  border-radius: 6;
581
- font-weight: 700;
582
746
  padding: 3 10 3 10;
583
747
  margin: 0;
584
748
  }
585
749
 
586
750
  .adw-inline-view-switcher-button.active {
587
751
  background-color: #ffffff;
588
- color: rgba(0, 0, 0, 0.85);
752
+ }
753
+
754
+ .adw-inline-view-switcher-button:highlighted {
755
+ background-color: rgba(0, 0, 0, 0.07);
756
+ }
757
+
758
+ .adw-inline-view-switcher-button-label {
759
+ color: rgba(0, 0, 0, 0.75);
760
+ font-weight: 700;
761
+ vertical-align: center;
762
+ }
763
+
764
+ .adw-inline-view-switcher-button-icon {
765
+ margin: 0 5 0 0;
766
+ vertical-align: center;
589
767
  }
590
768
 
591
769
  /* ===== Tab view (top tab strip) ===== */
@@ -597,19 +775,40 @@ Page.adw-window {
597
775
  margin: 0;
598
776
  }
599
777
 
778
+ /* Each tab is a tappable StackLayout (label + a close ✕ on the active tab). The
779
+ * active tab is a raised rounded PILL (Adw.TabBar), NOT an accent underline. */
600
780
  .adw-tab-view-tab {
601
781
  background-color: transparent;
602
- color: rgba(0, 0, 0, 0.6);
603
- font-weight: 700;
604
- padding: 8 16 8 16;
605
- margin: 0;
782
+ border-radius: 7;
783
+ padding: 6 10 6 14;
784
+ margin: 4 3 4 3;
606
785
  }
607
786
 
608
787
  .adw-tab-view-tab.active {
609
- color: #3584e4;
610
- /* Accent underline approximated by a bottom border. */
611
- border-bottom-width: 2;
612
- border-bottom-color: #3584e4;
788
+ background-color: rgba(0, 0, 0, 0.06);
789
+ }
790
+
791
+ .adw-tab-view-tab:highlighted {
792
+ background-color: rgba(0, 0, 0, 0.04);
793
+ }
794
+
795
+ .adw-tab-view-tab-label {
796
+ color: rgba(0, 0, 0, 0.75);
797
+ font-weight: 700;
798
+ vertical-align: center;
799
+ }
800
+
801
+ .adw-tab-view-tab-icon {
802
+ margin: 0 6 0 0;
803
+ vertical-align: center;
804
+ }
805
+
806
+ /* The per-tab close button — a small flat ✕ shown only on the active tab. */
807
+ .adw-tab-close {
808
+ width: 22;
809
+ height: 22;
810
+ margin: 0 0 0 4;
811
+ border-radius: 7;
613
812
  }
614
813
 
615
814
  /* ===== Carousel (swipeable pager) ===== */
@@ -1036,6 +1235,25 @@ Page.ns-dark.adw-window {
1036
1235
  border-top-color: rgba(255, 255, 255, 0.12);
1037
1236
  }
1038
1237
 
1238
+ /* ===== Dark: view switcher bar ===== */
1239
+
1240
+ .ns-dark .adw-viewswitcherbar {
1241
+ background-color: #2e2e32;
1242
+ border-top-color: rgba(255, 255, 255, 0.12);
1243
+ }
1244
+
1245
+ .ns-dark .adw-viewswitcherbar-button:highlighted {
1246
+ background-color: rgba(255, 255, 255, 0.06);
1247
+ }
1248
+
1249
+ .ns-dark .adw-viewswitcherbar-button-label {
1250
+ color: rgba(255, 255, 255, 0.7);
1251
+ }
1252
+
1253
+ .ns-dark .adw-viewswitcherbar-button.active .adw-viewswitcherbar-button-label {
1254
+ color: #78aeed;
1255
+ }
1256
+
1039
1257
  /* ===== Dark: spinner ===== */
1040
1258
 
1041
1259
  .ns-dark .adw-spinner {
@@ -1048,7 +1266,7 @@ Page.ns-dark.adw-window {
1048
1266
  background-color: #222226;
1049
1267
  }
1050
1268
 
1051
- .ns-dark .adw-status-page-icon {
1269
+ .ns-dark .adw-status-page-icon-glyph {
1052
1270
  color: rgba(255, 255, 255, 0.35);
1053
1271
  }
1054
1272
 
@@ -1085,7 +1303,23 @@ Page.ns-dark.adw-window {
1085
1303
  /* ===== Dark: toggle group ===== */
1086
1304
 
1087
1305
  .ns-dark .adw-toggle-group {
1088
- color: #78aeed;
1306
+ background-color: rgba(255, 255, 255, 0.1);
1307
+ }
1308
+
1309
+ .ns-dark .adw-toggle-group.flat {
1310
+ background-color: transparent;
1311
+ }
1312
+
1313
+ .ns-dark .adw-toggle-button.active {
1314
+ background-color: rgba(255, 255, 255, 0.15);
1315
+ }
1316
+
1317
+ .ns-dark .adw-toggle-button:highlighted {
1318
+ background-color: rgba(255, 255, 255, 0.08);
1319
+ }
1320
+
1321
+ .ns-dark .adw-toggle-label {
1322
+ color: rgba(255, 255, 255, 0.85);
1089
1323
  }
1090
1324
 
1091
1325
  /* ===== Dark: view switcher ===== */
@@ -1095,15 +1329,14 @@ Page.ns-dark.adw-window {
1095
1329
  background-color: rgba(255, 255, 255, 0.08);
1096
1330
  }
1097
1331
 
1098
- .ns-dark .adw-view-switcher-button,
1099
- .ns-dark .adw-inline-view-switcher-button {
1100
- color: rgba(255, 255, 255, 0.65);
1332
+ .ns-dark .adw-view-switcher-button-label,
1333
+ .ns-dark .adw-inline-view-switcher-button-label {
1334
+ color: rgba(255, 255, 255, 0.7);
1101
1335
  }
1102
1336
 
1103
1337
  .ns-dark .adw-view-switcher-button.active,
1104
1338
  .ns-dark .adw-inline-view-switcher-button.active {
1105
1339
  background-color: #45454c;
1106
- color: #ffffff;
1107
1340
  }
1108
1341
 
1109
1342
  /* ===== Dark: tab view ===== */
@@ -1113,13 +1346,12 @@ Page.ns-dark.adw-window {
1113
1346
  border-bottom-color: rgba(255, 255, 255, 0.12);
1114
1347
  }
1115
1348
 
1116
- .ns-dark .adw-tab-view-tab {
1117
- color: rgba(255, 255, 255, 0.6);
1349
+ .ns-dark .adw-tab-view-tab-label {
1350
+ color: rgba(255, 255, 255, 0.7);
1118
1351
  }
1119
1352
 
1120
1353
  .ns-dark .adw-tab-view-tab.active {
1121
- color: #78aeed;
1122
- border-bottom-color: #78aeed;
1354
+ background-color: rgba(255, 255, 255, 0.1);
1123
1355
  }
1124
1356
 
1125
1357
  /* ===== Dark: carousel ===== */