@payloadcms/ui 3.50.0-canary.6 → 3.50.0-canary.8

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.
@@ -17,7 +17,8 @@
17
17
  --main-gutter-h-right: var(--gutter-h);
18
18
  }
19
19
 
20
- &--force-sidebar-wrap {
20
+ &--force-sidebar-wrap,
21
+ &:has(.document-fields__sidebar-wrap .document-fields__sidebar-fields > .render-fields:empty) {
21
22
  --sidebar-gutter-h-left: var(--gutter-h);
22
23
  --sidebar-gutter-h-right: var(--gutter-h);
23
24
  --main-gutter-h-left: var(--gutter-h);
@@ -25,9 +26,21 @@
25
26
  }
26
27
 
27
28
  &--has-sidebar {
29
+ --main-width: 66.66%;
30
+ --main-border: 1px solid var(--theme-elevation-100);
31
+ --main-field-margin: calc(var(--base) * -2);
32
+
33
+ &:has(
34
+ .document-fields__sidebar-wrap .document-fields__sidebar-fields > .render-fields:empty
35
+ ) {
36
+ --main-width: 100%;
37
+ --main-border: none;
38
+ --main-field-margin: initial;
39
+ }
40
+
28
41
  .document-fields {
29
42
  &__main {
30
- width: 66.66%;
43
+ width: var(--main-width);
31
44
  }
32
45
 
33
46
  &__edit {
@@ -36,20 +49,20 @@
36
49
  [dir='ltr'] & {
37
50
  top: 0;
38
51
  right: 0;
39
- border-right: 1px solid var(--theme-elevation-100);
52
+ border-right: var(--main-border);
40
53
  }
41
54
 
42
55
  [dir='rtl'] & {
43
56
  top: 0;
44
57
  left: 0;
45
- border-left: 1px solid var(--theme-elevation-100);
58
+ border-left: var(--main-border);
46
59
  }
47
60
  }
48
61
 
49
62
  &__fields {
50
63
  & > .tabs-field,
51
64
  & > .group-field {
52
- margin-right: calc(var(--base) * -2);
65
+ margin-right: var(--main-field-margin);
53
66
  }
54
67
  }
55
68
  }
@@ -70,12 +83,21 @@
70
83
  }
71
84
 
72
85
  &__sidebar-wrap {
73
- position: sticky;
74
- top: var(--doc-controls-height);
75
- width: 33.33%;
76
- height: calc(100vh - var(--doc-controls-height));
77
- min-width: var(--doc-sidebar-width);
78
- flex-shrink: 0;
86
+ &:has(.document-fields__sidebar-fields > .render-fields:empty) {
87
+ --sidebar-wrap-width: 0;
88
+ --sidebar-wrap-min-width: 0;
89
+ --sidebar-wrap-position: initial;
90
+ --sidebar-wrap-top: initial;
91
+ --sidebar-wrap-height: initial;
92
+ --sidebar-wrap-flex-shrink: initial;
93
+ }
94
+
95
+ position: var(--sidebar-wrap-position, sticky);
96
+ top: var(--sidebar-wrap-top, 0);
97
+ width: var(--sidebar-wrap-width, 33.33%);
98
+ height: var(--sidebar-wrap-height, calc(100vh - var(--doc-controls-height)));
99
+ min-width: var(--sidebar-wrap-min-width, var(--doc-sidebar-width));
100
+ flex-shrink: var(--sidebar-wrap-flex-shrink, 0);
79
101
  }
80
102
 
81
103
  &__sidebar {