@speles7172/controls 0.5.1 → 0.6.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 (59) hide show
  1. package/README.md +101 -1
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/ChipRow.d.ts +50 -0
  4. package/dist/ChipRow.d.ts.map +1 -0
  5. package/dist/ChipRow.js +35 -0
  6. package/dist/ChipRow.js.map +1 -0
  7. package/dist/DataTable.d.ts +123 -2
  8. package/dist/DataTable.d.ts.map +1 -1
  9. package/dist/DataTable.js +173 -36
  10. package/dist/DataTable.js.map +1 -1
  11. package/dist/DateRangeFilter.d.ts +21 -1
  12. package/dist/DateRangeFilter.d.ts.map +1 -1
  13. package/dist/DateRangeFilter.js +90 -19
  14. package/dist/DateRangeFilter.js.map +1 -1
  15. package/dist/ItemList.d.ts +54 -0
  16. package/dist/ItemList.d.ts.map +1 -0
  17. package/dist/ItemList.js +29 -0
  18. package/dist/ItemList.js.map +1 -0
  19. package/dist/Modal.d.ts +46 -1
  20. package/dist/Modal.d.ts.map +1 -1
  21. package/dist/Modal.js +155 -12
  22. package/dist/Modal.js.map +1 -1
  23. package/dist/Pagination.d.ts +25 -0
  24. package/dist/Pagination.d.ts.map +1 -0
  25. package/dist/Pagination.js +19 -0
  26. package/dist/Pagination.js.map +1 -0
  27. package/dist/SearchableMultiSelect.d.ts.map +1 -1
  28. package/dist/SearchableMultiSelect.js +1 -1
  29. package/dist/SearchableMultiSelect.js.map +1 -1
  30. package/dist/Toast.d.ts +36 -0
  31. package/dist/Toast.d.ts.map +1 -0
  32. package/dist/Toast.js +68 -0
  33. package/dist/Toast.js.map +1 -0
  34. package/dist/csv.d.ts +21 -0
  35. package/dist/csv.d.ts.map +1 -0
  36. package/dist/csv.js +56 -0
  37. package/dist/csv.js.map +1 -0
  38. package/dist/icons.d.ts +1 -1
  39. package/dist/icons.d.ts.map +1 -1
  40. package/dist/icons.js +2 -2
  41. package/dist/icons.js.map +1 -1
  42. package/dist/index.d.ts +11 -3
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +10 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/styles.css +734 -21
  47. package/dist/useDensity.d.ts +24 -0
  48. package/dist/useDensity.d.ts.map +1 -0
  49. package/dist/useDensity.js +61 -0
  50. package/dist/useDensity.js.map +1 -0
  51. package/dist/usePagination.d.ts +25 -0
  52. package/dist/usePagination.d.ts.map +1 -0
  53. package/dist/usePagination.js +59 -0
  54. package/dist/usePagination.js.map +1 -0
  55. package/dist/useTableSort.d.ts +50 -0
  56. package/dist/useTableSort.d.ts.map +1 -0
  57. package/dist/useTableSort.js +73 -0
  58. package/dist/useTableSort.js.map +1 -0
  59. package/package.json +2 -2
package/dist/styles.css CHANGED
@@ -665,12 +665,18 @@
665
665
  gap: 0;
666
666
  align-items: center;
667
667
  justify-content: center;
668
- padding: 16px;
668
+ padding: var(--ctl-space-4);
669
669
  overflow-y: auto;
670
670
  background: var(--ctl-overlay);
671
+ /* A soft blur, so the page behind reads as "set aside" rather than as a
672
+ second thing to read. Ignored where unsupported, which costs nothing. */
673
+ backdrop-filter: blur(2px);
674
+ animation: ctl-modal-fade 140ms ease-out;
671
675
  }
672
676
 
673
677
  .ctl-modal {
678
+ /* The prompt below is laid over the panel, so the panel is its box. */
679
+ position: relative;
674
680
  display: flex;
675
681
  flex-direction: column;
676
682
  width: 100%;
@@ -679,11 +685,13 @@
679
685
  put. A dialog taller than the viewport scrolls the backdrop instead, and
680
686
  the close button ends up somewhere nobody can reach. */
681
687
  max-height: calc(100vh - 32px);
688
+ overflow: hidden;
682
689
  background: var(--ctl-bg);
683
690
  border: 1px solid var(--ctl-border);
684
- border-radius: var(--ctl-radius);
691
+ /* The radius language's dialog step: a dialog is the roundest thing on screen. */
692
+ border-radius: var(--ctl-radius-lg);
685
693
  box-shadow: var(--ctl-shadow);
686
- animation: ctl-modal-in 120ms ease-out;
694
+ animation: ctl-modal-in 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
687
695
  }
688
696
 
689
697
  .ctl-modal-wide {
@@ -698,34 +706,47 @@
698
706
  .ctl-modal-head {
699
707
  display: flex;
700
708
  flex-shrink: 0;
701
- gap: 12px;
709
+ gap: var(--ctl-space-3);
702
710
  align-items: center;
703
711
  justify-content: space-between;
704
- padding: 12px 16px;
712
+ padding: var(--ctl-space-4) var(--ctl-space-5);
705
713
  border-bottom: 1px solid var(--ctl-border);
706
714
  }
707
715
 
708
716
  .ctl-modal-title {
709
717
  margin: 0;
710
- font-size: 15px;
718
+ font-size: var(--ctl-text-title);
711
719
  font-weight: 600;
720
+ line-height: 1.3;
712
721
  }
713
722
 
723
+ /* A round, quiet close: an icon at rest, a soft wash under the cursor. */
714
724
  .ctl-modal-close {
715
725
  display: flex;
726
+ flex-shrink: 0;
716
727
  align-items: center;
717
728
  justify-content: center;
718
- padding: 4px;
729
+ width: 32px;
730
+ height: 32px;
731
+ padding: 0;
719
732
  color: var(--ctl-muted);
720
733
  cursor: pointer;
721
734
  background: none;
722
735
  border: 0;
723
- border-radius: 6px;
736
+ border-radius: var(--ctl-radius-pill);
737
+ transition:
738
+ background 120ms ease,
739
+ color 120ms ease;
724
740
  }
725
741
 
726
- .ctl-modal-close:hover {
742
+ .ctl-modal-close:hover:not(:disabled) {
727
743
  color: var(--ctl-text);
728
- background: var(--ctl-surface);
744
+ background: var(--ctl-hover);
745
+ }
746
+
747
+ .ctl-modal-close:disabled {
748
+ cursor: default;
749
+ opacity: 0.45;
729
750
  }
730
751
 
731
752
  .ctl-modal-close:focus-visible {
@@ -735,7 +756,7 @@
735
756
 
736
757
  .ctl-modal-body {
737
758
  flex: 1 1 auto;
738
- padding: 16px;
759
+ padding: var(--ctl-space-5);
739
760
  overflow-y: auto;
740
761
  }
741
762
 
@@ -743,37 +764,186 @@
743
764
  display: flex;
744
765
  flex-shrink: 0;
745
766
  flex-wrap: wrap;
746
- gap: 8px;
767
+ gap: var(--ctl-space-2);
747
768
  justify-content: flex-end;
748
- padding: 12px 16px;
769
+ padding: var(--ctl-space-3) var(--ctl-space-5);
770
+ background: var(--ctl-surface);
749
771
  border-top: 1px solid var(--ctl-border);
750
772
  }
751
773
 
774
+ /*
775
+ * The unsaved-changes prompt: a small card over the dialog it asks about, on a
776
+ * wash of the dialog itself, so it is plainly about *this* panel.
777
+ */
778
+ .ctl-modal-confirm-scrim {
779
+ position: absolute;
780
+ inset: 0;
781
+ z-index: 1;
782
+ display: flex;
783
+ align-items: center;
784
+ justify-content: center;
785
+ padding: var(--ctl-space-4);
786
+ background: var(--ctl-overlay);
787
+ animation: ctl-modal-fade 120ms ease-out;
788
+ }
789
+
790
+ .ctl-modal-confirm {
791
+ display: flex;
792
+ flex-direction: column;
793
+ gap: var(--ctl-space-2);
794
+ width: 100%;
795
+ max-width: 380px;
796
+ padding: var(--ctl-space-5);
797
+ background: var(--ctl-bg);
798
+ border: 1px solid var(--ctl-border);
799
+ border-radius: var(--ctl-radius-lg);
800
+ box-shadow: var(--ctl-shadow);
801
+ animation: ctl-modal-in 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
802
+ }
803
+
804
+ .ctl-modal-confirm:focus-visible {
805
+ outline: 2px solid var(--ctl-accent);
806
+ outline-offset: 2px;
807
+ }
808
+
809
+ .ctl-modal-confirm-title {
810
+ margin: 0;
811
+ font-size: var(--ctl-text-lg);
812
+ font-weight: 600;
813
+ }
814
+
815
+ .ctl-modal-confirm-message {
816
+ margin: 0;
817
+ color: var(--ctl-muted);
818
+ }
819
+
820
+ .ctl-modal-confirm-actions {
821
+ display: flex;
822
+ flex-wrap: wrap;
823
+ gap: var(--ctl-space-2);
824
+ justify-content: flex-end;
825
+ margin-top: var(--ctl-space-3);
826
+ }
827
+
828
+ /*
829
+ * A worded button: primary (the one thing to do), danger (the one-way thing),
830
+ * ghost (the step back). Pill-free, 6px, the icon snug against the word.
831
+ */
832
+ .ctl-btn {
833
+ display: inline-flex;
834
+ gap: 6px;
835
+ align-items: center;
836
+ justify-content: center;
837
+ min-height: 36px;
838
+ padding: 0 var(--ctl-space-4);
839
+ font: inherit;
840
+ font-weight: 500;
841
+ color: var(--ctl-text);
842
+ cursor: pointer;
843
+ background: var(--ctl-bg);
844
+ border: 1px solid var(--ctl-border);
845
+ border-radius: var(--ctl-radius-sm);
846
+ transition:
847
+ background 120ms ease,
848
+ border-color 120ms ease,
849
+ color 120ms ease;
850
+ }
851
+
852
+ .ctl-btn:focus-visible {
853
+ outline: 2px solid var(--ctl-accent);
854
+ outline-offset: 2px;
855
+ }
856
+
857
+ .ctl-btn-primary {
858
+ color: var(--ctl-accent-text);
859
+ background: var(--ctl-accent);
860
+ border-color: var(--ctl-accent);
861
+ }
862
+
863
+ .ctl-btn-primary:hover {
864
+ background: var(--ctl-accent-strong);
865
+ border-color: var(--ctl-accent-strong);
866
+ }
867
+
868
+ .ctl-btn-danger {
869
+ color: var(--ctl-danger);
870
+ }
871
+
872
+ .ctl-btn-danger:hover {
873
+ background: var(--ctl-danger-soft);
874
+ border-color: var(--ctl-danger);
875
+ }
876
+
877
+ .ctl-btn-ghost {
878
+ background: none;
879
+ border-color: transparent;
880
+ }
881
+
882
+ .ctl-btn-ghost:hover {
883
+ background: var(--ctl-hover);
884
+ }
885
+
886
+ @keyframes ctl-modal-up {
887
+ from {
888
+ opacity: 0;
889
+ transform: translateY(24px);
890
+ }
891
+
892
+ to {
893
+ opacity: 1;
894
+ transform: none;
895
+ }
896
+ }
897
+
752
898
  @keyframes ctl-modal-in {
753
899
  from {
754
900
  opacity: 0;
755
- transform: translateY(6px);
901
+ transform: translateY(8px) scale(0.98);
902
+ }
903
+ }
904
+
905
+ @keyframes ctl-modal-fade {
906
+ from {
907
+ opacity: 0;
756
908
  }
757
909
  }
758
910
 
759
911
  @media (prefers-reduced-motion: reduce) {
760
- .ctl-modal {
912
+ .ctl-modal,
913
+ .ctl-modal-overlay,
914
+ .ctl-modal-confirm,
915
+ .ctl-modal-confirm-scrim {
761
916
  animation: none;
762
917
  }
763
918
  }
764
919
 
765
- /* Below this the panel is the screen: side padding buys nothing and costs
766
- width the content needs. */
920
+ /* Below this the panel is a bottom sheet: it rises from the foot of the
921
+ screen, as tall as its content (at most nearly the whole screen), with the
922
+ page still visible above it — the phone shape every dialog takes, rather
923
+ than a full-screen page that loses where the operator was. Side padding
924
+ buys nothing here and costs width the content needs. */
767
925
  @media (max-width: 480px) {
768
926
  .ctl-modal-overlay {
927
+ align-items: flex-end;
769
928
  padding: 0;
770
929
  }
771
930
 
772
931
  .ctl-modal {
773
932
  max-width: none;
774
- min-height: 100%;
933
+ max-height: 96vh;
934
+ padding-bottom: env(safe-area-inset-bottom, 0px);
775
935
  border: 0;
776
- border-radius: 0;
936
+ border-radius: var(--ctl-radius-lg) var(--ctl-radius-lg) 0 0;
937
+ animation: ctl-modal-up 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
938
+ }
939
+
940
+ .ctl-modal-head,
941
+ .ctl-modal-body {
942
+ padding-inline: var(--ctl-space-4);
943
+ }
944
+
945
+ .ctl-modal-title {
946
+ font-size: var(--ctl-text-lg);
777
947
  }
778
948
  }
779
949
 
@@ -1141,12 +1311,20 @@
1141
1311
  .ctl-table-wrap {
1142
1312
  display: block;
1143
1313
  width: 100%;
1144
- overflow-x: auto;
1314
+ /* `hidden` clips the table's square corners to the rounded border; the table
1315
+ scrolls in `.ctl-table-scroll` inside, so the footer beneath it stays put. */
1316
+ overflow: hidden;
1145
1317
  background: var(--ctl-bg);
1146
1318
  border: 1px solid var(--ctl-border);
1147
1319
  border-radius: var(--ctl-radius);
1148
1320
  }
1149
1321
 
1322
+ /* The table scrolls sideways here, not on the wrap — so the pagination footer
1323
+ below it does not slide off with a wide table. */
1324
+ .ctl-table-scroll {
1325
+ overflow-x: auto;
1326
+ }
1327
+
1150
1328
  .ctl-table {
1151
1329
  width: 100%;
1152
1330
  border-collapse: collapse;
@@ -1224,6 +1402,62 @@
1224
1402
  border-top: 0;
1225
1403
  }
1226
1404
 
1405
+ /* A view control strip above the rows (the density toggle), when a table offers
1406
+ one. Above the table rather than in the pagination footer, which a short list
1407
+ never shows. */
1408
+ .ctl-table-toolbar {
1409
+ display: flex;
1410
+ justify-content: flex-end;
1411
+ gap: var(--ctl-space-2);
1412
+ padding: var(--ctl-space-2) var(--ctl-space-3);
1413
+ background: var(--ctl-surface);
1414
+ border-bottom: 1px solid var(--ctl-border);
1415
+ }
1416
+
1417
+ .ctl-density-toggle {
1418
+ padding: var(--ctl-space-1) var(--ctl-space-3);
1419
+ font: inherit;
1420
+ font-size: var(--ctl-text-xs);
1421
+ font-weight: 600;
1422
+ color: var(--ctl-text);
1423
+ cursor: pointer;
1424
+ background: var(--ctl-bg);
1425
+ border: 1px solid var(--ctl-border);
1426
+ border-radius: var(--ctl-radius-sm);
1427
+ }
1428
+
1429
+ .ctl-density-toggle:hover {
1430
+ background: var(--ctl-hover);
1431
+ }
1432
+
1433
+ /* Export CSV shares the toggle's look; nothing to export reads as unavailable, not pressed. */
1434
+ .ctl-table-export:disabled {
1435
+ cursor: default;
1436
+ opacity: 0.55;
1437
+ }
1438
+
1439
+ .ctl-density-toggle:focus-visible {
1440
+ outline: 2px solid var(--ctl-accent);
1441
+ outline-offset: 1px;
1442
+ }
1443
+
1444
+ /* The pressed state reads as chosen, not just hovered. */
1445
+ .ctl-density-toggle[aria-pressed='true'] {
1446
+ color: var(--ctl-accent);
1447
+ background: var(--ctl-hover);
1448
+ border-color: var(--ctl-accent);
1449
+ }
1450
+
1451
+ /* Compact: the same table, tighter — more rows on the screen at once for a
1452
+ reviewer who wants them (CRM.md §18.6). Only the row padding changes. */
1453
+ .ctl-table-compact .ctl-td {
1454
+ padding: var(--ctl-space-2) var(--ctl-space-3);
1455
+ }
1456
+
1457
+ .ctl-table-compact .ctl-th {
1458
+ padding: var(--ctl-space-1) var(--ctl-space-3);
1459
+ }
1460
+
1227
1461
  /*
1228
1462
  * Alignment is logical, so a table reads correctly in both directions.
1229
1463
  *
@@ -1296,6 +1530,97 @@
1296
1530
  text-align: center;
1297
1531
  }
1298
1532
 
1533
+ /*
1534
+ * A column totals row (ColumnDef.footer): one <tfoot> row, its cells aligned to
1535
+ * the columns above. A stronger top rule and medium weight set it apart from the
1536
+ * body without shouting; numbers stay tabular so a total lines up under its
1537
+ * column. Empty footer cells (columns with no total) are kept for alignment in
1538
+ * the table layout — and hidden in the stacked card layout below, where an empty
1539
+ * labelled cell would just be noise.
1540
+ */
1541
+ .ctl-td-foot {
1542
+ border-top: 2px solid var(--ctl-border);
1543
+ font-weight: 600;
1544
+ color: var(--ctl-text);
1545
+ font-variant-numeric: tabular-nums;
1546
+ }
1547
+
1548
+ /*
1549
+ * The list's footer: page size, where in the list this page sits, and the way
1550
+ * to the next one. It sits inside the table's bordered card, a top border
1551
+ * dividing it from the rows. A row that wraps on a narrow screen keeps its three
1552
+ * parts legible rather than clipping any of them.
1553
+ */
1554
+ .ctl-pagination {
1555
+ display: flex;
1556
+ flex-wrap: wrap;
1557
+ gap: var(--ctl-space-2) var(--ctl-space-4);
1558
+ align-items: center;
1559
+ justify-content: space-between;
1560
+ padding: var(--ctl-space-2) var(--ctl-space-3);
1561
+ background: var(--ctl-surface);
1562
+ border-top: 1px solid var(--ctl-border);
1563
+ }
1564
+
1565
+ .ctl-pagination-size {
1566
+ display: inline-flex;
1567
+ gap: var(--ctl-space-2);
1568
+ align-items: center;
1569
+ font-size: var(--ctl-text-xs);
1570
+ color: var(--ctl-muted);
1571
+ }
1572
+
1573
+ .ctl-pagination-select {
1574
+ padding: var(--ctl-space-1) var(--ctl-space-2);
1575
+ font: inherit;
1576
+ color: var(--ctl-text);
1577
+ background: var(--ctl-bg);
1578
+ border: 1px solid var(--ctl-border);
1579
+ border-radius: var(--ctl-radius-sm);
1580
+ }
1581
+
1582
+ .ctl-pagination-select:focus-visible {
1583
+ outline: 2px solid var(--ctl-accent);
1584
+ outline-offset: 1px;
1585
+ }
1586
+
1587
+ .ctl-pagination-info {
1588
+ font-size: var(--ctl-text-xs);
1589
+ color: var(--ctl-muted);
1590
+ }
1591
+
1592
+ .ctl-pagination-nav {
1593
+ display: inline-flex;
1594
+ gap: var(--ctl-space-1);
1595
+ align-items: center;
1596
+ }
1597
+
1598
+ .ctl-pagination-button {
1599
+ padding: var(--ctl-space-1) var(--ctl-space-3);
1600
+ font: inherit;
1601
+ font-size: var(--ctl-text-xs);
1602
+ font-weight: 600;
1603
+ color: var(--ctl-text);
1604
+ cursor: pointer;
1605
+ background: var(--ctl-bg);
1606
+ border: 1px solid var(--ctl-border);
1607
+ border-radius: var(--ctl-radius-sm);
1608
+ }
1609
+
1610
+ .ctl-pagination-button:hover:not(:disabled) {
1611
+ background: var(--ctl-hover);
1612
+ }
1613
+
1614
+ .ctl-pagination-button:focus-visible {
1615
+ outline: 2px solid var(--ctl-accent);
1616
+ outline-offset: 1px;
1617
+ }
1618
+
1619
+ .ctl-pagination-button:disabled {
1620
+ color: var(--ctl-faint);
1621
+ cursor: default;
1622
+ }
1623
+
1299
1624
  /*
1300
1625
  * Every state is designed, not just the happy one. An empty list rendering as
1301
1626
  * blank space is a bug: it says what this place is for and offers the action
@@ -1465,6 +1790,18 @@
1465
1790
  display: block;
1466
1791
  }
1467
1792
 
1793
+ /* The totals footer stacks like the body; a column with no total renders an
1794
+ empty footer cell, which would show as a bare label here, so drop the empties. */
1795
+ .ctl-table-stacks .ctl-table tfoot {
1796
+ display: block;
1797
+ }
1798
+ /* `.ctl-table` in the selector lifts this above the sibling
1799
+ `.ctl-table-stacks .ctl-td:not(.ctl-table-empty){display:flex}` rule, which
1800
+ has equal specificity and would otherwise win by order and re-show these. */
1801
+ .ctl-table-stacks .ctl-table .ctl-td-foot:empty {
1802
+ display: none;
1803
+ }
1804
+
1468
1805
  .ctl-table-stacks .ctl-table thead {
1469
1806
  /* Not `display: none`: a screen reader still reads the head as the name of
1470
1807
  each cell, and hiding it outright takes that away as well as the layout. */
@@ -1561,9 +1898,15 @@
1561
1898
  * list of presets beside it. `max-width` in view units rather than a second
1562
1899
  * fixed number: `useAnchoredPopover` caps the width to the room there is, and
1563
1900
  * this keeps the two panels side by side until there is not room for them.
1901
+ *
1902
+ * The minimum is what the two panels need side by side, not 280px:
1903
+ * `useAnchoredPopover` sets the popover's `width` to the anchor's, which for a
1904
+ * date range in a filter bar is far narrower than presets plus a calendar, so
1905
+ * without it the panels overflow into a sideways scrollbar. The hook lifts this
1906
+ * minimum in a window narrower than it, and under 480px the panels stack.
1564
1907
  */
1565
1908
  .ctl-daterange-popover {
1566
- min-width: 280px;
1909
+ min-width: min(540px, calc(100vw - 16px));
1567
1910
  max-width: min(560px, 96vw);
1568
1911
  }
1569
1912
 
@@ -1671,6 +2014,11 @@
1671
2014
  min-width: 120px;
1672
2015
  }
1673
2016
 
2017
+ .ctl-daterange-field.ctl-daterange-time {
2018
+ flex: 0 0 auto;
2019
+ min-width: 112px;
2020
+ }
2021
+
1674
2022
  .ctl-daterange-amount {
1675
2023
  width: 72px;
1676
2024
  flex-shrink: 0;
@@ -1812,3 +2160,368 @@
1812
2160
  border-radius: var(--ctl-radius-pill);
1813
2161
  }
1814
2162
  }
2163
+
2164
+ /* ─────────────────────────────────────────────────────────────────────────
2165
+ * Chips: a row of one-tap filters above a list (<ChipRow>).
2166
+ *
2167
+ * Pills, so they read as choices rather than buttons; the pressed one takes
2168
+ * the soft accent — the same mark the selected tab and the active menu item
2169
+ * carry, so "chosen" looks the same everywhere. The row scrolls sideways with
2170
+ * the scrollbar hidden rather than wrapping into a wall on a phone.
2171
+ */
2172
+ .ctl-chiprow {
2173
+ display: flex;
2174
+ gap: var(--ctl-space-1);
2175
+ padding: 2px 0;
2176
+ overflow-x: auto;
2177
+ scrollbar-width: none;
2178
+ }
2179
+
2180
+ .ctl-chiprow::-webkit-scrollbar {
2181
+ display: none;
2182
+ }
2183
+
2184
+ .ctl-chiprow-chip {
2185
+ display: inline-flex;
2186
+ flex: 0 0 auto;
2187
+ gap: var(--ctl-space-1);
2188
+ align-items: center;
2189
+ padding: 3px var(--ctl-space-3);
2190
+ font: inherit;
2191
+ font-size: var(--ctl-text-sm);
2192
+ font-weight: 500;
2193
+ line-height: 1.5;
2194
+ color: var(--ctl-muted);
2195
+ white-space: nowrap;
2196
+ cursor: pointer;
2197
+ background: var(--ctl-bg);
2198
+ border: 1px solid var(--ctl-border);
2199
+ border-radius: var(--ctl-radius-pill);
2200
+ }
2201
+
2202
+ .ctl-chiprow-chip:hover:not(:disabled) {
2203
+ color: var(--ctl-text);
2204
+ border-color: var(--ctl-accent);
2205
+ }
2206
+
2207
+ .ctl-chiprow-chip[aria-pressed='true'] {
2208
+ color: var(--ctl-text);
2209
+ background: var(--ctl-accent-soft);
2210
+ border-color: var(--ctl-accent-soft);
2211
+ }
2212
+
2213
+ .ctl-chiprow-chip:focus-visible {
2214
+ outline: 2px solid var(--ctl-accent);
2215
+ outline-offset: 1px;
2216
+ }
2217
+
2218
+ .ctl-chiprow-chip:disabled {
2219
+ cursor: default;
2220
+ opacity: 0.5;
2221
+ }
2222
+
2223
+ .ctl-chiprow-count {
2224
+ font-weight: 400;
2225
+ color: var(--ctl-faint);
2226
+ }
2227
+
2228
+ .ctl-chiprow-chip[aria-pressed='true'] .ctl-chiprow-count {
2229
+ color: var(--ctl-muted);
2230
+ }
2231
+
2232
+ /* ─────────────────────────────────────────────────────────────────────────
2233
+ * Toasts: the acknowledgement a save deserves (<ToastProvider>, useToast).
2234
+ *
2235
+ * Ink on the page's surface colour, bottom-centre (both inline edges pinned
2236
+ * and the inline margins auto, so it centres without a physical `left`),
2237
+ * above everything but a dialog's prompt; a tone shows as a rule on the
2238
+ * leading edge rather than a whole colour, so the strip stays readable and
2239
+ * one meaning per colour holds.
2240
+ */
2241
+ .ctl-toaster {
2242
+ position: fixed;
2243
+ inset-inline: 0;
2244
+ bottom: calc(20px + env(safe-area-inset-bottom, 0px));
2245
+ z-index: 60;
2246
+ display: flex;
2247
+ flex-direction: column;
2248
+ gap: var(--ctl-space-2);
2249
+ align-items: center;
2250
+ width: max-content;
2251
+ max-width: min(480px, calc(100vw - 32px));
2252
+ margin-inline: auto;
2253
+ pointer-events: none;
2254
+ }
2255
+
2256
+ .ctl-toast {
2257
+ display: flex;
2258
+ gap: var(--ctl-space-3);
2259
+ align-items: center;
2260
+ max-width: 100%;
2261
+ padding-block: var(--ctl-space-2);
2262
+ padding-inline: var(--ctl-space-3) var(--ctl-space-2);
2263
+ font-size: var(--ctl-text-base);
2264
+ color: var(--ctl-bg);
2265
+ pointer-events: auto;
2266
+ background: var(--ctl-text);
2267
+ border-radius: var(--ctl-radius);
2268
+ box-shadow: var(--ctl-shadow);
2269
+ animation: ctl-toast-in 160ms ease-out;
2270
+ }
2271
+
2272
+ .ctl-toast-ok {
2273
+ border-inline-start: 3px solid var(--ctl-ok);
2274
+ }
2275
+
2276
+ .ctl-toast-warn {
2277
+ border-inline-start: 3px solid var(--ctl-warn);
2278
+ }
2279
+
2280
+ .ctl-toast-danger {
2281
+ border-inline-start: 3px solid var(--ctl-danger);
2282
+ }
2283
+
2284
+ .ctl-toast-message {
2285
+ min-width: 0;
2286
+ }
2287
+
2288
+ .ctl-toast-dismiss {
2289
+ display: inline-flex;
2290
+ align-items: center;
2291
+ justify-content: center;
2292
+ width: 24px;
2293
+ height: 24px;
2294
+ padding: 0;
2295
+ font: inherit;
2296
+ font-size: var(--ctl-text-lg);
2297
+ line-height: 1;
2298
+ color: inherit;
2299
+ cursor: pointer;
2300
+ background: none;
2301
+ border: 0;
2302
+ border-radius: var(--ctl-radius-pill);
2303
+ opacity: 0.7;
2304
+ }
2305
+
2306
+ .ctl-toast-dismiss:hover {
2307
+ opacity: 1;
2308
+ }
2309
+
2310
+ .ctl-toast-dismiss:focus-visible {
2311
+ outline: 2px solid var(--ctl-bg);
2312
+ outline-offset: 1px;
2313
+ }
2314
+
2315
+ @keyframes ctl-toast-in {
2316
+ from {
2317
+ opacity: 0;
2318
+ transform: translateY(6px);
2319
+ }
2320
+
2321
+ to {
2322
+ opacity: 1;
2323
+ transform: none;
2324
+ }
2325
+ }
2326
+
2327
+ @media (prefers-reduced-motion: reduce) {
2328
+ .ctl-toast {
2329
+ animation: none;
2330
+ }
2331
+ }
2332
+
2333
+ /* ─────────────────────────────────────────────────────────────────────────
2334
+ * Item rows: the to-do shape (<ItemList>) — a checkbox, the line, its meta,
2335
+ * a date at the end and the row's small actions, under optional group
2336
+ * headings. Hairline rows, no card chrome: the list is the card.
2337
+ */
2338
+ .ctl-items {
2339
+ display: flex;
2340
+ flex-direction: column;
2341
+ gap: var(--ctl-space-4);
2342
+ }
2343
+
2344
+ .ctl-items-group {
2345
+ min-width: 0;
2346
+ }
2347
+
2348
+ .ctl-items-heading {
2349
+ display: flex;
2350
+ gap: var(--ctl-space-1);
2351
+ align-items: baseline;
2352
+ margin: 0 0 var(--ctl-space-1);
2353
+ font-size: var(--ctl-text-sm);
2354
+ font-weight: 500;
2355
+ color: var(--ctl-faint);
2356
+ }
2357
+
2358
+ .ctl-items-count {
2359
+ font-weight: 400;
2360
+ color: var(--ctl-faint);
2361
+ }
2362
+
2363
+ .ctl-items-list {
2364
+ padding: 0;
2365
+ margin: 0;
2366
+ list-style: none;
2367
+ }
2368
+
2369
+ .ctl-items-empty {
2370
+ margin: 0;
2371
+ color: var(--ctl-muted);
2372
+ }
2373
+
2374
+ .ctl-item {
2375
+ display: flex;
2376
+ gap: var(--ctl-space-3);
2377
+ align-items: flex-start;
2378
+ padding: var(--ctl-space-2) 0;
2379
+ border-bottom: 1px solid var(--ctl-border);
2380
+ }
2381
+
2382
+ .ctl-item:last-child {
2383
+ border-bottom: 0;
2384
+ }
2385
+
2386
+ .ctl-item-check {
2387
+ flex: 0 0 auto;
2388
+ width: 16px;
2389
+ height: 16px;
2390
+ margin: 3px 0 0;
2391
+ accent-color: var(--ctl-accent);
2392
+ }
2393
+
2394
+ .ctl-item-body {
2395
+ flex: 1 1 auto;
2396
+ min-width: 0;
2397
+ }
2398
+
2399
+ .ctl-item-title {
2400
+ color: var(--ctl-text);
2401
+ overflow-wrap: anywhere;
2402
+ }
2403
+
2404
+ .ctl-item-done .ctl-item-title {
2405
+ color: var(--ctl-faint);
2406
+ text-decoration: line-through;
2407
+ }
2408
+
2409
+ .ctl-item-meta {
2410
+ font-size: var(--ctl-text-sm);
2411
+ color: var(--ctl-muted);
2412
+ overflow-wrap: anywhere;
2413
+ }
2414
+
2415
+ .ctl-item-date {
2416
+ flex: 0 0 auto;
2417
+ font-size: var(--ctl-text-sm);
2418
+ font-variant-numeric: tabular-nums;
2419
+ color: var(--ctl-faint);
2420
+ white-space: nowrap;
2421
+ }
2422
+
2423
+ .ctl-item-date-due {
2424
+ color: var(--ctl-warn);
2425
+ }
2426
+
2427
+ .ctl-item-date-overdue {
2428
+ color: var(--ctl-danger);
2429
+ }
2430
+
2431
+ .ctl-item-actions {
2432
+ display: flex;
2433
+ flex: 0 0 auto;
2434
+ gap: 2px;
2435
+ opacity: 0.6;
2436
+ }
2437
+
2438
+ .ctl-item:hover .ctl-item-actions,
2439
+ .ctl-item:focus-within .ctl-item-actions {
2440
+ opacity: 1;
2441
+ }
2442
+
2443
+ @media (pointer: coarse) {
2444
+ .ctl-item-actions {
2445
+ opacity: 1;
2446
+ }
2447
+ }
2448
+
2449
+ /* ─────────────────────────────────────────────────────────────────────────
2450
+ * Row cards: the <DataTable> as a list of cards (`rowCard`), the shape a
2451
+ * master pane and a phone list take — each row one card with whatever the
2452
+ * caller draws inside it, selected and clickable like a table row.
2453
+ */
2454
+ .ctl-cards {
2455
+ display: flex;
2456
+ flex-direction: column;
2457
+ gap: var(--ctl-space-2);
2458
+ padding: 0;
2459
+ margin: 0;
2460
+ list-style: none;
2461
+ }
2462
+
2463
+ .ctl-card-row {
2464
+ display: flex;
2465
+ gap: var(--ctl-space-3);
2466
+ align-items: center;
2467
+ padding: var(--ctl-space-3);
2468
+ background: var(--ctl-bg);
2469
+ border: 1px solid var(--ctl-border);
2470
+ border-radius: var(--ctl-radius-lg);
2471
+ }
2472
+
2473
+ .ctl-card-row-clickable {
2474
+ cursor: pointer;
2475
+ }
2476
+
2477
+ .ctl-card-row-clickable:hover {
2478
+ border-color: var(--ctl-accent);
2479
+ }
2480
+
2481
+ .ctl-card-row:focus-visible {
2482
+ outline: 2px solid var(--ctl-accent);
2483
+ outline-offset: 1px;
2484
+ }
2485
+
2486
+ .ctl-card-row-selected {
2487
+ background: var(--ctl-accent-soft);
2488
+ border-color: var(--ctl-accent);
2489
+ }
2490
+
2491
+ .ctl-card-body {
2492
+ flex: 1 1 auto;
2493
+ min-width: 0;
2494
+ }
2495
+
2496
+ .ctl-card-empty {
2497
+ padding: var(--ctl-space-4);
2498
+ color: var(--ctl-muted);
2499
+ text-align: center;
2500
+ list-style: none;
2501
+ }
2502
+
2503
+ /* Touch targets (PR #226 review): a chip and the toast's dismiss are 44px on a
2504
+ coarse pointer, keeping their desktop sizes elsewhere. The dismiss grows
2505
+ outward (negative margin) so the strip's visual size does not change. */
2506
+ @media (pointer: coarse) {
2507
+ .ctl-chiprow-chip {
2508
+ min-height: 44px;
2509
+ padding: 6px var(--ctl-space-4);
2510
+ }
2511
+
2512
+ .ctl-toast-dismiss {
2513
+ width: 44px;
2514
+ height: 44px;
2515
+ margin: -10px;
2516
+ }
2517
+ }
2518
+
2519
+ /* Reduced motion, restated last (PR #226 review): the phone bottom sheet's
2520
+ rise and the toast's fade are declared after the earlier reduced-motion
2521
+ rule, so this one must come after both to win. */
2522
+ @media (prefers-reduced-motion: reduce) {
2523
+ .ctl-modal,
2524
+ .ctl-toast {
2525
+ animation: none;
2526
+ }
2527
+ }