@gridkitjs/theme-tailwind 0.8.1 → 0.9.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gridkitjs/theme-tailwind
2
2
 
3
- Tailwind v4 theme for [GridKit](https://github.com/blagojablazhevski/gridkit) —
3
+ Tailwind v4 theme for [GridKit](https://github.com/gridkitjs/gridkitjs) —
4
4
  palette tokens, dark mode and the grid's styles.
5
5
 
6
6
  > **Early development.** The API is still moving and may break between minor
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@gridkitjs/theme-tailwind",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Tailwind v4 theme for GridKit — palette tokens, dark mode and grid styles.",
5
5
  "license": "MIT",
6
6
  "author": "Blagoja Blazhevski",
7
- "homepage": "https://github.com/blagojablazhevski/gridkit#readme",
7
+ "homepage": "https://github.com/gridkitjs/gridkitjs#readme",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/blagojablazhevski/gridkit.git",
10
+ "url": "git+https://github.com/gridkitjs/gridkitjs.git",
11
11
  "directory": "packages/theme-tailwind"
12
12
  },
13
13
  "keywords": [
package/src/styles.css CHANGED
@@ -441,6 +441,54 @@
441
441
  color: var(--gridkit-accent);
442
442
  }
443
443
 
444
+ /*
445
+ * Docked to the header's end, absolutely, for the sort toggle's reasons —
446
+ * at the very end, where a spreadsheet keeps its filter button, with a
447
+ * sortable column's sort toggle moved over beside it. Hidden until the
448
+ * header is hovered or focused, as an unsorted sort toggle is, and shown,
449
+ * filled in accent, while the column is filtered: the one sign of it on
450
+ * screen.
451
+ */
452
+ .gridkit-data-grid .header-filter-toggle {
453
+ display: inline-flex;
454
+ position: absolute;
455
+ top: 50%;
456
+ right: 0.75rem;
457
+ transform: translateY(-50%);
458
+ align-items: center;
459
+ cursor: pointer;
460
+ color: var(--gridkit-fg-muted);
461
+ }
462
+
463
+ .gridkit-data-grid .header-filter-toggle svg {
464
+ width: 14px;
465
+ height: 14px;
466
+ flex-shrink: 0;
467
+ }
468
+
469
+ .gridkit-data-grid .header-filter-toggle:not(.is-filtered) {
470
+ opacity: 0;
471
+ }
472
+
473
+ .gridkit-data-grid .grid-header .header-cell:hover .header-filter-toggle,
474
+ .gridkit-data-grid .header-cell:focus-visible .header-filter-toggle {
475
+ opacity: 1;
476
+ }
477
+
478
+ .gridkit-data-grid .header-filter-toggle.is-filtered {
479
+ color: var(--gridkit-accent);
480
+ }
481
+
482
+ .gridkit-data-grid .header-filter-toggle.is-filtered svg {
483
+ fill: currentColor;
484
+ }
485
+
486
+ .gridkit-data-grid
487
+ .header-cell:has(> .header-filter-toggle)
488
+ .header-sort-toggle {
489
+ right: 2rem;
490
+ }
491
+
444
492
  .gridkit-data-grid .grid-cell {
445
493
  padding: 0.5rem;
446
494
  }
@@ -1323,4 +1371,492 @@
1323
1371
  padding: 0.25rem;
1324
1372
  color: var(--gridkit-fg-muted);
1325
1373
  }
1374
+
1375
+ /*
1376
+ * A column's filter menu, an overlay like the chooser: the column's sort
1377
+ * entries, its editor, then its buttons. A fixed width, so the panel does
1378
+ * not jump sideways as its editor changes.
1379
+ */
1380
+ .gridkit-filter-menu {
1381
+ box-sizing: border-box;
1382
+ width: 18rem;
1383
+ padding: 0.5rem;
1384
+ font-size: 0.875rem;
1385
+ background-color: var(--gridkit-surface);
1386
+ border: 1px solid var(--gridkit-line);
1387
+ border-radius: 0.375rem;
1388
+ box-shadow: 0 4px 12px oklch(0 0 0 / 0.15);
1389
+ }
1390
+
1391
+ .filter-menu-form {
1392
+ display: flex;
1393
+ flex-direction: column;
1394
+ gap: 0.5rem;
1395
+ margin: 0;
1396
+ }
1397
+
1398
+ /* The sort entries, drawn as a menu's items and set apart from the editor. */
1399
+ .filter-menu-sort {
1400
+ display: flex;
1401
+ flex-direction: column;
1402
+ padding-bottom: 0.375rem;
1403
+ border-bottom: 1px solid var(--gridkit-line);
1404
+ }
1405
+
1406
+ .filter-menu-sort-item {
1407
+ display: flex;
1408
+ align-items: center;
1409
+ gap: 0.5rem;
1410
+ padding: 0.375rem 0.5rem;
1411
+ font: inherit;
1412
+ color: inherit;
1413
+ text-align: start;
1414
+ background: none;
1415
+ border: 0;
1416
+ border-radius: 0.25rem;
1417
+ cursor: pointer;
1418
+ }
1419
+
1420
+ .filter-menu-sort-item:hover {
1421
+ background-color: var(--gridkit-surface-muted);
1422
+ }
1423
+
1424
+ .filter-menu-sort-item:focus-visible {
1425
+ outline: 2px solid var(--gridkit-accent);
1426
+ outline-offset: -2px;
1427
+ }
1428
+
1429
+ .filter-menu-sort-item:disabled {
1430
+ color: var(--gridkit-fg-muted);
1431
+ background: none;
1432
+ cursor: default;
1433
+ }
1434
+
1435
+ /* Always there, empty for "Clear sort", so every label starts in line. */
1436
+ .filter-menu-sort-icon {
1437
+ display: inline-flex;
1438
+ flex-shrink: 0;
1439
+ align-items: center;
1440
+ justify-content: center;
1441
+ width: 1rem;
1442
+ height: 1rem;
1443
+ color: var(--gridkit-fg-muted);
1444
+ }
1445
+
1446
+ .filter-menu-sort-icon svg {
1447
+ width: 1rem;
1448
+ height: 1rem;
1449
+ }
1450
+
1451
+ /* The direction the column sorts in now. */
1452
+ .filter-menu-sort-item[aria-pressed="true"] .filter-menu-sort-icon {
1453
+ color: var(--gridkit-accent);
1454
+ }
1455
+
1456
+ /*
1457
+ * The simple editor: its conditions in a column, And/Or between them, and
1458
+ * the message under them while one is marked invalid.
1459
+ */
1460
+ .filter-menu-conditions {
1461
+ display: flex;
1462
+ flex-direction: column;
1463
+ gap: 0.5rem;
1464
+ }
1465
+
1466
+ /*
1467
+ * "Custom filter", or "Filtered by condition" above a checklist: a filter
1468
+ * the editor can't show, until it applies one in its place.
1469
+ */
1470
+ .filter-menu-custom {
1471
+ margin: 0;
1472
+ padding: 0.25rem 0.5rem;
1473
+ color: var(--gridkit-fg-muted);
1474
+ background-color: var(--gridkit-surface-muted);
1475
+ border-radius: 0.25rem;
1476
+ }
1477
+
1478
+ /*
1479
+ * The operator picker on a line of its own, the value boxes sharing the
1480
+ * next: one fills it, and a "Between"'s two halve it.
1481
+ */
1482
+ .filter-menu-condition {
1483
+ display: flex;
1484
+ flex-wrap: wrap;
1485
+ gap: 0.375rem;
1486
+ }
1487
+
1488
+ .filter-menu-operator,
1489
+ .filter-menu-value {
1490
+ box-sizing: border-box;
1491
+ min-width: 0;
1492
+ padding: 0.25rem 0.5rem;
1493
+ font: inherit;
1494
+ color: var(--gridkit-fg);
1495
+ background-color: var(--gridkit-surface);
1496
+ border: 1px solid var(--gridkit-line);
1497
+ border-radius: 0.25rem;
1498
+ }
1499
+
1500
+ .filter-menu-operator {
1501
+ flex-basis: 100%;
1502
+ }
1503
+
1504
+ .filter-menu-value {
1505
+ flex: 1 1 0;
1506
+ }
1507
+
1508
+ .filter-menu-operator:focus-visible,
1509
+ .filter-menu-value:focus-visible {
1510
+ outline: 2px solid var(--gridkit-accent);
1511
+ outline-offset: 1px;
1512
+ }
1513
+
1514
+ /*
1515
+ * No palette token names an error colour, so a marked box and its message
1516
+ * take the accent turned red — as light or dark as the accent, in either
1517
+ * palette — over the text colour where that syntax is not supported.
1518
+ */
1519
+ .filter-menu-value[aria-invalid="true"] {
1520
+ border-color: var(--gridkit-fg);
1521
+ border-color: oklch(from var(--gridkit-accent) l c 25);
1522
+ }
1523
+
1524
+ .filter-menu-invalid {
1525
+ margin: 0;
1526
+ color: var(--gridkit-fg);
1527
+ color: oklch(from var(--gridkit-accent) l c 25);
1528
+ }
1529
+
1530
+ /* And/Or, native radio buttons between the two conditions. */
1531
+ .filter-menu-combinator {
1532
+ display: flex;
1533
+ gap: 1rem;
1534
+ }
1535
+
1536
+ .filter-menu-combinator-option {
1537
+ display: inline-flex;
1538
+ align-items: center;
1539
+ gap: 0.375rem;
1540
+ cursor: pointer;
1541
+ user-select: none;
1542
+ }
1543
+
1544
+ .filter-menu-combinator-option input {
1545
+ margin: 0;
1546
+ accent-color: var(--gridkit-accent);
1547
+ }
1548
+
1549
+ .filter-menu-combinator-option input:focus-visible {
1550
+ outline: 2px solid var(--gridkit-accent);
1551
+ outline-offset: 1px;
1552
+ }
1553
+
1554
+ /*
1555
+ * The excel editor: a search box, "Select all", then the checklist of the
1556
+ * column's values, with a note above or below it when one applies.
1557
+ */
1558
+ .filter-menu-values {
1559
+ display: flex;
1560
+ flex-direction: column;
1561
+ gap: 0.375rem;
1562
+ }
1563
+
1564
+ /*
1565
+ * The excel editor's "Number filters" button, drawn as a menu item whose
1566
+ * submenu opens beside it, and "Back to values" above a condition it
1567
+ * chose: the sort entries' look, an icon before the label in line with
1568
+ * theirs.
1569
+ */
1570
+ .filter-menu-submenu,
1571
+ .filter-menu-back {
1572
+ display: flex;
1573
+ align-items: center;
1574
+ gap: 0.5rem;
1575
+ padding: 0.375rem 0.5rem;
1576
+ font: inherit;
1577
+ color: inherit;
1578
+ text-align: start;
1579
+ background: none;
1580
+ border: 0;
1581
+ border-radius: 0.25rem;
1582
+ cursor: pointer;
1583
+ }
1584
+
1585
+ .filter-menu-submenu:hover,
1586
+ .filter-menu-submenu[aria-expanded="true"],
1587
+ .filter-menu-back:hover {
1588
+ background-color: var(--gridkit-surface-muted);
1589
+ }
1590
+
1591
+ .filter-menu-submenu:focus-visible,
1592
+ .filter-menu-back:focus-visible {
1593
+ outline: 2px solid var(--gridkit-accent);
1594
+ outline-offset: -2px;
1595
+ }
1596
+
1597
+ .filter-menu-submenu-icon,
1598
+ .filter-menu-submenu-indicator,
1599
+ .filter-menu-back-icon {
1600
+ display: inline-flex;
1601
+ flex-shrink: 0;
1602
+ align-items: center;
1603
+ justify-content: center;
1604
+ width: 1rem;
1605
+ height: 1rem;
1606
+ color: var(--gridkit-fg-muted);
1607
+ }
1608
+
1609
+ .filter-menu-submenu svg,
1610
+ .filter-menu-back svg {
1611
+ width: 1rem;
1612
+ height: 1rem;
1613
+ }
1614
+
1615
+ /* Ticked while the column is filtered by conditions, as Excel's is. */
1616
+ .filter-menu-submenu-icon {
1617
+ color: var(--gridkit-accent);
1618
+ }
1619
+
1620
+ /* The submenu's chevron, at the end of the line. */
1621
+ .filter-menu-submenu-indicator {
1622
+ margin-inline-start: auto;
1623
+ }
1624
+
1625
+ .filter-menu-search {
1626
+ box-sizing: border-box;
1627
+ width: 100%;
1628
+ padding: 0.25rem 0.5rem;
1629
+ font: inherit;
1630
+ color: var(--gridkit-fg);
1631
+ background-color: var(--gridkit-surface);
1632
+ border: 1px solid var(--gridkit-line);
1633
+ border-radius: 0.25rem;
1634
+ }
1635
+
1636
+ .filter-menu-search::placeholder {
1637
+ color: var(--gridkit-fg-muted);
1638
+ }
1639
+
1640
+ .filter-menu-search:focus-visible {
1641
+ outline: 2px solid var(--gridkit-accent);
1642
+ outline-offset: 1px;
1643
+ }
1644
+
1645
+ /* A native checkbox, in line with the drawn ones in the list below. */
1646
+ .filter-menu-select-all {
1647
+ display: flex;
1648
+ align-items: center;
1649
+ gap: 0.5rem;
1650
+ padding: 0.25rem calc(0.5rem + 1px);
1651
+ cursor: pointer;
1652
+ user-select: none;
1653
+ }
1654
+
1655
+ .filter-menu-select-all input {
1656
+ flex-shrink: 0;
1657
+ width: 1rem;
1658
+ height: 1rem;
1659
+ margin: 0;
1660
+ accent-color: var(--gridkit-accent);
1661
+ }
1662
+
1663
+ .filter-menu-select-all input:focus-visible {
1664
+ outline: 2px solid var(--gridkit-accent);
1665
+ outline-offset: 1px;
1666
+ }
1667
+
1668
+ /* Nothing to select: the search matches no value. */
1669
+ .filter-menu-select-all:has(> input:disabled) {
1670
+ color: var(--gridkit-fg-muted);
1671
+ cursor: default;
1672
+ }
1673
+
1674
+ /*
1675
+ * The list scrolls inside itself, at a fixed height: the menu keeps its
1676
+ * size as a search narrows the list, and the virtualizer windowing it
1677
+ * knows from the start how many values it shows. "Type to search …"
1678
+ * takes the same box while the list waits for a search.
1679
+ */
1680
+ .filter-menu-checklist,
1681
+ .filter-menu-search-first {
1682
+ box-sizing: border-box;
1683
+ height: 12rem;
1684
+ margin: 0;
1685
+ border: 1px solid var(--gridkit-line);
1686
+ border-radius: 0.25rem;
1687
+ }
1688
+
1689
+ .filter-menu-checklist {
1690
+ overflow-y: auto;
1691
+ }
1692
+
1693
+ .filter-menu-search-first {
1694
+ padding: 0.5rem;
1695
+ color: var(--gridkit-fg-muted);
1696
+ }
1697
+
1698
+ /* One value: a drawn checkbox, its label, and its count when shown. */
1699
+ .filter-menu-option {
1700
+ display: flex;
1701
+ align-items: center;
1702
+ gap: 0.5rem;
1703
+ padding: 0.25rem 0.5rem;
1704
+ line-height: 1.25rem;
1705
+ cursor: pointer;
1706
+ user-select: none;
1707
+ }
1708
+
1709
+ .filter-menu-option:hover {
1710
+ background-color: var(--gridkit-surface-muted);
1711
+ }
1712
+
1713
+ .filter-menu-option:focus-visible {
1714
+ outline: 2px solid var(--gridkit-accent);
1715
+ outline-offset: -2px;
1716
+ }
1717
+
1718
+ /*
1719
+ * An outline, filled with the accent and ticked in the surface colour
1720
+ * while the option is checked, as the native "Select all" above it is.
1721
+ */
1722
+ .filter-menu-option-check {
1723
+ display: inline-flex;
1724
+ flex-shrink: 0;
1725
+ align-items: center;
1726
+ justify-content: center;
1727
+ box-sizing: border-box;
1728
+ width: 1rem;
1729
+ height: 1rem;
1730
+ color: var(--gridkit-surface);
1731
+ border: 1px solid var(--gridkit-fg-muted);
1732
+ border-radius: 0.1875rem;
1733
+ }
1734
+
1735
+ .filter-menu-option-check svg {
1736
+ width: 0.75rem;
1737
+ height: 0.75rem;
1738
+ visibility: hidden;
1739
+ }
1740
+
1741
+ .filter-menu-option[aria-checked="true"] .filter-menu-option-check {
1742
+ background-color: var(--gridkit-accent);
1743
+ border-color: var(--gridkit-accent);
1744
+ }
1745
+
1746
+ .filter-menu-option[aria-checked="true"] .filter-menu-option-check svg {
1747
+ visibility: visible;
1748
+ }
1749
+
1750
+ /* A label too long for the menu ends in an ellipsis. */
1751
+ .filter-menu-option-label {
1752
+ flex: 1;
1753
+ min-width: 0;
1754
+ overflow: hidden;
1755
+ text-overflow: ellipsis;
1756
+ white-space: nowrap;
1757
+ }
1758
+
1759
+ /* How many rows hold the value, muted at the end of its line. */
1760
+ .filter-menu-option-count {
1761
+ flex-shrink: 0;
1762
+ font-size: 0.75rem;
1763
+ font-variant-numeric: tabular-nums;
1764
+ color: var(--gridkit-fg-muted);
1765
+ }
1766
+
1767
+ /* "250 more, refine the search", under a list the value limit cut short. */
1768
+ .filter-menu-more {
1769
+ margin: 0;
1770
+ padding: 0 0.5rem;
1771
+ color: var(--gridkit-fg-muted);
1772
+ }
1773
+
1774
+ /* "Clear filter" at the start; Cancel and OK at the end. */
1775
+ .filter-menu-actions {
1776
+ display: flex;
1777
+ align-items: center;
1778
+ gap: 0.5rem;
1779
+ }
1780
+
1781
+ .filter-menu-actions button {
1782
+ padding: 0.25rem 0.75rem;
1783
+ font: inherit;
1784
+ color: var(--gridkit-fg);
1785
+ background-color: var(--gridkit-surface);
1786
+ border: 1px solid var(--gridkit-line);
1787
+ border-radius: 0.25rem;
1788
+ cursor: pointer;
1789
+ }
1790
+
1791
+ .filter-menu-actions button:hover {
1792
+ background-color: var(--gridkit-surface-muted);
1793
+ }
1794
+
1795
+ .filter-menu-actions button:focus-visible {
1796
+ outline: 2px solid var(--gridkit-accent);
1797
+ outline-offset: 1px;
1798
+ }
1799
+
1800
+ .filter-menu-actions button:disabled {
1801
+ color: var(--gridkit-fg-muted);
1802
+ background-color: var(--gridkit-surface);
1803
+ cursor: default;
1804
+ }
1805
+
1806
+ .filter-menu-actions .filter-menu-clear {
1807
+ margin-inline-end: auto;
1808
+ }
1809
+
1810
+ /*
1811
+ * OK, the button Enter presses: tinted rather than filled with the accent,
1812
+ * which the text on it would not stand out from in the light palette.
1813
+ */
1814
+ .filter-menu-actions .filter-menu-apply {
1815
+ background-color: var(--gridkit-selected);
1816
+ border-color: var(--gridkit-accent);
1817
+ }
1818
+
1819
+ .filter-menu-actions .filter-menu-apply:hover {
1820
+ background-color: var(--gridkit-selected-strong);
1821
+ }
1822
+ }
1823
+
1824
+ /*
1825
+ * The browser's own Ctrl+P of a page holding a grid: the grid as a plain
1826
+ * table, every row it has drawn flowing onto as many pages as it takes. Only
1827
+ * those rows — not one a virtualised grid has not mounted, nor another
1828
+ * page's — which is why printing through the grid's own Print, building a
1829
+ * document of every row in a hidden frame, is the supported path.
1830
+ */
1831
+ @layer base {
1832
+ @media print {
1833
+ /* What is for using the grid, not reading it. */
1834
+ .gridkit-data-grid-viewport .gridkit-toolbar,
1835
+ .gridkit-data-grid-viewport .gridkit-group-by-bar,
1836
+ .gridkit-data-grid-viewport .gridkit-grid-pager,
1837
+ .gridkit-data-grid-viewport .header-resize-handle {
1838
+ display: none;
1839
+ }
1840
+
1841
+ /* No height bound, and nothing scrolls, so no row is cut off. */
1842
+ .gridkit-data-grid-viewport,
1843
+ .gridkit-data-grid-viewport .gridkit-data-grid-body {
1844
+ height: auto;
1845
+ overflow: visible;
1846
+ }
1847
+
1848
+ .gridkit-data-grid-viewport :focus-visible {
1849
+ outline: none;
1850
+ }
1851
+
1852
+ /* Shading printed as it is, not dropped to save ink. */
1853
+ .gridkit-data-grid {
1854
+ -webkit-print-color-adjust: exact;
1855
+ print-color-adjust: exact;
1856
+ }
1857
+
1858
+ .gridkit-data-grid tr {
1859
+ break-inside: avoid;
1860
+ }
1861
+ }
1326
1862
  }