@salemcobalt/ui 0.2.0-rc.1 → 0.2.0-rc.2

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/styles.css CHANGED
@@ -1,4 +1,4 @@
1
- /* @salemcobalt/ui 0.2.0-rc.1 — requires @salemcobalt/tokens/css. */
1
+ /* @salemcobalt/ui 0.2.0-rc.2 — requires @salemcobalt/tokens/css. */
2
2
  @layer sc {
3
3
  /* ---- base.css ---- */
4
4
  /* Shared: focus ring, reduced motion. Component files follow. */
@@ -1843,4 +1843,219 @@
1843
1843
  }
1844
1844
  }
1845
1845
 
1846
+ /* ---- table.css ---- */
1847
+ /* ---- Table ----------------------------------------------------------------- */
1848
+ .sc-table-wrap {
1849
+ position: relative;
1850
+ inline-size: 100%;
1851
+ min-inline-size: 0;
1852
+ overflow-x: auto;
1853
+ overscroll-behavior-x: contain;
1854
+ }
1855
+ .sc-table-wrap[data-sticky-header]:not([data-scroll]) {
1856
+ overflow: visible;
1857
+ }
1858
+ .sc-table-wrap[data-scroll] {
1859
+ overflow: auto;
1860
+ }
1861
+ .sc-table {
1862
+ --_py: var(--sc-spacing-xs);
1863
+ --_px: var(--sc-spacing-sm);
1864
+ --_h: var(--sc-size-control-md);
1865
+ inline-size: 100%;
1866
+ border-collapse: separate;
1867
+ border-spacing: 0;
1868
+ font-family: var(--sc-font-family-sans);
1869
+ font-size: var(--sc-font-size-sm);
1870
+ line-height: var(--sc-font-line-height-ui);
1871
+ color: var(--sc-color-text-default);
1872
+ text-align: start;
1873
+ }
1874
+ .sc-table[data-layout='fixed'] {
1875
+ table-layout: fixed;
1876
+ }
1877
+ .sc-table[data-density='compact'],
1878
+ [data-density='compact'] .sc-table:not([data-density='comfortable']) {
1879
+ --_py: var(--sc-spacing-2xs);
1880
+ --_px: var(--sc-spacing-xs);
1881
+ --_h: var(--sc-size-control-sm);
1882
+ }
1883
+ .sc-table__caption {
1884
+ padding-block-end: var(--sc-spacing-xs);
1885
+ color: var(--sc-color-text-muted);
1886
+ font-size: var(--sc-font-size-xs);
1887
+ text-align: start;
1888
+ caption-side: top;
1889
+ }
1890
+ .sc-table__header,
1891
+ .sc-table__cell {
1892
+ box-sizing: border-box;
1893
+ block-size: var(--_h);
1894
+ padding: var(--_py) var(--_px);
1895
+ vertical-align: middle;
1896
+ text-align: start;
1897
+ }
1898
+ .sc-table__header {
1899
+ color: var(--sc-color-text-muted);
1900
+ font-size: var(--sc-font-size-xs);
1901
+ font-weight: var(--sc-font-weight-medium);
1902
+ letter-spacing: var(--sc-font-tracking-wide);
1903
+ text-transform: uppercase;
1904
+ white-space: nowrap;
1905
+ background: var(--sc-color-surface-canvas);
1906
+ border-block-end: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
1907
+ }
1908
+ .sc-table__body .sc-table__header {
1909
+ color: var(--sc-color-text-default);
1910
+ font-size: inherit;
1911
+ font-weight: var(--sc-font-weight-medium);
1912
+ letter-spacing: 0;
1913
+ text-transform: none;
1914
+ background: transparent;
1915
+ border-block-end: 0;
1916
+ }
1917
+ .sc-table-wrap[data-sticky-header] .sc-table__head .sc-table__header {
1918
+ position: sticky;
1919
+ inset-block-start: 0;
1920
+ z-index: var(--sc-z-sticky);
1921
+ }
1922
+ .sc-table[data-divided] .sc-table__body .sc-table__row:not(:last-child) > .sc-table__cell,
1923
+ .sc-table[data-divided] .sc-table__body .sc-table__row:not(:last-child) > .sc-table__header {
1924
+ border-block-end: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
1925
+ }
1926
+ .sc-table__foot .sc-table__cell,
1927
+ .sc-table__foot .sc-table__header {
1928
+ border-block-start: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
1929
+ font-weight: var(--sc-font-weight-medium);
1930
+ }
1931
+ .sc-table__row[data-interactive] {
1932
+ cursor: pointer;
1933
+ }
1934
+ .sc-table__row[data-interactive]:hover > .sc-table__cell,
1935
+ .sc-table__row[data-interactive]:hover > .sc-table__header {
1936
+ background: var(--sc-color-surface-hover);
1937
+ }
1938
+ .sc-table__row[data-selected] > .sc-table__cell,
1939
+ .sc-table__row[data-selected] > .sc-table__header {
1940
+ background: var(--sc-color-accent-subtle);
1941
+ }
1942
+ .sc-table__header[data-align='center'],
1943
+ .sc-table__cell[data-align='center'] {
1944
+ text-align: center;
1945
+ }
1946
+ .sc-table__header[data-align='end'],
1947
+ .sc-table__cell[data-align='end'] {
1948
+ text-align: end;
1949
+ }
1950
+ .sc-table__header[data-numeric],
1951
+ .sc-table__cell[data-numeric] {
1952
+ font-variant-numeric: tabular-nums;
1953
+ }
1954
+ .sc-table__header[data-nowrap],
1955
+ .sc-table__cell[data-nowrap] {
1956
+ white-space: nowrap;
1957
+ }
1958
+ .sc-table__header[data-truncate],
1959
+ .sc-table__cell[data-truncate] {
1960
+ max-inline-size: 0;
1961
+ overflow: hidden;
1962
+ text-overflow: ellipsis;
1963
+ white-space: nowrap;
1964
+ }
1965
+ .sc-table__cell > .sc-badge,
1966
+ .sc-table__cell > .sc-button {
1967
+ vertical-align: middle;
1968
+ }
1969
+
1970
+ /* ---- stat.css ---- */
1971
+ /* ---- Stat ------------------------------------------------------------------ */
1972
+ .sc-stat {
1973
+ --_p: var(--sc-spacing-md);
1974
+ --_value: var(--sc-font-size-2xl);
1975
+ position: relative;
1976
+ display: grid;
1977
+ grid-template-columns: 1fr auto;
1978
+ grid-template-areas:
1979
+ 'label icon'
1980
+ 'value value'
1981
+ 'delta delta'
1982
+ 'hint hint';
1983
+ align-content: start;
1984
+ row-gap: var(--sc-spacing-3xs);
1985
+ box-sizing: border-box;
1986
+ min-inline-size: 0;
1987
+ margin: 0;
1988
+ padding: var(--_p);
1989
+ border-radius: var(--sc-radius-xl);
1990
+ background: var(--sc-color-surface-default);
1991
+ color: var(--sc-color-text-default);
1992
+ border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
1993
+ font-family: var(--sc-font-family-sans);
1994
+ font-size: var(--sc-font-size-sm);
1995
+ line-height: var(--sc-font-line-height-ui);
1996
+ list-style: none;
1997
+ }
1998
+ .sc-stat[data-variant='filled'] {
1999
+ background: var(--sc-color-surface-sunken);
2000
+ border-color: transparent;
2001
+ }
2002
+ .sc-stat[data-variant='plain'] {
2003
+ --_p: 0;
2004
+ background: transparent;
2005
+ border: 0;
2006
+ border-radius: 0;
2007
+ }
2008
+ .sc-stat[data-size='sm'] {
2009
+ --_p: var(--sc-spacing-sm);
2010
+ --_value: var(--sc-font-size-xl);
2011
+ border-radius: var(--sc-radius-lg);
2012
+ }
2013
+ .sc-stat__label {
2014
+ grid-area: label;
2015
+ color: var(--sc-color-text-muted);
2016
+ font-weight: var(--sc-font-weight-medium);
2017
+ }
2018
+ .sc-stat__icon {
2019
+ grid-area: icon;
2020
+ display: inline-flex;
2021
+ color: var(--sc-color-text-subtle);
2022
+ }
2023
+ .sc-stat__icon > svg {
2024
+ inline-size: var(--sc-size-icon-lg);
2025
+ block-size: var(--sc-size-icon-lg);
2026
+ }
2027
+ .sc-stat__value {
2028
+ grid-area: value;
2029
+ font-size: var(--_value);
2030
+ font-weight: var(--sc-font-weight-semibold);
2031
+ line-height: var(--sc-font-line-height-tight);
2032
+ letter-spacing: var(--sc-font-tracking-snug);
2033
+ font-variant-numeric: tabular-nums;
2034
+ overflow-wrap: anywhere;
2035
+ }
2036
+ .sc-stat__delta {
2037
+ grid-area: delta;
2038
+ display: inline-flex;
2039
+ align-items: center;
2040
+ gap: var(--sc-spacing-3xs);
2041
+ color: var(--sc-color-text-muted);
2042
+ font-size: var(--sc-font-size-xs);
2043
+ font-weight: var(--sc-font-weight-medium);
2044
+ font-variant-numeric: tabular-nums;
2045
+ }
2046
+ .sc-stat__delta[data-tone='positive'] {
2047
+ color: var(--sc-color-success-text);
2048
+ }
2049
+ .sc-stat__delta[data-tone='negative'] {
2050
+ color: var(--sc-color-danger-text);
2051
+ }
2052
+ .sc-stat__trend {
2053
+ display: inline-flex;
2054
+ }
2055
+ .sc-stat__hint {
2056
+ grid-area: hint;
2057
+ color: var(--sc-color-text-muted);
2058
+ font-size: var(--sc-font-size-xs);
2059
+ }
2060
+
1846
2061
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salemcobalt/ui",
3
- "version": "0.2.0-rc.1",
4
- "description": "React components for the Salem Cobalt design system: Button, IconButton, Icon set, Badge, Card, Stack, Inline, Kbd, Dialog, Tooltip, Menu, Toolbar, Banner, Spinner, Progress, Tabs, Input, Textarea, Select, Checkbox, Switch, Heading, Text.",
3
+ "version": "0.2.0-rc.2",
4
+ "description": "React components for the Salem Cobalt design system: Button, IconButton, Icon set, Badge, Card, Stack, Inline, Kbd, Dialog, Tooltip, Menu, Toolbar, Banner, Spinner, Progress, Tabs, Input, Textarea, Select, Checkbox, Switch, Heading, Text, Table, Stat.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -33,7 +33,7 @@
33
33
  "peerDependencies": {
34
34
  "react": "^19.0.0",
35
35
  "react-dom": "^19.0.0",
36
- "@salemcobalt/tokens": "^0.2.0-rc.1"
36
+ "@salemcobalt/tokens": "^0.2.0-rc.2"
37
37
  },
38
38
  "dependencies": {
39
39
  "@base-ui/react": "^1.9.0",
@@ -56,7 +56,7 @@
56
56
  "tsup": "^9.0.0",
57
57
  "typescript": "^5.9.3",
58
58
  "vitest": "^5.0.5",
59
- "@salemcobalt/tokens": "^0.2.0-rc.1"
59
+ "@salemcobalt/tokens": "^0.2.0-rc.2"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public"