@surflane/ui 0.10.0 → 0.10.1
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.
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: var(--surf-space-4);
|
|
14
14
|
}
|
|
15
|
+
/* Base UI renders the legend as a div, a flex item, so the fieldset's gap alone
|
|
16
|
+
spaces it from the first field. A margin added to that gap and left the legend
|
|
17
|
+
closer to the group above it than to its own fields. */
|
|
15
18
|
.surf-fieldset-legend {
|
|
16
19
|
padding: 0;
|
|
17
|
-
margin-bottom: var(--surf-space-4);
|
|
18
20
|
color: var(--surf-ink);
|
|
19
21
|
font: var(--surf-weight-medium)
|
|
20
22
|
var(--surf-type-subsection-size)/var(--surf-type-subsection-leading)
|
|
@@ -63,6 +63,12 @@
|
|
|
63
63
|
opacity: var(--surf-control-disabled-opacity);
|
|
64
64
|
cursor: not-allowed;
|
|
65
65
|
}
|
|
66
|
+
/* A read-only field keeps its value readable and copyable, but its steppers do
|
|
67
|
+
nothing, so they fade like a disabled one's. */
|
|
68
|
+
.surf-number-step[data-readonly] {
|
|
69
|
+
opacity: var(--surf-control-disabled-opacity);
|
|
70
|
+
cursor: default;
|
|
71
|
+
}
|
|
66
72
|
.surf-combobox-group[data-invalid],
|
|
67
73
|
.surf-number-group[data-invalid] {
|
|
68
74
|
border-color: var(--surf-status-danger-fg);
|
|
@@ -9,8 +9,15 @@
|
|
|
9
9
|
width: 100%;
|
|
10
10
|
height: 1em;
|
|
11
11
|
border-radius: var(--surf-radius-sm);
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/* Its own tokens: --surf-surface is about 1.07:1 on a light canvas, and a pulse
|
|
13
|
+
through opacity faded it further. The pulse moves between the two shades. */
|
|
14
|
+
background: var(--surf-skeleton-base);
|
|
15
|
+
animation: surf-skeleton-pulse 1.4s ease-in-out infinite;
|
|
16
|
+
}
|
|
17
|
+
@keyframes surf-skeleton-pulse {
|
|
18
|
+
50% {
|
|
19
|
+
background-color: var(--surf-skeleton-highlight);
|
|
20
|
+
}
|
|
14
21
|
}
|
|
15
22
|
.surf-skeleton[data-shape='block'] {
|
|
16
23
|
height: 96px;
|
package/dist/file-upload.js
CHANGED
|
@@ -55,6 +55,8 @@ function accepts(file, accept) {
|
|
|
55
55
|
export const FileUpload = function FileUpload({ label, description, name, form, accept = '', capture, multiple = false, required = false, maxFiles = Infinity, maxFileSize = Infinity, files: controlled, defaultFiles = [], onFilesChange, onReject, transport, getUploadError, labels: customLabels, disabled = false, className, onDragEnter, onDragLeave, onDragOver, onDrop, ref: forwardedRef, ...props }) {
|
|
56
56
|
const labels = {
|
|
57
57
|
...labelsDefault,
|
|
58
|
+
// A field that takes one file says so.
|
|
59
|
+
...(!multiple && { choose: 'Choose file', drop: 'or drop a file here' }),
|
|
58
60
|
...customLabels,
|
|
59
61
|
status: { ...labelsDefault.status, ...customLabels?.status },
|
|
60
62
|
};
|
|
@@ -271,7 +273,7 @@ export const FileUpload = function FileUpload({ label, description, name, form,
|
|
|
271
273
|
}
|
|
272
274
|
}
|
|
273
275
|
const hasFiles = (event) => Array.from(event.dataTransfer.types).includes('Files');
|
|
274
|
-
return (_jsxs(Field.Root, { ...props, ref: ref, name: name, disabled: disabled, className: skin('surf-
|
|
276
|
+
return (_jsxs(Field.Root, { ...props, ref: ref, name: name, disabled: disabled, className: skin('surf-file-upload', className), "data-dragging": dragging || undefined, children: [_jsx(Field.Label, { children: label }), description != null && description !== false && (_jsx(Field.Description, { children: description })), _jsxs("div", { className: 'surf-file-dropzone', onDragEnter: (event) => {
|
|
275
277
|
onDragEnter?.(event);
|
|
276
278
|
if (!event.defaultPrevented && hasFiles(event) && !disabled) {
|
|
277
279
|
event.preventDefault();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surflane/ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Surflane React components built on Base UI, with data, chart, code and Markdown components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -406,8 +406,8 @@
|
|
|
406
406
|
"@base-ui/react": "^1.9.0",
|
|
407
407
|
"@headless-tree/core": "^1.8.0",
|
|
408
408
|
"@headless-tree/react": "^1.8.0",
|
|
409
|
-
"@surflane/css": "^0.10.
|
|
410
|
-
"@surflane/design-tokens": "^0.10.
|
|
409
|
+
"@surflane/css": "^0.10.1",
|
|
410
|
+
"@surflane/design-tokens": "^0.10.1",
|
|
411
411
|
"@tanstack/react-virtual": "^3.14.21",
|
|
412
412
|
"react": "^19.0.0",
|
|
413
413
|
"react-aria-components": "^1.22.1",
|