@surflane/ui 0.6.0 → 0.7.0
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 +1 -1
- package/dist/css/rules/app-shell.css +23 -16
- package/dist/css/rules/chart.css +8 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Import the stylesheets once at the application root. `all.css` brings the tokens
|
|
|
18
18
|
@import '@surflane/ui/all.css';
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
To ship only what you use, import component stylesheets instead, such as `@surflane/ui/button.css` and `@surflane/ui/dialog.css`. Each brings the tokens and the styles of what its component renders. The rules sit in `surflane.*` cascade layers, so your unlayered CSS overrides them. Set `data-theme="light"` or `data-theme="dark"` on `<html>` before the first paint and add `pui-typography` to `<body>`. The [install guide](https://surflane.page/install) walks through Vite, Next.js, React Router and Astro, with or without Tailwind CSS.
|
|
21
|
+
To ship only what you use, import component stylesheets instead, such as `@surflane/ui/button.css` and `@surflane/ui/dialog.css`. Each brings the tokens and the styles of what its component renders. The rules sit in `surflane.*` cascade layers, so your unlayered CSS overrides them. Set `data-theme="light"` or `data-theme="dark"` on `<html>` before the first paint and add `pui-typography` to `<body>`. With AppShell, which fills the window, also give `<body>` no margin and the `--chrome` background. The [install guide](https://surflane.page/install) walks through Vite, Next.js, React Router and Astro, with or without Tailwind CSS.
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
24
|
import {
|
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
surflane.sizes;
|
|
4
4
|
|
|
5
5
|
@layer surflane.components {
|
|
6
|
-
/* Application frame slots: navigation state and product routing remain caller-owned.
|
|
6
|
+
/* Application frame slots: navigation state and product routing remain caller-owned.
|
|
7
|
+
The shell is never rounded: its edge is the window's, or the edge of a container
|
|
8
|
+
that frames it and clips it. Only the page surface inside it is rounded. */
|
|
7
9
|
.pui-app-shell {
|
|
8
|
-
--app-shell-radius: var(--radius-sheet);
|
|
9
10
|
--app-shell-inset: var(--space-3);
|
|
11
|
+
/* --app-shell-radius, if a caller still sets it, keeps deriving the page radius. */
|
|
12
|
+
--app-shell-page-radius: max(
|
|
13
|
+
0px,
|
|
14
|
+
calc(
|
|
15
|
+
var(--app-shell-radius, var(--radius-sheet)) - var(--app-shell-inset)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
10
18
|
--app-shell-sidebar-width: 216px;
|
|
11
19
|
/* The collapsed sidebar's width. Set it on the shell for a narrower rail. */
|
|
12
20
|
--app-shell-rail-width: 64px;
|
|
@@ -17,7 +25,6 @@
|
|
|
17
25
|
min-inline-size: 0;
|
|
18
26
|
padding: var(--app-shell-inset);
|
|
19
27
|
background: var(--chrome);
|
|
20
|
-
border-radius: var(--app-shell-radius);
|
|
21
28
|
}
|
|
22
29
|
.pui-app-shell[data-sidebar='collapsed'] {
|
|
23
30
|
--app-shell-sidebar-width: var(--app-shell-rail-width);
|
|
@@ -43,10 +50,7 @@
|
|
|
43
50
|
min-block-size: 0;
|
|
44
51
|
padding: var(--space-6);
|
|
45
52
|
background: var(--canvas);
|
|
46
|
-
border-radius:
|
|
47
|
-
0px,
|
|
48
|
-
calc(var(--app-shell-radius) - var(--app-shell-inset))
|
|
49
|
-
);
|
|
53
|
+
border-radius: var(--app-shell-page-radius);
|
|
50
54
|
overflow-wrap: anywhere;
|
|
51
55
|
}
|
|
52
56
|
.pui-app-shell-footer {
|
|
@@ -98,16 +102,24 @@
|
|
|
98
102
|
clip-path: inset(50%);
|
|
99
103
|
overflow: hidden;
|
|
100
104
|
}
|
|
105
|
+
/* On a phone the frame costs more room than it gives: the page meets the screen's
|
|
106
|
+
edges, and only the header keeps its inset. */
|
|
101
107
|
@media (max-width: 760px) {
|
|
102
108
|
.pui-app-shell {
|
|
103
109
|
grid-template-columns: minmax(0, 1fr);
|
|
104
110
|
grid-template-rows: auto minmax(0, 1fr);
|
|
111
|
+
gap: 0;
|
|
112
|
+
padding: 0;
|
|
113
|
+
}
|
|
114
|
+
.pui-app-shell > .pui-app-shell-header {
|
|
115
|
+
padding: var(--app-shell-inset);
|
|
105
116
|
}
|
|
106
117
|
.pui-app-shell-sidebar {
|
|
107
118
|
display: none;
|
|
108
119
|
}
|
|
109
120
|
.pui-app-shell-content {
|
|
110
121
|
padding: var(--space-4);
|
|
122
|
+
border-radius: 0;
|
|
111
123
|
}
|
|
112
124
|
}
|
|
113
125
|
@media (max-width: 760px), (pointer: coarse) {
|
|
@@ -163,19 +175,14 @@
|
|
|
163
175
|
margin-inline-start: 0;
|
|
164
176
|
padding: var(--space-6);
|
|
165
177
|
background: var(--canvas);
|
|
166
|
-
border-radius:
|
|
167
|
-
0px,
|
|
168
|
-
calc(var(--app-shell-radius) - var(--app-shell-inset))
|
|
169
|
-
);
|
|
178
|
+
border-radius: var(--app-shell-page-radius);
|
|
170
179
|
}
|
|
171
|
-
/*
|
|
180
|
+
/* On a phone the page meets the screen's edges, below the mobile header. */
|
|
172
181
|
@media (max-width: 760px) {
|
|
173
182
|
.pui-app-shell-page {
|
|
174
|
-
margin:
|
|
183
|
+
margin: 0;
|
|
175
184
|
padding: var(--space-4);
|
|
176
|
-
|
|
177
|
-
.pui-app-shell:has(> .pui-app-shell-header) .pui-app-shell-page {
|
|
178
|
-
margin-block-start: 0;
|
|
185
|
+
border-radius: 0;
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
188
|
.pui-app-shell[data-layout='workspace'] .pui-app-shell-footer {
|
package/dist/css/rules/chart.css
CHANGED
|
@@ -87,6 +87,14 @@
|
|
|
87
87
|
outline-offset: var(--focus-ring-offset);
|
|
88
88
|
border-radius: var(--radius-sm);
|
|
89
89
|
}
|
|
90
|
+
/* The browser's SVG styles ring any :focus, so a tap or click would draw its own
|
|
91
|
+
ring: around the surface, or around the layer a tapped line or point sits in,
|
|
92
|
+
since Recharts gives each layer tabindex -1. Only the surface is a keyboard
|
|
93
|
+
target, and it rings for keyboard focus only, like every other control. */
|
|
94
|
+
.pui-chart-plot .recharts-surface:focus:not(:focus-visible),
|
|
95
|
+
.pui-chart-plot .recharts-surface :focus {
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
90
98
|
.pui-chart-axis-label {
|
|
91
99
|
margin: 0;
|
|
92
100
|
color: var(--ink-muted);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surflane/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Surflane React components built on Base UI, with data, chart, code and Markdown components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -407,7 +407,7 @@
|
|
|
407
407
|
"peerDependencies": {
|
|
408
408
|
"@headless-tree/core": "^1.8.0",
|
|
409
409
|
"@headless-tree/react": "^1.8.0",
|
|
410
|
-
"@surflane/design-tokens": "^0.
|
|
410
|
+
"@surflane/design-tokens": "^0.7.0",
|
|
411
411
|
"@tanstack/react-virtual": "^3.14.21",
|
|
412
412
|
"react": "^19.0.0",
|
|
413
413
|
"react-aria-components": "^1.22.1",
|