@still-void/ui 3.2.0 → 3.3.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/style.css CHANGED
@@ -1029,6 +1029,60 @@ body.sv-body {
1029
1029
  line-height: 1.625;
1030
1030
  }
1031
1031
 
1032
+ /* Semantic variants (T1, R5-09) */
1033
+ .sv-alert--info {
1034
+ --sv-alert-color: var(--sv-info-ink);
1035
+
1036
+ border-color: var(--sv-alert-color);
1037
+ }
1038
+ .sv-alert--info > svg {
1039
+ color: var(--sv-alert-color);
1040
+ }
1041
+ .sv-alert--info .sv-alert__title {
1042
+ color: var(--sv-alert-color);
1043
+ }
1044
+
1045
+ .sv-alert--success {
1046
+ --sv-alert-color: var(--sv-success-ink);
1047
+
1048
+ border-color: var(--sv-alert-color);
1049
+ }
1050
+ .sv-alert--success > svg {
1051
+ color: var(--sv-alert-color);
1052
+ }
1053
+ .sv-alert--success .sv-alert__title {
1054
+ color: var(--sv-alert-color);
1055
+ }
1056
+
1057
+ .sv-alert--warning {
1058
+ --sv-alert-color: var(--sv-warning-ink);
1059
+
1060
+ border-color: var(--sv-alert-color);
1061
+ }
1062
+ .sv-alert--warning > svg {
1063
+ color: var(--sv-alert-color);
1064
+ }
1065
+ .sv-alert--warning .sv-alert__title {
1066
+ color: var(--sv-alert-color);
1067
+ }
1068
+
1069
+ .sv-alert--danger {
1070
+ --sv-alert-color: var(--sv-danger-ink);
1071
+
1072
+ border-color: var(--sv-alert-color);
1073
+ }
1074
+ .sv-alert--danger > svg {
1075
+ color: var(--sv-alert-color);
1076
+ }
1077
+ .sv-alert--danger .sv-alert__title {
1078
+ color: var(--sv-alert-color);
1079
+ }
1080
+
1081
+ /* Action slot (T2, R5-10) */
1082
+ .sv-alert__action {
1083
+ margin-top: var(--sv-space-3);
1084
+ }
1085
+
1032
1086
  /* ---------- Badge ---------- */
1033
1087
  /* Default variant uses var(--sv-accent) rather than a fixed hue, so the
1034
1088
  badge follows [data-accent] instead of locking to cyan (One-Accent Rule —
@@ -1585,6 +1639,289 @@ body.sv-body {
1585
1639
  shape-rendering: crispEdges;
1586
1640
  }
1587
1641
 
1642
+ /* ---------- App Sidebar ---------- */
1643
+ /* R5-02, R5-03, R5-04: Sidebar de aplicação responsiva.
1644
+ The wrapper (.sv-app-shell) carries data-state (open/closed), data-collapsible
1645
+ (offcanvas/icon/none), and data-mobile (true/false). The panel (.sv-app-sidebar)
1646
+ is static in-flow above the breakpoint, drawer in portal below. No box-shadow
1647
+ per Flat-By-Default Rule. Focus is outline (AD-005). Fade animation is driven
1648
+ by data-state with var(--sv-duration-fast) and var(--sv-ease-hover).
1649
+
1650
+ .sv-app-shell is the flex container that lays SidebarPanel (the <aside>)
1651
+ and SidebarInset (the <main>) side by side above the breakpoint — both are
1652
+ rendered as direct children of it (SidebarProvider wraps `children` in this
1653
+ one div). Below the breakpoint SidebarPanel renders into a portal instead
1654
+ (it's not a flex child at all in that mode), so the inset alone fills the
1655
+ row — AC R5-04.3 ("full width below the breakpoint") falls out of the flex
1656
+ layout for free, no separate rule needed. */
1657
+ .sv-app-shell {
1658
+ display: flex;
1659
+ align-items: stretch;
1660
+ }
1661
+
1662
+ .sv-app-sidebar {
1663
+ flex-shrink: 0;
1664
+ background: var(--sv-surface);
1665
+ color: var(--sv-text);
1666
+ border-right: 1px solid var(--sv-border);
1667
+ }
1668
+
1669
+ .sv-app-sidebar__drawer {
1670
+ position: fixed;
1671
+ inset: 0;
1672
+ z-index: var(--sv-z-modal);
1673
+ }
1674
+
1675
+ /* Dialog.Content animates via data-state=[open|closed] */
1676
+ .sv-app-sidebar[data-state='open'] {
1677
+ animation: sv-fade-in var(--sv-duration-fast) var(--sv-ease-hover);
1678
+ }
1679
+
1680
+ .sv-app-sidebar[data-state='closed'] {
1681
+ animation: sv-fade-out var(--sv-duration-fast) var(--sv-ease-hover);
1682
+ }
1683
+
1684
+ .sv-app-sidebar__body {
1685
+ display: flex;
1686
+ flex-direction: column;
1687
+ gap: var(--sv-space-6);
1688
+ padding: var(--sv-space-6);
1689
+ max-height: 100vh;
1690
+ overflow-y: auto;
1691
+ }
1692
+
1693
+ .sv-app-sidebar__label {
1694
+ font-family: var(--sv-font-display);
1695
+ font-size: var(--sv-text-lg);
1696
+ font-weight: 600;
1697
+ color: var(--sv-text);
1698
+ }
1699
+
1700
+ .sv-app-sidebar-inset {
1701
+ flex: 1;
1702
+ /* Without this a flex item's default `min-width: auto` lets its content
1703
+ (e.g. a wide table) push it wider than the row, shrinking the sidebar
1704
+ instead of scrolling internally. */
1705
+ min-width: 0;
1706
+ overflow: auto;
1707
+ }
1708
+
1709
+ .sv-app-sidebar-trigger {
1710
+ display: inline-flex;
1711
+ align-items: center;
1712
+ justify-content: center;
1713
+ padding: var(--sv-space-2);
1714
+ border: 1px solid transparent;
1715
+ border-radius: var(--sv-radius-sm);
1716
+ background: none;
1717
+ color: var(--sv-text-2);
1718
+ cursor: pointer;
1719
+ transition: background var(--sv-duration-fast) var(--sv-ease-hover),
1720
+ color var(--sv-duration-fast) var(--sv-ease-hover);
1721
+ }
1722
+
1723
+ .sv-app-sidebar-trigger:hover {
1724
+ background: var(--sv-surface-2);
1725
+ color: var(--sv-text);
1726
+ }
1727
+
1728
+ .sv-app-sidebar-trigger:focus-visible {
1729
+ outline: 2px solid var(--sv-accent-ink);
1730
+ outline-offset: 2px;
1731
+ }
1732
+
1733
+ /* R5-03: collapsible="icon" mode — `open` toggles rail width vs. full width,
1734
+ the same way `offcanvas` toggles visible vs. hidden. Both rules below key
1735
+ off data-state="closed" *together with* data-collapsible="icon" — without
1736
+ that, a collapsed-width rail would also apply while `open` (the expanded,
1737
+ labels-visible state), which is the opposite of what "collapsible" means
1738
+ here. .sv-app-shell carries data-state from SidebarProvider's own `open`. */
1739
+ .sv-app-shell[data-collapsible='icon'][data-state='closed'] .sv-app-sidebar:not(.sv-app-sidebar__drawer) {
1740
+ width: var(--sv-space-14);
1741
+ }
1742
+
1743
+ /* Hide text labels only in the collapsed (closed) state; keep them
1744
+ accessible to screen readers via the sr-only pattern rather than
1745
+ removing them, since the icon alone is not a reliable label. */
1746
+ .sv-app-shell[data-collapsible='icon'][data-state='closed'] .sv-app-sidebar__label {
1747
+ position: absolute;
1748
+ width: 1px;
1749
+ height: 1px;
1750
+ overflow: hidden;
1751
+ clip-path: inset(50%);
1752
+ white-space: nowrap;
1753
+ }
1754
+
1755
+ /* ---------- Toast ---------- */
1756
+ /* Toast viewport container (region role). The Radix primitive renders the
1757
+ list here; our wrapper manages the queue. */
1758
+ .sv-toast__viewport {
1759
+ position: fixed;
1760
+ bottom: var(--sv-space-4);
1761
+ right: var(--sv-space-4);
1762
+ display: flex;
1763
+ flex-direction: column;
1764
+ gap: var(--sv-space-3);
1765
+ pointer-events: none;
1766
+ z-index: var(--sv-z-toast);
1767
+ max-width: calc(100vw - var(--sv-space-8));
1768
+ }
1769
+
1770
+ /* Individual toast item */
1771
+ .sv-toast {
1772
+ display: flex;
1773
+ align-items: flex-start;
1774
+ gap: var(--sv-space-3);
1775
+ padding: var(--sv-space-3) var(--sv-space-4);
1776
+ border: 1px solid var(--sv-border);
1777
+ border-radius: var(--sv-radius-md);
1778
+ background: var(--sv-surface);
1779
+ color: var(--sv-text);
1780
+ pointer-events: auto;
1781
+ animation: sv-toast-enter var(--sv-duration-fast) var(--sv-ease-hover);
1782
+ }
1783
+ .sv-toast[data-state="closed"] {
1784
+ animation: sv-toast-exit var(--sv-duration-fast) var(--sv-ease-hover);
1785
+ }
1786
+
1787
+ @keyframes sv-toast-enter {
1788
+ from {
1789
+ opacity: 0;
1790
+ }
1791
+ to {
1792
+ opacity: 1;
1793
+ }
1794
+ }
1795
+
1796
+ @keyframes sv-toast-exit {
1797
+ from {
1798
+ opacity: 1;
1799
+ }
1800
+ to {
1801
+ opacity: 0;
1802
+ }
1803
+ }
1804
+
1805
+ /* Icon */
1806
+ .sv-toast__icon {
1807
+ flex-shrink: 0;
1808
+ margin-top: 2px;
1809
+ }
1810
+
1811
+ /* Content wrapper */
1812
+ .sv-toast__content {
1813
+ flex: 1;
1814
+ min-width: 0;
1815
+ }
1816
+
1817
+ /* Title */
1818
+ .sv-toast__title {
1819
+ margin: 0 0 var(--sv-space-1);
1820
+ font-weight: 500;
1821
+ line-height: 1.25;
1822
+ letter-spacing: -0.025em;
1823
+ color: var(--sv-text);
1824
+ }
1825
+
1826
+ /* Description */
1827
+ .sv-toast__description {
1828
+ font-size: var(--sv-text-sm);
1829
+ color: var(--sv-text-2);
1830
+ line-height: 1.5;
1831
+ }
1832
+
1833
+ /* Variant colors (info, success, warning, danger) */
1834
+ .sv-toast--info .sv-toast__icon {
1835
+ color: var(--sv-info-ink);
1836
+ }
1837
+ .sv-toast--info .sv-toast__title {
1838
+ color: var(--sv-info-ink);
1839
+ }
1840
+ .sv-toast--info {
1841
+ border-color: var(--sv-info-ink);
1842
+ }
1843
+
1844
+ .sv-toast--success .sv-toast__icon {
1845
+ color: var(--sv-success-ink);
1846
+ }
1847
+ .sv-toast--success .sv-toast__title {
1848
+ color: var(--sv-success-ink);
1849
+ }
1850
+ .sv-toast--success {
1851
+ border-color: var(--sv-success-ink);
1852
+ }
1853
+
1854
+ .sv-toast--warning .sv-toast__icon {
1855
+ color: var(--sv-warning-ink);
1856
+ }
1857
+ .sv-toast--warning .sv-toast__title {
1858
+ color: var(--sv-warning-ink);
1859
+ }
1860
+ .sv-toast--warning {
1861
+ border-color: var(--sv-warning-ink);
1862
+ }
1863
+
1864
+ .sv-toast--danger .sv-toast__icon {
1865
+ color: var(--sv-danger-ink);
1866
+ }
1867
+ .sv-toast--danger .sv-toast__title {
1868
+ color: var(--sv-danger-ink);
1869
+ }
1870
+ .sv-toast--danger {
1871
+ border-color: var(--sv-danger-ink);
1872
+ }
1873
+
1874
+ /* Actions container */
1875
+ .sv-toast__actions {
1876
+ display: flex;
1877
+ gap: var(--sv-space-2);
1878
+ flex-shrink: 0;
1879
+ align-items: center;
1880
+ }
1881
+
1882
+ /* Action button */
1883
+ .sv-toast__action {
1884
+ padding: var(--sv-space-2) var(--sv-space-3);
1885
+ border: 1px solid var(--sv-border);
1886
+ border-radius: var(--sv-radius-md);
1887
+ background: var(--sv-surface-2);
1888
+ color: var(--sv-text);
1889
+ font-size: var(--sv-text-sm);
1890
+ font-weight: 500;
1891
+ cursor: pointer;
1892
+ transition: background var(--sv-duration-fast) var(--sv-ease-hover);
1893
+ }
1894
+ .sv-toast__action:hover {
1895
+ /* --sv-surface-3 does not exist (2-tier system only). Same base/hover
1896
+ pair as .sv-btn--secondary, which shares this button's surface-2 base. */
1897
+ background: var(--sv-surface);
1898
+ }
1899
+ .sv-toast__action:focus-visible {
1900
+ outline: 2px solid var(--sv-accent-ink);
1901
+ outline-offset: 2px;
1902
+ }
1903
+
1904
+ /* Close button */
1905
+ .sv-toast__close {
1906
+ padding: 0;
1907
+ border: none;
1908
+ background: transparent;
1909
+ color: var(--sv-text-2);
1910
+ cursor: pointer;
1911
+ display: flex;
1912
+ align-items: center;
1913
+ justify-content: center;
1914
+ flex-shrink: 0;
1915
+ transition: color var(--sv-duration-fast) var(--sv-ease-hover);
1916
+ }
1917
+ .sv-toast__close:hover {
1918
+ color: var(--sv-text);
1919
+ }
1920
+ .sv-toast__close:focus-visible {
1921
+ outline: 2px solid var(--sv-accent-ink);
1922
+ outline-offset: 2px;
1923
+ }
1924
+
1588
1925
  /* ---------- Reduced motion ---------- */
1589
1926
  /* This block lives here, at the end of style.css, and not in theme.css, for a
1590
1927
  cascade reason: `@media` adds no specificity, and README documents the
@@ -1624,7 +1961,12 @@ body.sv-body {
1624
1961
  all — the closed panel never has a chance to snap into view. */
1625
1962
  .sv-overlay,
1626
1963
  .sv-dialog,
1627
- .sv-pop {
1964
+ .sv-pop,
1965
+ .sv-app-sidebar,
1966
+ .sv-toast {
1628
1967
  animation: none;
1629
1968
  }
1969
+ .sv-app-sidebar-trigger {
1970
+ transition: none;
1971
+ }
1630
1972
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@still-void/ui",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Still Void design system — React/Next.js design system with a server-safe entry and a client-only entry, built on shadcn/ui.",
5
5
  "license": "MIT",
6
6
  "author": "Kalleo Pinheiro",
@@ -133,6 +133,7 @@
133
133
  "@radix-ui/react-primitive": "^2.1.10",
134
134
  "@radix-ui/react-select": "^2.3.7",
135
135
  "@radix-ui/react-tabs": "^1.1.21",
136
+ "@radix-ui/react-toast": "^1.2.23",
136
137
  "@radix-ui/react-tooltip": "^1.2.16",
137
138
  "clsx": "^2.1.1",
138
139
  "tailwind-merge": "^3.6.0"