@12-apps/ui 1.20.0 → 1.21.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/package.json
CHANGED
|
@@ -60,6 +60,20 @@ function clickKeys(onClick: () => void) {
|
|
|
60
60
|
* 1.4 all four rows keep identical rail edges, because subgrid tracks and the
|
|
61
61
|
* zoom that reads them are the same for every row.
|
|
62
62
|
*/
|
|
63
|
+
/**
|
|
64
|
+
* DIVIDER COMPOSES WITH THE VARIANT — it changes the row's SHAPE, not its
|
|
65
|
+
* surface.
|
|
66
|
+
*
|
|
67
|
+
* It used to set `border: 0` and hard-code its own rule colour, which discarded
|
|
68
|
+
* whatever the variant had drawn: `outline`, `text` and `ghost` all collapsed
|
|
69
|
+
* to one identical flush row, and the variant control silently stopped meaning
|
|
70
|
+
* anything the moment `divider` was on.
|
|
71
|
+
*
|
|
72
|
+
* Now only the GEOMETRY changes here — the box's sides go, one edge stays — and
|
|
73
|
+
* no `borderColor` is written, so the colour set by `cardSurfaceStyles` survives.
|
|
74
|
+
* A variant that draws no border of its own gets the neutral rule from
|
|
75
|
+
* {@link rowStyles}.
|
|
76
|
+
*/
|
|
63
77
|
export function rowSx(opts: {
|
|
64
78
|
inGroup: boolean;
|
|
65
79
|
railCount: number;
|
|
@@ -134,7 +148,7 @@ export function rowSx(opts: {
|
|
|
134
148
|
'& > [data-slot="value"]': { gridArea: "2 / 4", textAlign: "right" },
|
|
135
149
|
},
|
|
136
150
|
...(divider
|
|
137
|
-
? {
|
|
151
|
+
? { borderRadius: 0, borderWidth: 0, borderBottomWidth: 1, borderStyle: "solid" }
|
|
138
152
|
: {}),
|
|
139
153
|
};
|
|
140
154
|
}
|
|
@@ -217,22 +231,36 @@ export function actionProps(onClick: (() => void) | undefined) {
|
|
|
217
231
|
}
|
|
218
232
|
|
|
219
233
|
/** The surface and the geometry, merged — the row's whole `sx` in one place. */
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The row's painted surface, plus the divider's colour fallback.
|
|
237
|
+
*
|
|
238
|
+
* A variant with no border of its own (`text`, `ghost`) would draw its rule in
|
|
239
|
+
* the inherited colour — the TEXT colour, i.e. a black bar across the row. The
|
|
240
|
+
* neutral divider token is supplied only in that case; a variant that has a
|
|
241
|
+
* border keeps it, which is the whole point of composing the two.
|
|
242
|
+
*/
|
|
243
|
+
function rowSurface(
|
|
244
|
+
props: BaseListCardProps,
|
|
245
|
+
shell: ReturnType<typeof useRowShell>,
|
|
246
|
+
): Record<string, unknown> {
|
|
247
|
+
const { theme, selectable, drag } = shell;
|
|
248
|
+
const surface = cardSurfaceStyles(
|
|
249
|
+
{ ...props, selectable, shape: "row", state: drag.dragging ? "disabled" : props.state },
|
|
250
|
+
theme,
|
|
251
|
+
);
|
|
252
|
+
if (props.divider !== true || surface.borderColor != null) return surface;
|
|
253
|
+
return { ...surface, borderBottomColor: theme.palette.divider };
|
|
254
|
+
}
|
|
255
|
+
|
|
220
256
|
export function rowStyles(
|
|
221
257
|
props: BaseListCardProps,
|
|
222
258
|
shell: ReturnType<typeof useRowShell>,
|
|
223
259
|
cellTemplate: string | null,
|
|
224
260
|
): Record<string, unknown> {
|
|
225
|
-
const { group,
|
|
261
|
+
const { group, selectable, drag, reserve, pad, padY, scale, acts } = shell;
|
|
226
262
|
return {
|
|
227
|
-
...
|
|
228
|
-
{
|
|
229
|
-
...props,
|
|
230
|
-
selectable,
|
|
231
|
-
shape: "row",
|
|
232
|
-
state: drag.dragging ? "disabled" : props.state,
|
|
233
|
-
},
|
|
234
|
-
theme,
|
|
235
|
-
),
|
|
263
|
+
...rowSurface(props, shell),
|
|
236
264
|
...rowSx({
|
|
237
265
|
inGroup: group !== null,
|
|
238
266
|
railCount: group?.railCount ?? RAIL_COUNT,
|