@godxjp/ui 13.17.2 → 13.17.4
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.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
type CardSize = "md" | "compact";
|
|
4
|
-
/** Semantic
|
|
4
|
+
/** Semantic leading-edge accent stripe (border-inline-start; width via the
|
|
5
|
+
* --card-accent-rail-width token, default 6px). */
|
|
5
6
|
type CardAccent = "primary" | "success" | "warning" | "info" | "attention" | "destructive";
|
|
6
7
|
/** Surface fill — plain card, muted band, borderless outline, or emphasized featured ring. */
|
|
7
8
|
type CardVariant = "default" | "muted" | "outline" | "featured";
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
--card-space-body-y: var(--space-5);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
/* ── Accent edge —
|
|
58
|
+
/* ── Accent edge — semantic left stripe (token width), content on shell ─ */
|
|
59
59
|
[data-slot="card"][data-accent] {
|
|
60
|
-
border-inline-start-width:
|
|
60
|
+
border-inline-start-width: var(--card-accent-rail-width);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
[data-slot="card"][data-accent="primary"] {
|
|
@@ -87,7 +87,9 @@
|
|
|
87
87
|
[data-slot="card"][data-accent] > [data-slot="card-header"],
|
|
88
88
|
[data-slot="card"][data-accent] > [data-slot="card-content"]:not([data-flush]),
|
|
89
89
|
[data-slot="card"][data-accent] > [data-slot="card-footer"]:not([data-flush]) {
|
|
90
|
-
padding-inline-start: calc(
|
|
90
|
+
padding-inline-start: calc(
|
|
91
|
+
var(--card-space-inset) - var(--card-accent-rail-width)
|
|
92
|
+
);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
/* ── Header ──────────────────────────────────────────────────────────── */
|
|
@@ -20,14 +20,30 @@
|
|
|
20
20
|
.ui-form-field {
|
|
21
21
|
display: grid;
|
|
22
22
|
gap: var(--field-label-gap);
|
|
23
|
+
/* Fill the container's inline (horizontal) axis in ANY parent — a Form's
|
|
24
|
+
* flex column (.ui-form), a ResponsiveGrid cell, or a bare flex column /
|
|
25
|
+
* block — instead of collapsing to the content's max-content width. This
|
|
26
|
+
* mirrors Ant Design's Form.Item, which sets the item/control to width:100%
|
|
27
|
+
* in vertical layout rather than relying on the parent to stretch it. Without
|
|
28
|
+
* this, a flex-column parent maps `align-self:start` onto the inline axis and
|
|
29
|
+
* the field shrinks to its widest content (a helper-less input collapses to
|
|
30
|
+
* its default ~20ch). Inline layout opts out below (Ant: compact, content-width). */
|
|
31
|
+
inline-size: 100%;
|
|
23
32
|
/* Never stretch to a taller grid-row sibling (e.g. a field carrying a
|
|
24
33
|
* helper/error). Stretching would let .ui-form-field-control's
|
|
25
34
|
* align-content:center vertically centre the control, so a field WITHOUT a
|
|
26
35
|
* helper sits lower than one WITH a helper in the same ResponsiveGrid row.
|
|
27
|
-
* Hugging content keeps every control top-aligned across the row.
|
|
36
|
+
* Hugging content keeps every control top-aligned across the row. This is the
|
|
37
|
+
* BLOCK (vertical) axis only — width is pinned by inline-size:100% above. */
|
|
28
38
|
align-self: start;
|
|
29
39
|
}
|
|
30
40
|
|
|
41
|
+
/* Inline layout is intentionally compact (Ant: layout="inline"): the field
|
|
42
|
+
* hugs its content so a row of inline fields can sit side by side. */
|
|
43
|
+
.ui-form-field[data-layout="inline"] {
|
|
44
|
+
inline-size: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
31
47
|
.ui-form-field-label {
|
|
32
48
|
display: flex;
|
|
33
49
|
align-items: center;
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
* --card-header-background-alpha: 0 for a quiet borderless-band header. */
|
|
21
21
|
--card-header-border-bottom: 1px solid hsl(var(--card-border));
|
|
22
22
|
--card-radius: var(--radius);
|
|
23
|
+
/* Accent edge — width of the semantic leading-edge stripe (data-accent).
|
|
24
|
+
* Tokenised (rule #44) so a service theme can re-tune it without forking CSS.
|
|
25
|
+
* The slot padding compensation in card-layout.css subtracts the same token,
|
|
26
|
+
* so content stays aligned on the shell whatever the rail width. */
|
|
27
|
+
--card-accent-rail-width: 6px;
|
|
23
28
|
--stat-card-label-font-size: var(--font-size-xs);
|
|
24
29
|
--stat-card-label-font-weight: var(--font-weight-medium);
|
|
25
30
|
--stat-card-label-letter-spacing: 0.04em;
|