@salemcobalt/ui 0.2.0-rc.21 → 0.2.0-rc.23
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 +38 -37
- package/dist/index.d.ts +39 -2
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +120 -16
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/* @salemcobalt/ui 0.2.0-rc.
|
|
1
|
+
/* @salemcobalt/ui 0.2.0-rc.23 — requires @salemcobalt/tokens/css. */
|
|
2
2
|
@layer sc {
|
|
3
3
|
/* ---- base.css ---- */
|
|
4
4
|
/* Shared: focus ring, reduced motion. Component files follow. */
|
|
5
5
|
.sc-focus-ring:focus-visible,
|
|
6
6
|
.sc-button:focus-visible,
|
|
7
|
+
.sc-avatar-button:focus-visible,
|
|
7
8
|
.sc-card[data-interactive]:focus-visible,
|
|
8
9
|
.sc-dialog__close:focus-visible,
|
|
9
10
|
.sc-menu__item:focus-visible,
|
|
@@ -266,10 +267,10 @@
|
|
|
266
267
|
background: var(--sc-color-accent-default);
|
|
267
268
|
color: var(--sc-color-text-on-accent);
|
|
268
269
|
}
|
|
269
|
-
.sc-button[data-variant='primary']:hover {
|
|
270
|
+
.sc-button[data-variant='primary']:hover:where(:not(:disabled)) {
|
|
270
271
|
background: var(--sc-color-accent-hover);
|
|
271
272
|
}
|
|
272
|
-
.sc-button[data-variant='primary']:active {
|
|
273
|
+
.sc-button[data-variant='primary']:active:where(:not(:disabled)) {
|
|
273
274
|
background: var(--sc-color-accent-active);
|
|
274
275
|
}
|
|
275
276
|
.sc-button[data-variant='secondary'] {
|
|
@@ -277,30 +278,30 @@
|
|
|
277
278
|
color: var(--sc-color-text-default);
|
|
278
279
|
border-color: var(--sc-color-border-strong);
|
|
279
280
|
}
|
|
280
|
-
.sc-button[data-variant='secondary']:hover {
|
|
281
|
+
.sc-button[data-variant='secondary']:hover:where(:not(:disabled)) {
|
|
281
282
|
background: var(--sc-color-surface-hover);
|
|
282
283
|
}
|
|
283
|
-
.sc-button[data-variant='secondary']:active {
|
|
284
|
+
.sc-button[data-variant='secondary']:active:where(:not(:disabled)) {
|
|
284
285
|
background: var(--sc-color-surface-active);
|
|
285
286
|
}
|
|
286
287
|
.sc-button[data-variant='ghost'] {
|
|
287
288
|
background: transparent;
|
|
288
289
|
color: var(--sc-color-text-default);
|
|
289
290
|
}
|
|
290
|
-
.sc-button[data-variant='ghost']:hover {
|
|
291
|
+
.sc-button[data-variant='ghost']:hover:where(:not(:disabled)) {
|
|
291
292
|
background: var(--sc-color-surface-hover);
|
|
292
293
|
}
|
|
293
|
-
.sc-button[data-variant='ghost']:active {
|
|
294
|
+
.sc-button[data-variant='ghost']:active:where(:not(:disabled)) {
|
|
294
295
|
background: var(--sc-color-surface-active);
|
|
295
296
|
}
|
|
296
297
|
.sc-button[data-variant='danger'] {
|
|
297
298
|
background: var(--sc-color-danger-solid);
|
|
298
299
|
color: var(--sc-color-text-on-status);
|
|
299
300
|
}
|
|
300
|
-
.sc-button[data-variant='danger']:hover {
|
|
301
|
+
.sc-button[data-variant='danger']:hover:where(:not(:disabled)) {
|
|
301
302
|
background: var(--sc-color-danger-hover);
|
|
302
303
|
}
|
|
303
|
-
.sc-button[data-variant='danger']:active {
|
|
304
|
+
.sc-button[data-variant='danger']:active:where(:not(:disabled)) {
|
|
304
305
|
background: var(--sc-color-danger-hover);
|
|
305
306
|
filter: brightness(0.95);
|
|
306
307
|
}
|
|
@@ -308,11 +309,6 @@
|
|
|
308
309
|
opacity: 0.5;
|
|
309
310
|
cursor: not-allowed;
|
|
310
311
|
}
|
|
311
|
-
.sc-button:disabled:hover,
|
|
312
|
-
.sc-button:disabled:active {
|
|
313
|
-
background: revert-layer;
|
|
314
|
-
filter: none;
|
|
315
|
-
}
|
|
316
312
|
.sc-button[data-loading] {
|
|
317
313
|
cursor: progress;
|
|
318
314
|
}
|
|
@@ -2581,8 +2577,8 @@
|
|
|
2581
2577
|
.sc-banner > .sc-button[data-variant='ghost'] {
|
|
2582
2578
|
color: inherit;
|
|
2583
2579
|
}
|
|
2584
|
-
.sc-banner > .sc-button[data-variant='ghost']:hover,
|
|
2585
|
-
.sc-banner > .sc-button[data-variant='ghost']:active {
|
|
2580
|
+
.sc-banner > .sc-button[data-variant='ghost']:hover:where(:not(:disabled)),
|
|
2581
|
+
.sc-banner > .sc-button[data-variant='ghost']:active:where(:not(:disabled)) {
|
|
2586
2582
|
background: rgb(from var(--_fg) r g b / 0.1);
|
|
2587
2583
|
}
|
|
2588
2584
|
|
|
@@ -5689,4 +5685,112 @@
|
|
|
5689
5685
|
margin: 0;
|
|
5690
5686
|
}
|
|
5691
5687
|
|
|
5688
|
+
/* ---- avatar.css ---- */
|
|
5689
|
+
/* ---- Avatar ---------------------------------------------------------------- */
|
|
5690
|
+
/* Sizes follow the control heights (so compact density shrinks them too), xs the 24px icon. The tint alone is about
|
|
5691
|
+
1.0-1.4:1 on the surfaces, so the 1px ring (avatar.ring, 3:1 on the fill and every surface) draws the circle. It is
|
|
5692
|
+
an overlay, so it also edges a picture. */
|
|
5693
|
+
.sc-avatar {
|
|
5694
|
+
--_size: var(--sc-size-control-md);
|
|
5695
|
+
--_fs: var(--sc-font-size-sm);
|
|
5696
|
+
--_ring: var(--sc-border-width-hairline);
|
|
5697
|
+
position: relative;
|
|
5698
|
+
display: inline-grid;
|
|
5699
|
+
place-items: center;
|
|
5700
|
+
flex: none;
|
|
5701
|
+
box-sizing: border-box;
|
|
5702
|
+
inline-size: var(--_size);
|
|
5703
|
+
block-size: var(--_size);
|
|
5704
|
+
overflow: hidden;
|
|
5705
|
+
border-radius: var(--sc-radius-full);
|
|
5706
|
+
background: var(--sc-color-avatar-fill);
|
|
5707
|
+
color: var(--sc-color-avatar-text);
|
|
5708
|
+
font-family: var(--sc-font-family-sans);
|
|
5709
|
+
font-size: var(--_fs);
|
|
5710
|
+
font-weight: var(--sc-font-weight-semibold);
|
|
5711
|
+
line-height: 1;
|
|
5712
|
+
letter-spacing: 0;
|
|
5713
|
+
white-space: nowrap;
|
|
5714
|
+
user-select: none;
|
|
5715
|
+
vertical-align: middle;
|
|
5716
|
+
}
|
|
5717
|
+
.sc-avatar::after {
|
|
5718
|
+
content: '';
|
|
5719
|
+
position: absolute;
|
|
5720
|
+
inset: 0;
|
|
5721
|
+
border-radius: inherit;
|
|
5722
|
+
box-shadow: inset 0 0 0 var(--_ring) var(--sc-color-avatar-ring);
|
|
5723
|
+
pointer-events: none;
|
|
5724
|
+
transition: box-shadow var(--sc-duration-fast) var(--sc-ease-standard);
|
|
5725
|
+
}
|
|
5726
|
+
.sc-avatar[data-size='xs'] {
|
|
5727
|
+
--_size: var(--sc-size-icon-xl);
|
|
5728
|
+
--_fs: var(--sc-font-size-xs);
|
|
5729
|
+
}
|
|
5730
|
+
.sc-avatar[data-size='sm'] {
|
|
5731
|
+
--_size: var(--sc-size-control-sm);
|
|
5732
|
+
--_fs: var(--sc-font-size-xs);
|
|
5733
|
+
}
|
|
5734
|
+
.sc-avatar[data-size='lg'] {
|
|
5735
|
+
--_size: var(--sc-size-control-lg);
|
|
5736
|
+
--_fs: var(--sc-font-size-md);
|
|
5737
|
+
}
|
|
5738
|
+
.sc-avatar__image {
|
|
5739
|
+
position: absolute;
|
|
5740
|
+
inset: 0;
|
|
5741
|
+
inline-size: 100%;
|
|
5742
|
+
block-size: 100%;
|
|
5743
|
+
object-fit: cover;
|
|
5744
|
+
}
|
|
5745
|
+
.sc-avatar__fallback {
|
|
5746
|
+
display: contents;
|
|
5747
|
+
}
|
|
5748
|
+
/* No name and no initials: a person glyph at 60% of the circle. */
|
|
5749
|
+
.sc-avatar__icon {
|
|
5750
|
+
font-size: calc(var(--_size) * 0.6);
|
|
5751
|
+
}
|
|
5752
|
+
|
|
5753
|
+
/* ---- AvatarButton ---------------------------------------------------------- */
|
|
5754
|
+
.sc-avatar-button {
|
|
5755
|
+
position: relative;
|
|
5756
|
+
display: inline-grid;
|
|
5757
|
+
flex: none;
|
|
5758
|
+
padding: 0;
|
|
5759
|
+
border: 0;
|
|
5760
|
+
border-radius: var(--sc-radius-full);
|
|
5761
|
+
background: none;
|
|
5762
|
+
color: inherit;
|
|
5763
|
+
font: inherit;
|
|
5764
|
+
text-decoration: none;
|
|
5765
|
+
cursor: pointer;
|
|
5766
|
+
}
|
|
5767
|
+
.sc-avatar-button:hover > .sc-avatar,
|
|
5768
|
+
.sc-avatar-button[data-popup-open] > .sc-avatar,
|
|
5769
|
+
.sc-avatar-button[aria-expanded='true'] > .sc-avatar {
|
|
5770
|
+
--_ring: var(--sc-border-width-focus);
|
|
5771
|
+
}
|
|
5772
|
+
.sc-avatar-button:disabled {
|
|
5773
|
+
opacity: 0.5;
|
|
5774
|
+
cursor: not-allowed;
|
|
5775
|
+
}
|
|
5776
|
+
.sc-avatar-button:disabled:hover > .sc-avatar {
|
|
5777
|
+
--_ring: var(--sc-border-width-hairline);
|
|
5778
|
+
}
|
|
5779
|
+
/* 44px hit area on touch without changing layout, as on Button. */
|
|
5780
|
+
@media (pointer: coarse) {
|
|
5781
|
+
.sc-avatar-button::after {
|
|
5782
|
+
content: '';
|
|
5783
|
+
position: absolute;
|
|
5784
|
+
inset: 50% auto auto 50%;
|
|
5785
|
+
translate: -50% -50%;
|
|
5786
|
+
inline-size: max(100%, var(--sc-size-touch-target));
|
|
5787
|
+
block-size: max(100%, var(--sc-size-touch-target));
|
|
5788
|
+
}
|
|
5789
|
+
}
|
|
5790
|
+
@media (prefers-reduced-motion: reduce) {
|
|
5791
|
+
.sc-avatar::after {
|
|
5792
|
+
transition: none;
|
|
5793
|
+
}
|
|
5794
|
+
}
|
|
5795
|
+
|
|
5692
5796
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salemcobalt/ui",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.23",
|
|
4
4
|
"description": "React components for the Salem Cobalt design system: Button, IconButton, Icon set, BroomIcon, Badge, Card, Stack, Inline, Kbd, Dialog, FullScreenFlow, Tooltip, Menu, Popover, PriorityNav, Toolbar, Banner, Spinner, Progress, Tabs, Input, Textarea, Select, FileInput, Checkbox, Switch, Heading, Text, Table, Stat, Chip, Disclosure, EmptyState, Skeleton, Score, ReasonList, WordDiff, Quote; TextEditor (CodeMirror 6, inline word diffs) at @salemcobalt/ui/editor.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"diff": "^8.0.4",
|
|
47
47
|
"react": "^19.0.0",
|
|
48
48
|
"react-dom": "^19.0.0",
|
|
49
|
-
"@salemcobalt/tokens": "^0.2.0-rc.
|
|
49
|
+
"@salemcobalt/tokens": "^0.2.0-rc.23"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@codemirror/commands": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"tsup": "^9.0.0",
|
|
110
110
|
"typescript": "^5.9.3",
|
|
111
111
|
"vitest": "^5.0.5",
|
|
112
|
-
"@salemcobalt/tokens": "^0.2.0-rc.
|
|
112
|
+
"@salemcobalt/tokens": "^0.2.0-rc.23"
|
|
113
113
|
},
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|