@salemcobalt/ui 0.2.0-rc.10 → 0.2.0-rc.11
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 +104 -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.11 — requires @salemcobalt/tokens/css. */
|
|
2
2
|
@layer sc {
|
|
3
3
|
/* ---- base.css ---- */
|
|
4
4
|
/* Shared: focus ring, reduced motion. Component files follow. */
|
|
@@ -4654,6 +4654,47 @@
|
|
|
4654
4654
|
cursor: not-allowed;
|
|
4655
4655
|
}
|
|
4656
4656
|
|
|
4657
|
+
/* The file's name as a preview button (FileInput `preview`): a foreign node placed before FilePond's info,
|
|
4658
|
+
which keeps its size line; FilePond's own name span hides while the button is there. FilePond turns
|
|
4659
|
+
pointer events off inside rows, so the button turns them back on. */
|
|
4660
|
+
.sc-file-input .filepond--file:has(> .sc-file-input__preview) .filepond--file-info-main {
|
|
4661
|
+
display: none;
|
|
4662
|
+
}
|
|
4663
|
+
/* With the name in the button, the info holds only the size: it keeps its width (and its margin clear of
|
|
4664
|
+
the ×) and the button's name truncates instead. */
|
|
4665
|
+
.sc-file-input .filepond--file:has(> .sc-file-input__preview) .filepond--file-info {
|
|
4666
|
+
flex: none;
|
|
4667
|
+
}
|
|
4668
|
+
.sc-file-input .sc-file-input__preview {
|
|
4669
|
+
flex: 0 1 auto;
|
|
4670
|
+
min-inline-size: 0;
|
|
4671
|
+
margin: 0 var(--sc-spacing-xs) 0 calc(-1 * var(--sc-spacing-3xs));
|
|
4672
|
+
padding: 0 var(--sc-spacing-3xs);
|
|
4673
|
+
overflow: hidden;
|
|
4674
|
+
border: 0;
|
|
4675
|
+
border-radius: var(--sc-radius-sm);
|
|
4676
|
+
background: transparent;
|
|
4677
|
+
color: var(--sc-color-text-link);
|
|
4678
|
+
font: inherit;
|
|
4679
|
+
font-weight: var(--sc-font-weight-medium);
|
|
4680
|
+
line-height: var(--sc-font-line-height-ui);
|
|
4681
|
+
text-align: start;
|
|
4682
|
+
text-decoration: underline;
|
|
4683
|
+
text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
|
|
4684
|
+
text-underline-offset: 0.2em;
|
|
4685
|
+
text-overflow: ellipsis;
|
|
4686
|
+
white-space: nowrap;
|
|
4687
|
+
pointer-events: auto;
|
|
4688
|
+
cursor: pointer;
|
|
4689
|
+
}
|
|
4690
|
+
.sc-file-input .sc-file-input__preview:hover {
|
|
4691
|
+
text-decoration-color: currentColor;
|
|
4692
|
+
}
|
|
4693
|
+
.sc-file-input .sc-file-input__preview:focus-visible {
|
|
4694
|
+
outline: var(--sc-border-width-focus) solid var(--sc-color-border-focus);
|
|
4695
|
+
outline-offset: 0;
|
|
4696
|
+
}
|
|
4697
|
+
|
|
4657
4698
|
/* The message slot stays in the tree (it is the live region); out of the flow while empty. */
|
|
4658
4699
|
.sc-file-input__messages {
|
|
4659
4700
|
display: flex;
|
|
@@ -4671,4 +4712,66 @@
|
|
|
4671
4712
|
}
|
|
4672
4713
|
}
|
|
4673
4714
|
|
|
4715
|
+
/* ---- file-preview-dialog.css ---- */
|
|
4716
|
+
/* ---- FilePreviewDialog -------------------------------------------------------
|
|
4717
|
+
A `lg` Dialog whose body holds the file: a PDF frame, a text block or an image, each held inside the
|
|
4718
|
+
viewport so the popup itself rarely scrolls. */
|
|
4719
|
+
.sc-file-preview__frame,
|
|
4720
|
+
.sc-file-preview__text,
|
|
4721
|
+
.sc-file-preview__image {
|
|
4722
|
+
display: block;
|
|
4723
|
+
box-sizing: border-box;
|
|
4724
|
+
inline-size: 100%;
|
|
4725
|
+
border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
|
|
4726
|
+
border-radius: var(--sc-radius-md);
|
|
4727
|
+
}
|
|
4728
|
+
.sc-file-preview__frame {
|
|
4729
|
+
/* The popup's 85dvh cap, less its title, description, padding and the action row, so it never scrolls. */
|
|
4730
|
+
block-size: clamp(16rem, 85dvh - 11rem, 60rem);
|
|
4731
|
+
background: var(--sc-color-surface-sunken);
|
|
4732
|
+
}
|
|
4733
|
+
.sc-file-preview__text {
|
|
4734
|
+
max-block-size: 60dvh;
|
|
4735
|
+
margin: 0;
|
|
4736
|
+
padding: var(--sc-spacing-sm) var(--sc-spacing-md);
|
|
4737
|
+
overflow: auto;
|
|
4738
|
+
background: var(--sc-color-surface-sunken);
|
|
4739
|
+
color: var(--sc-color-text-default);
|
|
4740
|
+
font-family: var(--sc-font-family-mono);
|
|
4741
|
+
font-size: var(--sc-font-size-xs);
|
|
4742
|
+
line-height: var(--sc-font-line-height-normal);
|
|
4743
|
+
white-space: pre-wrap;
|
|
4744
|
+
overflow-wrap: anywhere;
|
|
4745
|
+
}
|
|
4746
|
+
.sc-file-preview__text:focus-visible {
|
|
4747
|
+
outline: var(--sc-border-width-focus) solid var(--sc-color-border-focus);
|
|
4748
|
+
outline-offset: var(--sc-border-width-focus);
|
|
4749
|
+
}
|
|
4750
|
+
.sc-file-preview__image {
|
|
4751
|
+
inline-size: auto;
|
|
4752
|
+
max-inline-size: 100%;
|
|
4753
|
+
max-block-size: 65dvh;
|
|
4754
|
+
margin-inline: auto;
|
|
4755
|
+
object-fit: contain;
|
|
4756
|
+
background: var(--sc-color-surface-sunken);
|
|
4757
|
+
}
|
|
4758
|
+
.sc-file-preview__actions {
|
|
4759
|
+
display: flex;
|
|
4760
|
+
justify-content: flex-end;
|
|
4761
|
+
margin-block-start: var(--sc-spacing-md);
|
|
4762
|
+
}
|
|
4763
|
+
.sc-file-preview__tab {
|
|
4764
|
+
display: flex;
|
|
4765
|
+
flex-direction: column;
|
|
4766
|
+
align-items: flex-start;
|
|
4767
|
+
gap: var(--sc-spacing-sm);
|
|
4768
|
+
}
|
|
4769
|
+
.sc-file-preview__note {
|
|
4770
|
+
margin: var(--sc-spacing-xs) 0 0;
|
|
4771
|
+
color: var(--sc-color-text-muted);
|
|
4772
|
+
}
|
|
4773
|
+
.sc-file-preview__tab > .sc-file-preview__note {
|
|
4774
|
+
margin: 0;
|
|
4775
|
+
}
|
|
4776
|
+
|
|
4674
4777
|
}
|
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.11",
|
|
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.11"
|
|
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.11"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|