@donotdev/components 0.0.26 → 0.0.28

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.
@@ -117,6 +117,7 @@
117
117
  --border: color-mix(in oklab, var(--foreground) 15%, var(--background));
118
118
  --input: var(--muted);
119
119
  --ring: var(--primary);
120
+ --placeholder: rgb(from var(--muted-foreground) r g b / 0.6);
120
121
 
121
122
  /* Containers (Flat design by default) */
122
123
  --card: var(--background);
@@ -274,11 +275,6 @@
274
275
  --opacity-muted: 0.6;
275
276
  --opacity-strong: 0.9;
276
277
 
277
- /* ===========================
278
- SURFACE SYSTEM - SIMPLIFIED
279
- =========================== */
280
- /* --surface-1 deprecated: use --card */
281
-
282
278
  /* ===========================
283
279
  PANEL/POPOVER WIDTHS
284
280
  Standard widths for contextual panels, popovers, and tooltips
@@ -797,11 +793,11 @@ em {
797
793
  }
798
794
 
799
795
  .dndev-input::-moz-placeholder {
800
- color: rgb(from var(--muted-foreground) r g b / 0.6);
796
+ color: var(--placeholder);
801
797
  }
802
798
 
803
799
  .dndev-input::placeholder {
804
- color: rgb(from var(--muted-foreground) r g b / 0.6);
800
+ color: var(--placeholder);
805
801
  }
806
802
 
807
803
  .dndev-input:hover {
@@ -811,14 +807,12 @@ em {
811
807
  .dndev-input:focus {
812
808
  border-color: var(--ring);
813
809
  outline: none;
814
- box-shadow: 0 0 0 2px var(--ring);
810
+ box-shadow: var(--shadow-focus);
815
811
  }
816
812
 
817
813
  .dndev-input:focus-visible {
818
814
  outline: none;
819
- box-shadow:
820
- 0 0 0 2px var(--ring),
821
- 0 0 0 4px rgb(from var(--ring) r g b / 0.2);
815
+ box-shadow: var(--shadow-focus), var(--shadow-interactive);
822
816
  }
823
817
 
824
818
  .dndev-input:disabled {
@@ -834,13 +828,14 @@ em {
834
828
 
835
829
  .dndev-input[data-variant='destructive']:focus {
836
830
  border-color: var(--destructive);
837
- box-shadow: 0 0 0 2px var(--destructive);
831
+ box-shadow: 0 0 0 3px
832
+ color-mix(in oklab, var(--destructive) 50%, transparent);
838
833
  }
839
834
 
840
835
  .dndev-input[data-variant='destructive']:focus-visible {
841
836
  box-shadow:
842
- 0 0 0 2px var(--destructive),
843
- 0 0 0 4px rgb(from var(--destructive) r g b / 0.2);
837
+ 0 0 0 3px color-mix(in oklab, var(--destructive) 50%, transparent),
838
+ 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
844
839
  }
845
840
 
846
841
  /* File input specific styles */
@@ -852,6 +847,12 @@ em {
852
847
  font-weight: var(--font-weight-medium);
853
848
  }
854
849
 
850
+ /* Radix UI and other non-native placeholders (e.g. Select, DatePicker triggers) */
851
+
852
+ [data-placeholder] {
853
+ color: var(--placeholder);
854
+ }
855
+
855
856
  /* Control base class - checkbox, radio, switch, slider */
856
857
 
857
858
  .dndev-control {
@@ -867,9 +868,7 @@ em {
867
868
 
868
869
  .dndev-control:focus-visible {
869
870
  outline: none;
870
- box-shadow:
871
- 0 0 0 2px var(--ring),
872
- 0 0 0 4px rgb(from var(--ring) r g b / 0.2);
871
+ box-shadow: var(--shadow-focus), var(--shadow-interactive);
873
872
  }
874
873
 
875
874
  .dndev-control:disabled {
@@ -1021,13 +1020,13 @@ em {
1021
1020
  .dndev-surface[data-hover='glow']:hover {
1022
1021
  box-shadow:
1023
1022
  var(--shadow-xl),
1024
- 0 0 40px rgba(0, 0, 0, 0.3);
1023
+ 0 0 40px color-mix(in oklab, var(--foreground) 30%, transparent);
1025
1024
  }
1026
1025
 
1027
1026
  .dndev-surface[data-hover='glow']:dir(rtl):hover {
1028
1027
  box-shadow:
1029
1028
  var(--shadow-xl-rtl),
1030
- 0 0 40px rgba(0, 0, 0, 0.3);
1029
+ 0 0 40px color-mix(in oklab, var(--foreground) 30%, transparent);
1031
1030
  }
1032
1031
 
1033
1032
  /* Role-specific defaults */
@@ -1288,13 +1287,13 @@ em {
1288
1287
  .dndev-floating[data-hover='glow']:hover {
1289
1288
  box-shadow:
1290
1289
  var(--shadow-xl),
1291
- 0 0 40px rgba(0, 0, 0, 0.3);
1290
+ 0 0 40px color-mix(in oklab, var(--foreground) 30%, transparent);
1292
1291
  }
1293
1292
 
1294
1293
  .dndev-floating[data-hover='glow']:dir(rtl):hover {
1295
1294
  box-shadow:
1296
1295
  var(--shadow-xl-rtl),
1297
- 0 0 40px rgba(0, 0, 0, 0.3);
1296
+ 0 0 40px color-mix(in oklab, var(--foreground) 30%, transparent);
1298
1297
  }
1299
1298
 
1300
1299
  /* Role-specific defaults */
@@ -1412,15 +1411,21 @@ em {
1412
1411
  /* Base - filled primary (industry standard) */
1413
1412
  background: var(--primary);
1414
1413
  color: var(--primary-foreground);
1414
+
1415
+ /* ── Shared states ── */
1415
1416
  }
1416
1417
 
1417
1418
  .dndev-interactive:hover {
1418
- opacity: var(--opacity-strong);
1419
+ background: color-mix(in oklab, var(--primary) 85%, var(--foreground));
1420
+ }
1421
+
1422
+ .dndev-interactive:active:not(:disabled) {
1423
+ scale: 0.97;
1419
1424
  }
1420
1425
 
1421
1426
  .dndev-interactive:focus-visible {
1422
- outline: 2px solid var(--ring);
1423
- outline-offset: 2px;
1427
+ outline: none;
1428
+ box-shadow: var(--shadow-focus), var(--shadow-interactive);
1424
1429
  }
1425
1430
 
1426
1431
  .dndev-interactive:disabled {
@@ -1435,129 +1440,110 @@ em {
1435
1440
  flex-shrink: 0;
1436
1441
  }
1437
1442
 
1438
- /**
1439
- * Variant system - 4 button variants
1440
- */
1443
+ /* ═══════════════════════════
1444
+ FILLED VARIANTS — hover = darken/lighten the bg color
1445
+ ═══════════════════════════ */
1441
1446
 
1442
- /* Outline - secondary action */
1447
+ .dndev-interactive[data-variant='primary'] {
1448
+ background: var(--primary);
1449
+ color: var(--primary-foreground);
1450
+ }
1443
1451
 
1444
- .dndev-interactive[data-variant='outline'] {
1445
- border: var(--border-hairline) solid var(--border);
1446
- background: transparent;
1447
- color: var(--foreground);
1452
+ .dndev-interactive[data-variant='accent'] {
1453
+ background: var(--accent);
1454
+ color: var(--accent-foreground);
1448
1455
  }
1449
1456
 
1450
- .dndev-interactive[data-variant='outline']:hover {
1451
- background: var(--primary);
1452
- color: var(--primary-foreground);
1457
+ .dndev-interactive[data-variant='accent']:hover {
1458
+ background: color-mix(in oklab, var(--accent) 85%, var(--foreground));
1453
1459
  }
1454
1460
 
1455
- /* Ghost - tertiary action */
1456
-
1457
- .dndev-interactive[data-variant='ghost'] {
1458
- background: transparent;
1459
- color: var(--foreground);
1461
+ .dndev-interactive[data-variant='secondary'] {
1462
+ background: var(--secondary);
1463
+ color: var(--secondary-foreground);
1460
1464
  }
1461
1465
 
1462
- .dndev-interactive[data-variant='ghost']:hover {
1463
- background: var(--primary);
1464
- color: var(--primary-foreground);
1466
+ .dndev-interactive[data-variant='secondary']:hover {
1467
+ background: color-mix(in oklab, var(--secondary) 85%, var(--foreground));
1465
1468
  }
1466
1469
 
1467
- /* Destructive - danger */
1468
-
1469
- .dndev-interactive[data-variant='destructive'] {
1470
- background: transparent;
1471
- color: var(--destructive);
1472
- border: var(--border-hairline) solid var(--destructive);
1470
+ .dndev-interactive[data-variant='success'] {
1471
+ background: var(--success);
1472
+ color: var(--success-foreground);
1473
1473
  }
1474
1474
 
1475
- .dndev-interactive[data-variant='destructive']:hover {
1476
- background: var(--destructive);
1477
- color: var(--destructive-foreground);
1475
+ .dndev-interactive[data-variant='success']:hover {
1476
+ background: color-mix(in oklab, var(--success) 85%, var(--foreground));
1478
1477
  }
1479
1478
 
1480
- /* Link variant - action styled as text link */
1481
-
1482
- .dndev-interactive[data-variant='link'] {
1483
- background: transparent;
1484
- color: var(--muted-foreground);
1485
- padding: 0;
1486
- min-height: auto;
1487
- font-size: var(--font-size-base);
1488
- text-decoration: underline;
1489
- text-underline-offset: 2px;
1490
- transition: color var(--dur-fast) ease-out;
1479
+ .dndev-interactive[data-variant='warning'] {
1480
+ background: var(--warning);
1481
+ color: var(--warning-foreground);
1491
1482
  }
1492
1483
 
1493
- .dndev-interactive[data-variant='link']:hover {
1494
- color: var(--primary);
1484
+ .dndev-interactive[data-variant='warning']:hover {
1485
+ background: color-mix(in oklab, var(--warning) 85%, var(--foreground));
1495
1486
  }
1496
1487
 
1497
- /* Muted variant - subtle background */
1498
-
1499
1488
  .dndev-interactive[data-variant='muted'] {
1500
1489
  background: var(--muted);
1501
1490
  color: var(--muted-foreground);
1502
1491
  }
1503
1492
 
1504
1493
  .dndev-interactive[data-variant='muted']:hover {
1505
- background: color-mix(in oklab, var(--muted) 80%, black 20%);
1494
+ background: color-mix(in oklab, var(--muted) 80%, var(--foreground) 20%);
1506
1495
  }
1507
1496
 
1508
- /* Accent variant - highlighted/active state */
1497
+ /* ═══════════════════════════
1498
+ GHOST VARIANTS — hover = subtle tint + text color shift
1499
+ ═══════════════════════════ */
1509
1500
 
1510
- .dndev-interactive[data-variant='accent'] {
1511
- background: var(--accent);
1512
- color: var(--accent-foreground);
1513
- }
1514
-
1515
- .dndev-interactive[data-variant='accent']:hover {
1516
- opacity: var(--opacity-strong);
1517
- }
1501
+ /* Shared ghost hover — one rule for all transparent interactive elements */
1518
1502
 
1519
- /* Primary variant - explicit primary (base is already primary, but allows explicit override) */
1520
-
1521
- .dndev-interactive[data-variant='primary'] {
1522
- background: var(--primary);
1523
- color: var(--primary-foreground);
1503
+ .dndev-interactive[data-variant='outline'],.dndev-interactive[data-variant='ghost'],.dndev-interactive[data-role='nav-trigger'],.dndev-interactive[data-role='menu-item'],.dndev-interactive[data-role='command-item'] {
1504
+ background: transparent;
1505
+ color: var(--foreground);
1524
1506
  }
1525
1507
 
1526
- .dndev-interactive[data-variant='primary']:hover {
1527
- opacity: var(--opacity-strong);
1508
+ :is(.dndev-interactive[data-variant='outline'],.dndev-interactive[data-variant='ghost'],.dndev-interactive[data-role='nav-trigger'],.dndev-interactive[data-role='menu-item'],.dndev-interactive[data-role='command-item']):hover {
1509
+ background: rgb(from var(--primary) r g b / 0.1);
1510
+ color: var(--primary);
1528
1511
  }
1529
1512
 
1530
- /* Secondary variant - secondary brand color */
1513
+ /* Outline adds border on top of ghost base */
1531
1514
 
1532
- .dndev-interactive[data-variant='secondary'] {
1533
- background: var(--secondary);
1534
- color: var(--secondary-foreground);
1515
+ .dndev-interactive[data-variant='outline'] {
1516
+ border: var(--border-hairline) solid var(--border);
1535
1517
  }
1536
1518
 
1537
- .dndev-interactive[data-variant='secondary']:hover {
1538
- opacity: var(--opacity-strong);
1539
- }
1540
-
1541
- /* Success variant - success state */
1519
+ /* Destructive ghost — same paradigm, different color */
1542
1520
 
1543
- .dndev-interactive[data-variant='success'] {
1544
- background: var(--success);
1545
- color: var(--success-foreground);
1521
+ .dndev-interactive[data-variant='destructive'] {
1522
+ background: transparent;
1523
+ color: var(--destructive);
1524
+ border: var(--border-hairline) solid var(--destructive);
1546
1525
  }
1547
1526
 
1548
- .dndev-interactive[data-variant='success']:hover {
1549
- opacity: var(--opacity-strong);
1527
+ .dndev-interactive[data-variant='destructive']:hover {
1528
+ background: rgb(from var(--destructive) r g b / 0.1);
1529
+ color: var(--destructive);
1550
1530
  }
1551
1531
 
1552
- /* Warning variant - warning state */
1532
+ /* Link variant — text-only, no background shift */
1553
1533
 
1554
- .dndev-interactive[data-variant='warning'] {
1555
- background: var(--warning);
1556
- color: var(--warning-foreground);
1534
+ .dndev-interactive[data-variant='link'] {
1535
+ background: transparent;
1536
+ color: var(--muted-foreground);
1537
+ padding: 0;
1538
+ min-height: auto;
1539
+ font-size: var(--font-size-base);
1540
+ text-decoration: underline;
1541
+ text-underline-offset: 2px;
1542
+ transition: color var(--dur-fast) ease-out;
1557
1543
  }
1558
1544
 
1559
- .dndev-interactive[data-variant='warning']:hover {
1560
- opacity: var(--opacity-strong);
1545
+ .dndev-interactive[data-variant='link']:hover {
1546
+ color: var(--primary);
1561
1547
  }
1562
1548
 
1563
1549
  /* Context-aware: ONLY inside accent surfaces */
@@ -1576,11 +1562,11 @@ em {
1576
1562
  }
1577
1563
 
1578
1564
  :is([data-variant='outline']:is(.dndev-surface[data-variant='accent'] .dndev-interactive,.dndev-floating[data-variant='accent'] .dndev-interactive),[data-variant='ghost']:is(.dndev-surface[data-variant='accent'] .dndev-interactive,.dndev-floating[data-variant='accent'] .dndev-interactive)):hover {
1579
- background: var(--surface-text);
1580
- color: var(--surface-bg);
1565
+ background: rgb(from var(--surface-text) r g b / 0.1);
1566
+ color: var(--surface-text);
1581
1567
  }
1582
1568
 
1583
- /* Unified menu/command/nav item base */
1569
+ /* Unified menu/command/nav item base — ghost hover inherited from shared rule above */
1584
1570
 
1585
1571
  .dndev-interactive[data-role='menu-item'],.dndev-interactive[data-role='command-item'],.dndev-interactive[data-role='nav-trigger'] {
1586
1572
  min-height: auto;
@@ -1594,10 +1580,6 @@ em {
1594
1580
  position: relative;
1595
1581
  text-decoration: none;
1596
1582
 
1597
- /* Override base .dndev-interactive filled primary - make ghost */
1598
- background: transparent;
1599
- color: inherit;
1600
-
1601
1583
  /* Remove gap when compact (no label to space from) */
1602
1584
  }
1603
1585
 
@@ -1605,11 +1587,9 @@ em {
1605
1587
  gap: 0 !important;
1606
1588
  }
1607
1589
 
1608
- /* Modern industry pattern: one consistent hover/focus/active state */
1609
-
1610
- .dndev-interactive[data-role='menu-item']:hover,.dndev-interactive[data-role='menu-item']:focus-visible,.dndev-interactive[data-role='menu-item'][data-highlighted] {
1611
- background-color: var(--accent);
1612
- color: var(--accent-foreground);
1590
+ .dndev-interactive[data-role='menu-item']:focus-visible,.dndev-interactive[data-role='menu-item'][data-highlighted] {
1591
+ background: rgb(from var(--primary) r g b / 0.1);
1592
+ color: var(--primary);
1613
1593
  outline: 2px solid var(--ring);
1614
1594
  outline-offset: 0;
1615
1595
  }
@@ -1635,14 +1615,9 @@ em {
1635
1615
  width: 100%;
1636
1616
  }
1637
1617
 
1638
- .dndev-interactive[data-role='command-item']:hover:not([data-selected='true']) {
1639
- background-color: var(--accent);
1640
- color: var(--accent-foreground);
1641
- }
1642
-
1643
1618
  .dndev-interactive[data-role='command-item'][data-selected='true'] {
1644
- background-color: var(--accent);
1645
- color: var(--accent-foreground);
1619
+ background: rgb(from var(--primary) r g b / 0.1);
1620
+ color: var(--primary);
1646
1621
  }
1647
1622
 
1648
1623
  .dndev-interactive[data-role='command-item'][data-disabled='true'] {
@@ -1651,8 +1626,8 @@ em {
1651
1626
  }
1652
1627
 
1653
1628
  .dndev-interactive[data-role='command-item']:focus-visible {
1654
- outline: 2px solid var(--ring);
1655
- outline-offset: 0;
1629
+ outline: none;
1630
+ box-shadow: var(--shadow-focus), var(--shadow-interactive);
1656
1631
  }
1657
1632
 
1658
1633
  /* Specific containers that need start-align (not general stacks/grids) */
@@ -1747,8 +1722,8 @@ em {
1747
1722
  /* Focus state */
1748
1723
 
1749
1724
  .dndev-control:focus-visible {
1750
- outline: 2px solid var(--ring);
1751
- outline-offset: 2px;
1725
+ outline: none;
1726
+ box-shadow: var(--shadow-focus), var(--shadow-interactive);
1752
1727
  }
1753
1728
 
1754
1729
  /* Disabled state */
@@ -1762,8 +1737,8 @@ em {
1762
1737
 
1763
1738
  .dndev-control[data-state='checked'],.dndev-control[data-state='on'],.dndev-control[data-pressed='true'] {
1764
1739
  background-color: var(--control-border);
1765
- /* --card not --background: inverted text must be opaque (--background can be transparent in some themes) */
1766
- color: var(--card);
1740
+ /* --card-base: root snapshot, not overridden by variant blocks (safe inside any surface) */
1741
+ color: var(--card-base);
1767
1742
  }
1768
1743
 
1769
1744
  /* CONTROL GROUP - Shared pattern for grouped controls (RadioGroup, Checkbox groups) */
@@ -1904,8 +1879,7 @@ em {
1904
1879
  margin-top: var(--gap-sm);
1905
1880
  margin-bottom: var(--gap-sm);
1906
1881
  height: 1px;
1907
- background-color: var(--accent);
1908
- opacity: var(--opacity-strong);
1882
+ background-color: var(--border);
1909
1883
  }
1910
1884
 
1911
1885
  /* Menu shortcut */
@@ -1941,26 +1915,13 @@ em {
1941
1915
  --notification-shadow-base: var(--shadow-xl-rtl);
1942
1916
  }
1943
1917
 
1944
- /* Notification variants - shared by tooltips and toasts */
1918
+ /* Notification variants - only override border + glow, bg/color inherited from base */
1945
1919
 
1946
1920
  .dndev-notification[data-variant='default'] {
1947
- background: color-mix(
1948
- in oklab,
1949
- var(--popover-foreground) 95%,
1950
- transparent
1951
- ) !important;
1952
- color: var(--popover) !important;
1953
1921
  border: var(--border-hairline) solid var(--border);
1954
- /* Uses base shadow from .dndev-notification */
1955
1922
  }
1956
1923
 
1957
1924
  .dndev-notification[data-variant='info'] {
1958
- background: color-mix(
1959
- in oklab,
1960
- var(--popover-foreground) 95%,
1961
- transparent
1962
- ) !important;
1963
- color: var(--popover) !important;
1964
1925
  border: var(--border-width) solid var(--accent);
1965
1926
  box-shadow:
1966
1927
  var(--notification-shadow-base),
@@ -1968,12 +1929,6 @@ em {
1968
1929
  }
1969
1930
 
1970
1931
  .dndev-notification[data-variant='success'] {
1971
- background: color-mix(
1972
- in oklab,
1973
- var(--popover-foreground) 95%,
1974
- transparent
1975
- ) !important;
1976
- color: var(--popover) !important;
1977
1932
  border: var(--border-width) solid var(--success);
1978
1933
  box-shadow:
1979
1934
  var(--notification-shadow-base),
@@ -1981,12 +1936,6 @@ em {
1981
1936
  }
1982
1937
 
1983
1938
  .dndev-notification[data-variant='warning'] {
1984
- background: color-mix(
1985
- in oklab,
1986
- var(--popover-foreground) 95%,
1987
- transparent
1988
- ) !important;
1989
- color: var(--popover) !important;
1990
1939
  border: var(--border-width) solid var(--warning);
1991
1940
  box-shadow:
1992
1941
  var(--notification-shadow-base),
@@ -1994,12 +1943,6 @@ em {
1994
1943
  }
1995
1944
 
1996
1945
  .dndev-notification[data-variant='error'],.dndev-notification[data-variant='destructive'] {
1997
- background: color-mix(
1998
- in oklab,
1999
- var(--popover-foreground) 95%,
2000
- transparent
2001
- ) !important;
2002
- color: var(--popover) !important;
2003
1946
  border: var(--border-width) solid var(--destructive);
2004
1947
  box-shadow:
2005
1948
  var(--notification-shadow-base),
@@ -2007,12 +1950,6 @@ em {
2007
1950
  }
2008
1951
 
2009
1952
  .dndev-notification[data-variant='primary'] {
2010
- background: color-mix(
2011
- in oklab,
2012
- var(--popover-foreground) 95%,
2013
- transparent
2014
- ) !important;
2015
- color: var(--popover) !important;
2016
1953
  border: var(--border-width) solid var(--primary);
2017
1954
  box-shadow:
2018
1955
  var(--notification-shadow-base),
@@ -2020,12 +1957,6 @@ em {
2020
1957
  }
2021
1958
 
2022
1959
  .dndev-notification[data-variant='secondary'] {
2023
- background: color-mix(
2024
- in oklab,
2025
- var(--popover-foreground) 95%,
2026
- transparent
2027
- ) !important;
2028
- color: var(--popover) !important;
2029
1960
  border: var(--border-width) solid var(--secondary);
2030
1961
  box-shadow:
2031
1962
  var(--notification-shadow-base),
@@ -2033,12 +1964,6 @@ em {
2033
1964
  }
2034
1965
 
2035
1966
  .dndev-notification[data-variant='accent'] {
2036
- background: color-mix(
2037
- in oklab,
2038
- var(--popover-foreground) 95%,
2039
- transparent
2040
- ) !important;
2041
- color: var(--popover) !important;
2042
1967
  border: var(--border-width) solid var(--accent);
2043
1968
  box-shadow:
2044
1969
  var(--notification-shadow-base),
@@ -2052,7 +1977,7 @@ em {
2052
1977
  .dndev-overlay {
2053
1978
  position: fixed;
2054
1979
  inset: 0;
2055
- background: rgba(0, 0, 0, 0.4);
1980
+ background: color-mix(in oklab, var(--foreground) 40%, transparent);
2056
1981
  backdrop-filter: blur(8px);
2057
1982
  will-change: opacity;
2058
1983
  z-index: var(--z-overlay);
@@ -2123,7 +2048,7 @@ em {
2123
2048
 
2124
2049
  .dndev-modal-content {
2125
2050
  position: fixed;
2126
- left: 50%;
2051
+ inset-inline-start: 50%;
2127
2052
  top: 50%;
2128
2053
  z-index: calc(var(--z-modal) + 1);
2129
2054
  transform: translate(-50%, -50%);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/components",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Styled UI components for DoNotDev",