@aortl/admin-css 0.13.0 → 0.13.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aortl/admin-css",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Pre-built CSS design system. Drop in via <link> and use semantic class names.",
5
5
  "keywords": [
6
6
  "components",
@@ -34,6 +34,12 @@
34
34
  display: none;
35
35
  }
36
36
 
37
+ /* Keep a leading icon at its intrinsic size; the chevron is the `::after`
38
+ below, which is already `flex-shrink: 0`. */
39
+ .accordion-summary > :is(i, svg) {
40
+ flex-shrink: 0;
41
+ }
42
+
37
43
  /* Chevron — pushed to the end with margin-left: auto so any number of
38
44
  leading items (label, optional icon) sit together on the start side. */
39
45
  .accordion-summary::after {
@@ -1,6 +1,9 @@
1
1
  @layer components {
2
2
  .alert {
3
3
  @apply flex flex-col gap-1 w-full px-3 py-2 rounded-md border text-sm text-text;
4
+ /* Inherited by the title, description, and any bare-text body so long
5
+ words/URLs break instead of overflowing the (often grid-tracked) body. */
6
+ overflow-wrap: break-word;
4
7
  }
5
8
 
6
9
  /* Leading icon as a direct child switches the layout to a two-column grid:
@@ -9,7 +12,9 @@
9
12
  or any other inline SVG. */
10
13
  .alert:has(> :is(i, svg):first-child) {
11
14
  display: grid;
12
- grid-template-columns: auto 1fr;
15
+ /* `minmax(0, 1fr)` (not the default `minmax(auto, 1fr)`) lets the text
16
+ column shrink below its longest word so the body wraps. */
17
+ grid-template-columns: auto minmax(0, 1fr);
13
18
  column-gap: 0.5rem;
14
19
  row-gap: 0.25rem;
15
20
  align-items: center;
@@ -33,8 +38,12 @@
33
38
  grid-row: 1 / -1;
34
39
  }
35
40
 
41
+ /* Grid items default to `min-width: auto` and won't shrink below their
42
+ longest word; `min-width: 0` lets the title/description wrap inside the
43
+ text column. */
36
44
  .alert > :is(.alert-title, .alert-description) {
37
45
  grid-column: 2;
46
+ min-width: 0;
38
47
  }
39
48
 
40
49
  .alert-info {
@@ -7,6 +7,11 @@
7
7
  bg-surface-strong text-text;
8
8
  }
9
9
 
10
+ /* Keep a status dot or leading glyph round when the label is long. */
11
+ .badge > :is(i, svg) {
12
+ flex-shrink: 0;
13
+ }
14
+
10
15
  /* Variants — match the alert palette so danger/success/etc. stay coherent
11
16
  across status indicators and chips in tables. The bare `.badge` (no
12
17
  modifier) renders the neutral look, now folded into the base. */
@@ -35,4 +35,12 @@
35
35
  width: 0.875rem;
36
36
  height: 0.875rem;
37
37
  }
38
+
39
+ /* Setting a width on a flex item doesn't stop it from shrinking, so pin the
40
+ shrink factor too — keeps crumb and separator icons from squishing when a
41
+ long label tightens the row. */
42
+ .breadcrumb-item > :is(i, svg),
43
+ .breadcrumb-separator > :is(i, svg) {
44
+ flex-shrink: 0;
45
+ }
38
46
  }
@@ -10,6 +10,13 @@
10
10
  disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none;
11
11
  }
12
12
 
13
+ /* Keep leading/trailing icons at their intrinsic size — a flex item defaults
14
+ to `flex-shrink: 1`, so a narrow flex container would otherwise squish the
15
+ glyph horizontally before wrapping or truncating the label. */
16
+ .btn > :is(i, svg) {
17
+ flex-shrink: 0;
18
+ }
19
+
13
20
  /* Variants — the bare `.btn` (no modifier) is the low-emphasis default, so
14
21
  most admin buttons need no variant class. The colored variants reset the
15
22
  border to transparent since the base now carries a visible one. */
@@ -21,6 +28,15 @@
21
28
  @apply bg-transparent text-text border-transparent hover:bg-surface-muted;
22
29
  }
23
30
 
31
+ /* Muted — fills with the page background (`surface`) so it sits flush
32
+ instead of reading as a raised control, mirroring `card-muted`. The
33
+ default `.btn` is one step up (`surface-muted`); hover lifts the muted
34
+ button to that resting fill. For de-emphasised actions that should
35
+ recede into the page. */
36
+ .btn-muted {
37
+ @apply bg-surface hover:bg-surface-muted;
38
+ }
39
+
24
40
  .btn-danger {
25
41
  @apply bg-danger text-danger-content border-transparent hover:opacity-90;
26
42
  }
@@ -7,6 +7,12 @@
7
7
  focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary;
8
8
  }
9
9
 
10
+ /* Keep a leading icon from squishing when the link text wraps. The trailing
11
+ external arrow is already `flex: none` below. */
12
+ .link > :is(i, svg) {
13
+ flex-shrink: 0;
14
+ }
15
+
10
16
  /* External affordance: a trailing ↗ rendered from CSS so it ships identically
11
17
  in both bundles — no JS, no icon-font dependency. The arrow is a masked box
12
18
  tinted with `currentColor`, so it tracks the link's color (incl. hover). */
@@ -106,6 +106,12 @@
106
106
  @apply opacity-50 cursor-not-allowed;
107
107
  }
108
108
 
109
+ /* Don't let a constrained menu width squish a leading/trailing icon. */
110
+ .menu-trigger > :is(i, svg),
111
+ .menu-item > :is(i, svg) {
112
+ flex-shrink: 0;
113
+ }
114
+
109
115
  .menu-separator {
110
116
  @apply h-px my-1 bg-border border-0;
111
117
  }
@@ -31,6 +31,12 @@
31
31
  @apply bg-primary-muted text-primary;
32
32
  }
33
33
 
34
+ /* Keep brand/item icons at their intrinsic size in a crowded bar. */
35
+ .navbar-brand > :is(i, svg),
36
+ .navbar-item > :is(i, svg) {
37
+ flex-shrink: 0;
38
+ }
39
+
34
40
  /* Right-aligned slot for actions: shop selector, user menu, etc. */
35
41
  .navbar-actions {
36
42
  @apply flex items-center gap-2 ml-auto;
@@ -28,13 +28,21 @@
28
28
  @apply text-text-muted;
29
29
  }
30
30
 
31
+ /* `min-width: 0` lets the value's grid track shrink below its content; pair
32
+ it with `overflow-wrap` so long unbreakable values (IDs, hashes, emails,
33
+ URLs, file paths) break instead of overflowing the column. */
31
34
  .property-list-value {
32
35
  gap: 0.5rem;
33
36
  min-width: 0;
37
+ overflow-wrap: break-word;
34
38
  }
35
39
 
36
40
  /* Compact density — tighter rows for sidebar info blocks or very many
37
41
  short attributes. */
42
+ .property-list-compact .property-list-title {
43
+ @apply mb-1;
44
+ }
45
+
38
46
  .property-list-compact .property-list-label,
39
47
  .property-list-compact .property-list-value {
40
48
  padding: 0.125rem 0.5rem;
@@ -14,6 +14,11 @@
14
14
  @apply flex items-center gap-2 text-sm text-text-muted font-medium;
15
15
  }
16
16
 
17
+ /* Keep the label's leading icon at its intrinsic size. */
18
+ .stat-card-label > :is(i, svg) {
19
+ flex-shrink: 0;
20
+ }
21
+
17
22
  .stat-card-value {
18
23
  @apply text-2xl font-bold tabular-nums leading-tight;
19
24
  }
@@ -30,6 +30,11 @@
30
30
  @apply text-text;
31
31
  }
32
32
 
33
+ /* Keep a tab's leading icon at its intrinsic size when the label is long. */
34
+ .tabs .tab > :is(i, svg) {
35
+ flex-shrink: 0;
36
+ }
37
+
33
38
  /* Vanilla radio-input pattern: hide the inputs visually, treat the following
34
39
  <label class="tab"> as the selected tab when the radio is :checked.
35
40
  Pairs with `:has(input:checked)` below to show the right panel. */
package/src/fonts.css CHANGED
@@ -1,14 +1,16 @@
1
1
  /*
2
2
  * IBM Plex Sans + Mono — the default UI typeface for this design system.
3
3
  *
4
- * Hosted on Google's CDN (fonts.gstatic.com), latin + latin-ext subsets
5
- * only. Plex Sans is served as a variable font (one file covers weights
6
- * 400–600 via the wght axis); Plex Mono ships as discrete weight files.
4
+ * Hosted on Google's CDN (fonts.gstatic.com), latin + latin-ext subsets only.
5
+ * Plex Sans is served as a variable font (one file covers weights 400–600 via
6
+ * the wght axis); Plex Mono ships as discrete weight files.
7
7
  *
8
- * `font-display: optional` the browser uses the fallback stack from
9
- * `--font-sans` / `--font-mono` if Plex isn't ready in ~100ms, then
10
- * caches it for the next page load. No FOUT, no layout shift, and on
11
- * fast networks the typeface still wins on first paint.
8
+ * `font-display: swap` paints text immediately. Layout shift on swap is
9
+ * neutralised by the metric-matched fallback faces below ("IBM Plex Sans
10
+ * Fallback" / "IBM Plex Mono Fallback"): they alias a local system font but
11
+ * override its metrics to occupy Plex's exact box, so the swap changes glyph
12
+ * shapes without moving anything. The fallback families are wired into
13
+ * `--font-sans` / `--font-mono` in theme.css, ahead of the generic stack.
12
14
  *
13
15
  * Opt out by overriding `--font-sans` / `--font-mono`, or by importing
14
16
  * admin-css's source files individually and skipping this one.
@@ -19,7 +21,7 @@
19
21
  font-family: "IBM Plex Sans";
20
22
  font-style: normal;
21
23
  font-weight: 400 600;
22
- font-display: optional;
24
+ font-display: swap;
23
25
  src: url(https://fonts.gstatic.com/s/ibmplexsans/v23/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxQKYbABA.woff2)
24
26
  format("woff2");
25
27
  unicode-range:
@@ -31,7 +33,7 @@
31
33
  font-family: "IBM Plex Sans";
32
34
  font-style: normal;
33
35
  font-weight: 400 600;
34
- font-display: optional;
36
+ font-display: swap;
35
37
  src: url(https://fonts.gstatic.com/s/ibmplexsans/v23/zYXzKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1syxeKYY.woff2)
36
38
  format("woff2");
37
39
  unicode-range:
@@ -44,7 +46,7 @@
44
46
  font-family: "IBM Plex Mono";
45
47
  font-style: normal;
46
48
  font-weight: 400;
47
- font-display: optional;
49
+ font-display: swap;
48
50
  src: url(https://fonts.gstatic.com/s/ibmplexmono/v20/-F63fjptAgt5VM-kVkqdyU8n1iEq129k.woff2)
49
51
  format("woff2");
50
52
  unicode-range:
@@ -56,7 +58,7 @@
56
58
  font-family: "IBM Plex Mono";
57
59
  font-style: normal;
58
60
  font-weight: 400;
59
- font-display: optional;
61
+ font-display: swap;
60
62
  src: url(https://fonts.gstatic.com/s/ibmplexmono/v20/-F63fjptAgt5VM-kVkqdyU8n1i8q1w.woff2)
61
63
  format("woff2");
62
64
  unicode-range:
@@ -67,7 +69,7 @@
67
69
  font-family: "IBM Plex Mono";
68
70
  font-style: normal;
69
71
  font-weight: 500;
70
- font-display: optional;
72
+ font-display: swap;
71
73
  src: url(https://fonts.gstatic.com/s/ibmplexmono/v20/-F6qfjptAgt5VM-kVkqdyU8n3twJwl5FgtIU.woff2)
72
74
  format("woff2");
73
75
  unicode-range:
@@ -79,10 +81,37 @@
79
81
  font-family: "IBM Plex Mono";
80
82
  font-style: normal;
81
83
  font-weight: 500;
82
- font-display: optional;
84
+ font-display: swap;
83
85
  src: url(https://fonts.gstatic.com/s/ibmplexmono/v20/-F6qfjptAgt5VM-kVkqdyU8n3twJwlBFgg.woff2)
84
86
  format("woff2");
85
87
  unicode-range:
86
88
  U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
87
89
  U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
88
90
  }
91
+
92
+ /*
93
+ * Metric-matched fallbacks — a local system font rewritten to Plex's box so
94
+ * the swap above causes no layout shift. The override numbers were computed
95
+ * once from font metrics with @capsizecss/core (`createFontStack`); the project
96
+ * doesn't depend on capsize, so if the primary font ever changes, recompute
97
+ * them with capsize rather than hand-editing. size-adjust holds in every
98
+ * engine; the ascent/descent overrides are ignored by Safari/WebKit, but
99
+ * line-gap is 0 so the residual vertical shift there is negligible.
100
+ */
101
+ /* IBM Plex Sans -> Arial */
102
+ @font-face {
103
+ font-family: "IBM Plex Sans Fallback";
104
+ src: local("Arial"), local("ArialMT");
105
+ ascent-override: 101.3184%;
106
+ descent-override: 27.183%;
107
+ line-gap-override: 0%;
108
+ size-adjust: 101.1663%;
109
+ }
110
+ /* IBM Plex Mono -> Courier New */
111
+ @font-face {
112
+ font-family: "IBM Plex Mono Fallback";
113
+ src: local("Courier New"), local("CourierNewPSMT");
114
+ ascent-override: 102.5167%;
115
+ descent-override: 27.5045%;
116
+ size-adjust: 99.9837%;
117
+ }
package/src/theme.css CHANGED
@@ -179,10 +179,11 @@
179
179
  * indirection. Override `--font-sans` to swap the entire UI font.
180
180
  */
181
181
  --font-sans:
182
- "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
182
+ "IBM Plex Sans", "IBM Plex Sans Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
183
+ Roboto, sans-serif;
183
184
  --font-mono:
184
- "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
185
- monospace;
185
+ "IBM Plex Mono", "IBM Plex Mono Fallback", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
186
+ Consolas, "Liberation Mono", monospace;
186
187
  }
187
188
 
188
189
  @theme static {