@salemcobalt/ui 0.2.0-rc.10 → 0.2.0-rc.12
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 +3 -2
- package/dist/index.d.ts +27 -3
- package/dist/index.js +313 -86
- package/dist/index.js.map +1 -1
- package/dist/styles.css +116 -1
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @salemcobalt/ui 0.2.0-rc.
|
|
1
|
+
/* @salemcobalt/ui 0.2.0-rc.12 — requires @salemcobalt/tokens/css. */
|
|
2
2
|
@layer sc {
|
|
3
3
|
/* ---- base.css ---- */
|
|
4
4
|
/* Shared: focus ring, reduced motion. Component files follow. */
|
|
@@ -1376,6 +1376,15 @@
|
|
|
1376
1376
|
overflow-x: auto;
|
|
1377
1377
|
}
|
|
1378
1378
|
/* Select */
|
|
1379
|
+
/* iOS Safari zooms the page when a focused text field's font is under 16px, and stays zoomed. On touch screens,
|
|
1380
|
+
text fields render at 16px or more; mouse-and-keyboard density is unchanged. 16px is Safari's threshold, not a
|
|
1381
|
+
design value, so it is a literal. Disabling zoom in the viewport meta instead would also block pinch-zoom. */
|
|
1382
|
+
@media (pointer: coarse) {
|
|
1383
|
+
.sc-input,
|
|
1384
|
+
.sc-textarea[data-variant='code'] {
|
|
1385
|
+
font-size: max(16px, var(--_fs));
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1379
1388
|
.sc-select__wrap {
|
|
1380
1389
|
position: relative;
|
|
1381
1390
|
display: inline-flex;
|
|
@@ -1459,9 +1468,12 @@
|
|
|
1459
1468
|
color: var(--sc-color-text-subtle);
|
|
1460
1469
|
cursor: not-allowed;
|
|
1461
1470
|
}
|
|
1471
|
+
/* The value clips for the ellipsis, so it needs a real line box: the trigger's line-height of 1 cut off descenders
|
|
1472
|
+
("Any age"). Same fix as .sc-chip__label. */
|
|
1462
1473
|
.sc-select__value {
|
|
1463
1474
|
overflow: hidden;
|
|
1464
1475
|
text-overflow: ellipsis;
|
|
1476
|
+
line-height: var(--sc-font-line-height-ui);
|
|
1465
1477
|
}
|
|
1466
1478
|
.sc-select__value[data-placeholder] {
|
|
1467
1479
|
color: var(--sc-color-text-subtle);
|
|
@@ -4654,6 +4666,47 @@
|
|
|
4654
4666
|
cursor: not-allowed;
|
|
4655
4667
|
}
|
|
4656
4668
|
|
|
4669
|
+
/* The file's name as a preview button (FileInput `preview`): a foreign node placed before FilePond's info,
|
|
4670
|
+
which keeps its size line; FilePond's own name span hides while the button is there. FilePond turns
|
|
4671
|
+
pointer events off inside rows, so the button turns them back on. */
|
|
4672
|
+
.sc-file-input .filepond--file:has(> .sc-file-input__preview) .filepond--file-info-main {
|
|
4673
|
+
display: none;
|
|
4674
|
+
}
|
|
4675
|
+
/* With the name in the button, the info holds only the size: it keeps its width (and its margin clear of
|
|
4676
|
+
the ×) and the button's name truncates instead. */
|
|
4677
|
+
.sc-file-input .filepond--file:has(> .sc-file-input__preview) .filepond--file-info {
|
|
4678
|
+
flex: none;
|
|
4679
|
+
}
|
|
4680
|
+
.sc-file-input .sc-file-input__preview {
|
|
4681
|
+
flex: 0 1 auto;
|
|
4682
|
+
min-inline-size: 0;
|
|
4683
|
+
margin: 0 var(--sc-spacing-xs) 0 calc(-1 * var(--sc-spacing-3xs));
|
|
4684
|
+
padding: 0 var(--sc-spacing-3xs);
|
|
4685
|
+
overflow: hidden;
|
|
4686
|
+
border: 0;
|
|
4687
|
+
border-radius: var(--sc-radius-sm);
|
|
4688
|
+
background: transparent;
|
|
4689
|
+
color: var(--sc-color-text-link);
|
|
4690
|
+
font: inherit;
|
|
4691
|
+
font-weight: var(--sc-font-weight-medium);
|
|
4692
|
+
line-height: var(--sc-font-line-height-ui);
|
|
4693
|
+
text-align: start;
|
|
4694
|
+
text-decoration: underline;
|
|
4695
|
+
text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
|
|
4696
|
+
text-underline-offset: 0.2em;
|
|
4697
|
+
text-overflow: ellipsis;
|
|
4698
|
+
white-space: nowrap;
|
|
4699
|
+
pointer-events: auto;
|
|
4700
|
+
cursor: pointer;
|
|
4701
|
+
}
|
|
4702
|
+
.sc-file-input .sc-file-input__preview:hover {
|
|
4703
|
+
text-decoration-color: currentColor;
|
|
4704
|
+
}
|
|
4705
|
+
.sc-file-input .sc-file-input__preview:focus-visible {
|
|
4706
|
+
outline: var(--sc-border-width-focus) solid var(--sc-color-border-focus);
|
|
4707
|
+
outline-offset: 0;
|
|
4708
|
+
}
|
|
4709
|
+
|
|
4657
4710
|
/* The message slot stays in the tree (it is the live region); out of the flow while empty. */
|
|
4658
4711
|
.sc-file-input__messages {
|
|
4659
4712
|
display: flex;
|
|
@@ -4671,4 +4724,66 @@
|
|
|
4671
4724
|
}
|
|
4672
4725
|
}
|
|
4673
4726
|
|
|
4727
|
+
/* ---- file-preview-dialog.css ---- */
|
|
4728
|
+
/* ---- FilePreviewDialog -------------------------------------------------------
|
|
4729
|
+
A `lg` Dialog whose body holds the file: a PDF frame, a text block or an image, each held inside the
|
|
4730
|
+
viewport so the popup itself rarely scrolls. */
|
|
4731
|
+
.sc-file-preview__frame,
|
|
4732
|
+
.sc-file-preview__text,
|
|
4733
|
+
.sc-file-preview__image {
|
|
4734
|
+
display: block;
|
|
4735
|
+
box-sizing: border-box;
|
|
4736
|
+
inline-size: 100%;
|
|
4737
|
+
border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
|
|
4738
|
+
border-radius: var(--sc-radius-md);
|
|
4739
|
+
}
|
|
4740
|
+
.sc-file-preview__frame {
|
|
4741
|
+
/* The popup's 85dvh cap, less its title, description, padding and the action row, so it never scrolls. */
|
|
4742
|
+
block-size: clamp(16rem, 85dvh - 11rem, 60rem);
|
|
4743
|
+
background: var(--sc-color-surface-sunken);
|
|
4744
|
+
}
|
|
4745
|
+
.sc-file-preview__text {
|
|
4746
|
+
max-block-size: 60dvh;
|
|
4747
|
+
margin: 0;
|
|
4748
|
+
padding: var(--sc-spacing-sm) var(--sc-spacing-md);
|
|
4749
|
+
overflow: auto;
|
|
4750
|
+
background: var(--sc-color-surface-sunken);
|
|
4751
|
+
color: var(--sc-color-text-default);
|
|
4752
|
+
font-family: var(--sc-font-family-mono);
|
|
4753
|
+
font-size: var(--sc-font-size-xs);
|
|
4754
|
+
line-height: var(--sc-font-line-height-normal);
|
|
4755
|
+
white-space: pre-wrap;
|
|
4756
|
+
overflow-wrap: anywhere;
|
|
4757
|
+
}
|
|
4758
|
+
.sc-file-preview__text:focus-visible {
|
|
4759
|
+
outline: var(--sc-border-width-focus) solid var(--sc-color-border-focus);
|
|
4760
|
+
outline-offset: var(--sc-border-width-focus);
|
|
4761
|
+
}
|
|
4762
|
+
.sc-file-preview__image {
|
|
4763
|
+
inline-size: auto;
|
|
4764
|
+
max-inline-size: 100%;
|
|
4765
|
+
max-block-size: 65dvh;
|
|
4766
|
+
margin-inline: auto;
|
|
4767
|
+
object-fit: contain;
|
|
4768
|
+
background: var(--sc-color-surface-sunken);
|
|
4769
|
+
}
|
|
4770
|
+
.sc-file-preview__actions {
|
|
4771
|
+
display: flex;
|
|
4772
|
+
justify-content: flex-end;
|
|
4773
|
+
margin-block-start: var(--sc-spacing-md);
|
|
4774
|
+
}
|
|
4775
|
+
.sc-file-preview__tab {
|
|
4776
|
+
display: flex;
|
|
4777
|
+
flex-direction: column;
|
|
4778
|
+
align-items: flex-start;
|
|
4779
|
+
gap: var(--sc-spacing-sm);
|
|
4780
|
+
}
|
|
4781
|
+
.sc-file-preview__note {
|
|
4782
|
+
margin: var(--sc-spacing-xs) 0 0;
|
|
4783
|
+
color: var(--sc-color-text-muted);
|
|
4784
|
+
}
|
|
4785
|
+
.sc-file-preview__tab > .sc-file-preview__note {
|
|
4786
|
+
margin: 0;
|
|
4787
|
+
}
|
|
4788
|
+
|
|
4674
4789
|
}
|
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.12",
|
|
4
4
|
"description": "React components for the Salem Cobalt design system: Button, IconButton, Icon set, BroomIcon, Badge, Card, Stack, Inline, Kbd, Dialog, Tooltip, Menu, Popover, PriorityNav, Toolbar, Banner, Spinner, Progress, Tabs, Input, Textarea, Select, FileInput, Checkbox, Switch, Heading, Text, Table, Stat, Chip, Disclosure, EmptyState, Skeleton.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -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.
|
|
36
|
+
"@salemcobalt/tokens": "^0.2.0-rc.12"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@base-ui/react": "^1.9.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"tsup": "^9.0.0",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
59
|
"vitest": "^5.0.5",
|
|
60
|
-
"@salemcobalt/tokens": "^0.2.0-rc.
|
|
60
|
+
"@salemcobalt/tokens": "^0.2.0-rc.12"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|