@aortl/admin-css 0.20.1 → 0.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/CHANGELOG.md CHANGED
@@ -4,6 +4,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.21.0] - 2026-09-25
8
+
9
+ ### Added
10
+
11
+ - `Button` types the HTML invoker attributes `commandfor` and `command`, which `@types/react` doesn't declare yet, so the documented `Dialog` and `Drawer` invoker examples type-check. (react)
12
+ - `systemAccent` on `BrandTile` and `Navbar`, as on `AdminRoot` and `AppShell`: sets `--color-system-accent` inline. (react)
13
+ - `maxWidth` on `Container` sets `--container-max` inline, overriding the `size` preset. (react)
14
+ - `useConfirm()`, a promise-based `window.confirm`: `await confirm({ title, description, confirmLabel, cancelLabel, variant })` resolves `true` on Confirm and `false` on Cancel, Esc, or unmount. `<AdminRoot>` hosts the dialog, a `size="sm"` `Dialog` with no light dismiss that renders only while a confirm is pending, and queues concurrent calls in order. `variant: "danger"` renders a danger confirm button and focuses Cancel. Throws outside `<AdminRoot>`. (react)
15
+ - `variant` and `size` on `Menu.Trigger` style the trigger as a `Button` (`_ao-btn`, square without children), for button-styled and split-button menus. A raw `className="btn"` on the trigger rendered unstyled under the scoped bundle, since the `_ao-` prefix is added only to admin's own classes. (react)
16
+
17
+ ### Changed
18
+
19
+ - The asterisk on a `.field-label` follows the control's own `required` (via `:has()`) when the label is a direct child of the `.field`, so pages whose required controls lacked `[data-required]` now show one: React forms without `<Field required>`, and Django templates without crispy's `.asteriskField` (crispy labels are unchanged). `[data-required]` / `<Field required>` still add it, for controls with no native `required`, a wrapped label, or a nested field holding both its own and a sub-field's required control. `[data-required="false"]`, which `<Field required={false}>` now renders, removes it. (both)
20
+
21
+ ### Fixed
22
+
23
+ - Containers are no longer capped at Tailwind's breakpoint widths. `admin.css` and `admin.scoped.css` shipped Tailwind's `.container` utility, whose later `utilities` layer overrode `max-width` on every `.container` and `<Container>`: the default, `container-sm`/`-lg`/`-fluid`, and per-instance `--container-max`. Container widths change as a result: wider at most viewports, and `90rem` in place of `96rem` at the widest. Tailwind builds that import the source CSS generated the same utility; `theme.css` now excludes it with `@source not inline("container")`, which needs Tailwind v4.1+. (css)
24
+ - The checked `Switch` thumb no longer vanishes in dark mode. It was `paper` on the `primary` track, which is also paper in dark mode; the checked thumb now uses `primary-content`, as `ToggleButton`'s mini switch already did. (css)
25
+
26
+ ### Removed
27
+
28
+ - Stray Tailwind utilities in `admin.css` and `admin.scoped.css`: `.flex`, `.grid`, `.block`, `.inline`, `.hidden`, `.sr-only`, `.relative`, `.absolute`, `.fixed`, `.sticky`, `.flex-1`, `.overflow-hidden`, `.rounded`, `.text-right`, `.tabular-nums` and a few more. The build scanned the repo for class-like strings and emitted whatever matched. Vanilla pages that relied on any of them without `admin.utilities.css` must add that bundle. `Dialog` and `Drawer` headers without a title and `Sidebar.CollapseToggle` used two of them; `.dialog-close` now pins itself to the header end with `margin-inline-start: auto`, and the toggle drops its redundant `sr-only` label (the checkbox keeps its `aria-label`). `admin.utilities.css` also loses `.transform`, which its safelist never included. (both)
29
+
7
30
  ## [0.20.1] - 2026-07-30
8
31
 
9
32
  ### Fixed
@@ -139,12 +162,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
139
162
  - Make `primary` a high-contrast neutral and move blue to `info`. (both)
140
163
  - Use solid color fills for `Alert` and `Badge` status variants. (both)
141
164
 
142
- [Unreleased]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.20.1...HEAD
165
+ [Unreleased]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.21.0...HEAD
143
166
  [0.16.1]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.16.0...v0.16.1
144
167
  [0.16.0]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.15.1...v0.16.0
145
168
  [0.15.1]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.15.0...v0.15.1
146
169
  [0.15.0]: https://github.com/Digital-Udvikling/admin-design-system/releases/tag/v0.15.0
147
170
 
171
+ [0.21.0]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.20.1...v0.21.0
148
172
  [0.20.1]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.20.0...v0.20.1
149
173
  [0.20.0]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.19.1...v0.20.0
150
174
  [0.19.1]: https://github.com/Digital-Udvikling/admin-design-system/compare/v0.19.0...v0.19.1
package/dist/admin.css CHANGED
@@ -370,109 +370,7 @@
370
370
  display: none !important;
371
371
  }
372
372
  }
373
- @layer utilities {
374
- .collapse {
375
- visibility: collapse;
376
- }
377
- .visible {
378
- visibility: visible;
379
- }
380
- .sr-only {
381
- position: absolute;
382
- width: 1px;
383
- height: 1px;
384
- padding: 0;
385
- margin: -1px;
386
- overflow: hidden;
387
- clip-path: inset(50%);
388
- white-space: nowrap;
389
- border-width: 0;
390
- }
391
- .absolute {
392
- position: absolute;
393
- }
394
- .fixed {
395
- position: fixed;
396
- }
397
- .relative {
398
- position: relative;
399
- }
400
- .sticky {
401
- position: sticky;
402
- }
403
- .container {
404
- width: 100%;
405
- @media (width >= 40rem) {
406
- max-width: 40rem;
407
- }
408
- @media (width >= 48rem) {
409
- max-width: 48rem;
410
- }
411
- @media (width >= 64rem) {
412
- max-width: 64rem;
413
- }
414
- @media (width >= 80rem) {
415
- max-width: 80rem;
416
- }
417
- @media (width >= 96rem) {
418
- max-width: 96rem;
419
- }
420
- }
421
- .my-4 {
422
- margin-block: calc(var(--spacing) * 4);
423
- }
424
- .block {
425
- display: block;
426
- }
427
- .flex {
428
- display: flex;
429
- }
430
- .grid {
431
- display: grid;
432
- }
433
- .hidden {
434
- display: none;
435
- }
436
- .inline {
437
- display: inline;
438
- }
439
- .table {
440
- display: table;
441
- }
442
- .table-cell {
443
- display: table-cell;
444
- }
445
- .flex-1 {
446
- flex: 1;
447
- }
448
- .transform {
449
- transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
450
- }
451
- .overflow-hidden {
452
- overflow: hidden;
453
- }
454
- .rounded {
455
- border-radius: 0.25rem;
456
- }
457
- .rounded-md {
458
- border-radius: var(--radius-md);
459
- }
460
- .text-right {
461
- text-align: right;
462
- }
463
- .tabular-nums {
464
- --tw-numeric-spacing: tabular-nums;
465
- font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
466
- }
467
- .ring {
468
- --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
469
- box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
470
- }
471
- .outline {
472
- outline-style: var(--tw-outline-style);
473
- outline-width: 1px;
474
- }
475
- }
373
+ @layer utilities;
476
374
  @font-face {
477
375
  font-family: "IBM Plex Sans";
478
376
  font-style: normal;
@@ -2777,6 +2675,7 @@
2777
2675
  .switch[data-checked] .switch-thumb {
2778
2676
  --tw-translate-x: calc(var(--spacing) * 4);
2779
2677
  translate: var(--tw-translate-x) var(--tw-translate-y);
2678
+ background-color: var(--color-primary-content);
2780
2679
  }
2781
2680
  input.switch {
2782
2681
  margin: calc(var(--spacing) * 0);
@@ -2803,6 +2702,7 @@
2803
2702
  input.switch:checked::before {
2804
2703
  --tw-translate-x: calc(var(--spacing) * 4);
2805
2704
  translate: var(--tw-translate-x) var(--tw-translate-y);
2705
+ background-color: var(--color-primary-content);
2806
2706
  }
2807
2707
  label:has(> .switch) {
2808
2708
  display: inline-flex;
@@ -3648,6 +3548,7 @@
3648
3548
  border-bottom-right-radius: inherit;
3649
3549
  }
3650
3550
  .dialog-close {
3551
+ margin-inline-start: auto;
3651
3552
  display: inline-flex;
3652
3553
  width: calc(var(--spacing) * 7);
3653
3554
  height: calc(var(--spacing) * 7);
@@ -3776,7 +3677,7 @@
3776
3677
  font-weight: var(--font-weight-medium);
3777
3678
  color: var(--color-text);
3778
3679
  }
3779
- .field-label[data-required]::after {
3680
+ .field-label[data-required]:not([data-required="false"], :has(.asteriskField))::after, .field:where( :has(:required:not(.field .field :required)), :has(:required):not(:has(.field :required)) ) > .field-label:not([data-required="false"], :has(.asteriskField))::after {
3780
3681
  content: " *";
3781
3682
  color: var(--color-danger);
3782
3683
  }
@@ -5599,43 +5500,29 @@
5599
5500
  }
5600
5501
  }
5601
5502
  }
5602
- @property --tw-rotate-x {
5603
- syntax: "*";
5604
- inherits: false;
5605
- }
5606
- @property --tw-rotate-y {
5607
- syntax: "*";
5608
- inherits: false;
5609
- }
5610
- @property --tw-rotate-z {
5611
- syntax: "*";
5612
- inherits: false;
5613
- }
5614
- @property --tw-skew-x {
5615
- syntax: "*";
5616
- inherits: false;
5617
- }
5618
- @property --tw-skew-y {
5503
+ @property --tw-leading {
5619
5504
  syntax: "*";
5620
5505
  inherits: false;
5621
5506
  }
5622
- @property --tw-ordinal {
5507
+ @property --tw-font-weight {
5623
5508
  syntax: "*";
5624
5509
  inherits: false;
5625
5510
  }
5626
- @property --tw-slashed-zero {
5511
+ @property --tw-border-style {
5627
5512
  syntax: "*";
5628
5513
  inherits: false;
5514
+ initial-value: solid;
5629
5515
  }
5630
- @property --tw-numeric-figure {
5516
+ @property --tw-outline-style {
5631
5517
  syntax: "*";
5632
5518
  inherits: false;
5519
+ initial-value: solid;
5633
5520
  }
5634
- @property --tw-numeric-spacing {
5521
+ @property --tw-duration {
5635
5522
  syntax: "*";
5636
5523
  inherits: false;
5637
5524
  }
5638
- @property --tw-numeric-fraction {
5525
+ @property --tw-tracking {
5639
5526
  syntax: "*";
5640
5527
  inherits: false;
5641
5528
  }
@@ -5704,29 +5591,23 @@
5704
5591
  inherits: false;
5705
5592
  initial-value: 0 0 #0000;
5706
5593
  }
5707
- @property --tw-outline-style {
5708
- syntax: "*";
5709
- inherits: false;
5710
- initial-value: solid;
5711
- }
5712
- @property --tw-leading {
5594
+ @property --tw-ordinal {
5713
5595
  syntax: "*";
5714
5596
  inherits: false;
5715
5597
  }
5716
- @property --tw-font-weight {
5598
+ @property --tw-slashed-zero {
5717
5599
  syntax: "*";
5718
5600
  inherits: false;
5719
5601
  }
5720
- @property --tw-border-style {
5602
+ @property --tw-numeric-figure {
5721
5603
  syntax: "*";
5722
5604
  inherits: false;
5723
- initial-value: solid;
5724
5605
  }
5725
- @property --tw-duration {
5606
+ @property --tw-numeric-spacing {
5726
5607
  syntax: "*";
5727
5608
  inherits: false;
5728
5609
  }
5729
- @property --tw-tracking {
5610
+ @property --tw-numeric-fraction {
5730
5611
  syntax: "*";
5731
5612
  inherits: false;
5732
5613
  }
@@ -5748,16 +5629,12 @@
5748
5629
  @layer properties {
5749
5630
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
5750
5631
  *, ::before, ::after, ::backdrop {
5751
- --tw-rotate-x: initial;
5752
- --tw-rotate-y: initial;
5753
- --tw-rotate-z: initial;
5754
- --tw-skew-x: initial;
5755
- --tw-skew-y: initial;
5756
- --tw-ordinal: initial;
5757
- --tw-slashed-zero: initial;
5758
- --tw-numeric-figure: initial;
5759
- --tw-numeric-spacing: initial;
5760
- --tw-numeric-fraction: initial;
5632
+ --tw-leading: initial;
5633
+ --tw-font-weight: initial;
5634
+ --tw-border-style: solid;
5635
+ --tw-outline-style: solid;
5636
+ --tw-duration: initial;
5637
+ --tw-tracking: initial;
5761
5638
  --tw-shadow: 0 0 #0000;
5762
5639
  --tw-shadow-color: initial;
5763
5640
  --tw-shadow-alpha: 100%;
@@ -5772,12 +5649,11 @@
5772
5649
  --tw-ring-offset-width: 0px;
5773
5650
  --tw-ring-offset-color: #fff;
5774
5651
  --tw-ring-offset-shadow: 0 0 #0000;
5775
- --tw-outline-style: solid;
5776
- --tw-leading: initial;
5777
- --tw-font-weight: initial;
5778
- --tw-border-style: solid;
5779
- --tw-duration: initial;
5780
- --tw-tracking: initial;
5652
+ --tw-ordinal: initial;
5653
+ --tw-slashed-zero: initial;
5654
+ --tw-numeric-figure: initial;
5655
+ --tw-numeric-spacing: initial;
5656
+ --tw-numeric-fraction: initial;
5781
5657
  --tw-translate-x: 0;
5782
5658
  --tw-translate-y: 0;
5783
5659
  --tw-translate-z: 0;