@payloadcms/next 3.0.0-beta.73 → 3.0.0-beta.75

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.
Files changed (98) hide show
  1. package/dist/cjs/withPayload.cjs +18 -11
  2. package/dist/cjs/withPayload.cjs.map +1 -1
  3. package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +7 -5
  4. package/dist/elements/EmailAndUsername/index.d.ts +14 -0
  5. package/dist/elements/EmailAndUsername/index.d.ts.map +1 -0
  6. package/dist/elements/EmailAndUsername/index.js +85 -0
  7. package/dist/elements/EmailAndUsername/index.js.map +1 -0
  8. package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
  9. package/dist/elements/LeaveWithoutSaving/index.js +2 -0
  10. package/dist/elements/LeaveWithoutSaving/index.js.map +1 -1
  11. package/dist/elements/Nav/index.client.d.ts.map +1 -1
  12. package/dist/elements/Nav/index.client.js +5 -3
  13. package/dist/elements/Nav/index.client.js.map +1 -1
  14. package/dist/elements/Nav/index.scss +0 -7
  15. package/dist/layouts/Root/index.d.ts.map +1 -1
  16. package/dist/layouts/Root/index.js +16 -18
  17. package/dist/layouts/Root/index.js.map +1 -1
  18. package/dist/prod/styles.css +1 -1
  19. package/dist/scss/app.scss +5 -10
  20. package/dist/scss/toastify.scss +59 -0
  21. package/dist/scss/toasts.scss +75 -45
  22. package/dist/scss/type.scss +14 -23
  23. package/dist/scss/vars.scss +26 -47
  24. package/dist/utilities/meta.d.ts.map +1 -1
  25. package/dist/utilities/meta.js +2 -4
  26. package/dist/utilities/meta.js.map +1 -1
  27. package/dist/views/Account/index.js +3 -4
  28. package/dist/views/Account/index.js.map +1 -1
  29. package/dist/views/CreateFirstUser/index.client.d.ts +2 -3
  30. package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
  31. package/dist/views/CreateFirstUser/index.client.js +9 -14
  32. package/dist/views/CreateFirstUser/index.client.js.map +1 -1
  33. package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
  34. package/dist/views/CreateFirstUser/index.js +1 -7
  35. package/dist/views/CreateFirstUser/index.js.map +1 -1
  36. package/dist/views/CreateFirstUser/index.scss +4 -0
  37. package/dist/views/Dashboard/Default/index.scss +11 -7
  38. package/dist/views/Dashboard/index.js +3 -4
  39. package/dist/views/Dashboard/index.js.map +1 -1
  40. package/dist/views/Document/index.d.ts.map +1 -1
  41. package/dist/views/Document/index.js +3 -4
  42. package/dist/views/Document/index.js.map +1 -1
  43. package/dist/views/Edit/Default/Auth/index.d.ts.map +1 -1
  44. package/dist/views/Edit/Default/Auth/index.js +11 -33
  45. package/dist/views/Edit/Default/Auth/index.js.map +1 -1
  46. package/dist/views/Edit/Default/index.d.ts.map +1 -1
  47. package/dist/views/Edit/Default/index.js +4 -1
  48. package/dist/views/Edit/Default/index.js.map +1 -1
  49. package/dist/views/Edit/Default/index.scss +2 -2
  50. package/dist/views/ForgotPassword/index.js +1 -0
  51. package/dist/views/ForgotPassword/index.js.map +1 -1
  52. package/dist/views/List/Default/index.scss +2 -5
  53. package/dist/views/List/index.d.ts.map +1 -1
  54. package/dist/views/List/index.js +20 -7
  55. package/dist/views/List/index.js.map +1 -1
  56. package/dist/views/Login/LoginField/index.d.ts +2 -0
  57. package/dist/views/Login/LoginField/index.d.ts.map +1 -1
  58. package/dist/views/Login/LoginField/index.js +8 -66
  59. package/dist/views/Login/LoginField/index.js.map +1 -1
  60. package/dist/views/Login/LoginForm/index.js +1 -0
  61. package/dist/views/Login/LoginForm/index.js.map +1 -1
  62. package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
  63. package/dist/views/Logout/LogoutClient.js +2 -1
  64. package/dist/views/Logout/LogoutClient.js.map +1 -1
  65. package/dist/views/NotFound/index.client.d.ts.map +1 -1
  66. package/dist/views/NotFound/index.client.js +1 -0
  67. package/dist/views/NotFound/index.client.js.map +1 -1
  68. package/dist/views/NotFound/index.d.ts.map +1 -1
  69. package/dist/views/NotFound/index.js +12 -21
  70. package/dist/views/NotFound/index.js.map +1 -1
  71. package/dist/views/ResetPassword/index.client.js +1 -0
  72. package/dist/views/ResetPassword/index.client.js.map +1 -1
  73. package/dist/views/Unauthorized/index.d.ts.map +1 -1
  74. package/dist/views/Unauthorized/index.js +1 -0
  75. package/dist/views/Unauthorized/index.js.map +1 -1
  76. package/dist/views/Version/Default/index.js +1 -1
  77. package/dist/views/Version/Default/index.js.map +1 -1
  78. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
  79. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +41 -21
  80. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
  81. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +2 -2
  82. package/dist/views/Version/RenderFieldsToDiff/fields/index.js +3 -2
  83. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
  84. package/dist/views/Version/index.d.ts +1 -1
  85. package/dist/views/Version/index.d.ts.map +1 -1
  86. package/dist/views/Version/index.js +32 -5
  87. package/dist/views/Version/index.js.map +1 -1
  88. package/dist/views/Versions/getLatestVersion.d.ts +13 -4
  89. package/dist/views/Versions/getLatestVersion.d.ts.map +1 -1
  90. package/dist/views/Versions/getLatestVersion.js +6 -1
  91. package/dist/views/Versions/getLatestVersion.js.map +1 -1
  92. package/dist/views/Versions/index.d.ts.map +1 -1
  93. package/dist/views/Versions/index.js +24 -4
  94. package/dist/views/Versions/index.js.map +1 -1
  95. package/dist/withPayload.d.ts.map +1 -1
  96. package/dist/withPayload.js +18 -11
  97. package/dist/withPayload.js.map +1 -1
  98. package/package.json +7 -7
@@ -1,9 +1,9 @@
1
- @import './styles.scss';
1
+ @import 'styles';
2
2
  @import './toasts.scss';
3
3
  @import './colors.scss';
4
4
 
5
5
  :root {
6
- --base-px: 25;
6
+ --base-px: 20;
7
7
  --base-body-size: 13;
8
8
  --base: calc((var(--base-px) / var(--base-body-size)) * 1rem);
9
9
 
@@ -21,6 +21,7 @@
21
21
  --theme-baseline-body-size: #{$baseline-body-size};
22
22
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
23
23
  sans-serif;
24
+ --font-serif: Georgia, 'Bitstream Charter', 'Charis SIL', Utopia, 'URW Bookman L', serif;
24
25
  --font-mono: monospace;
25
26
 
26
27
  --style-radius-s: #{$style-radius-s};
@@ -67,12 +68,6 @@ html {
67
68
  @extend %body;
68
69
  background: var(--theme-bg);
69
70
  -webkit-font-smoothing: antialiased;
70
- opacity: 0;
71
-
72
- &[data-theme='dark'],
73
- &[data-theme='light'] {
74
- opacity: initial;
75
- }
76
71
 
77
72
  &[data-theme='dark'] {
78
73
  --theme-bg: var(--theme-elevation-0);
@@ -111,12 +106,12 @@ body {
111
106
  }
112
107
 
113
108
  ::selection {
114
- background: var(--theme-success-500);
109
+ background: var(--color-success-250);
115
110
  color: var(--theme-base-800);
116
111
  }
117
112
 
118
113
  ::-moz-selection {
119
- background: var(--theme-success-500);
114
+ background: var(--color-success-250);
120
115
  color: var(--theme-base-800);
121
116
  }
122
117
 
@@ -0,0 +1,59 @@
1
+ @import 'vars';
2
+ @import 'queries';
3
+
4
+ .Toastify {
5
+ .Toastify__toast-container {
6
+ left: base(5);
7
+ transform: none;
8
+ right: base(5);
9
+ width: auto;
10
+ }
11
+
12
+ .Toastify__toast {
13
+ padding: base(0.5);
14
+ border-radius: $style-radius-m;
15
+ font-weight: 600;
16
+ }
17
+
18
+ .Toastify__close-button {
19
+ align-self: center;
20
+ opacity: 0.7;
21
+
22
+ &:hover {
23
+ opacity: 1;
24
+ }
25
+ }
26
+
27
+ .Toastify__toast--success {
28
+ color: var(--color-success-900);
29
+ background: var(--color-success-500);
30
+
31
+ .Toastify__progress-bar {
32
+ background-color: var(--color-success-900);
33
+ }
34
+ }
35
+
36
+ .Toastify__close-button--success {
37
+ color: var(--color-success-900);
38
+ }
39
+
40
+ .Toastify__toast--error {
41
+ background: var(--theme-error-500);
42
+ color: #fff;
43
+
44
+ .Toastify__progress-bar {
45
+ background-color: #fff;
46
+ }
47
+ }
48
+
49
+ .Toastify__close-button--light {
50
+ color: inherit;
51
+ }
52
+
53
+ @include mid-break {
54
+ .Toastify__toast-container {
55
+ left: $baseline;
56
+ right: $baseline;
57
+ }
58
+ }
59
+ }
@@ -1,24 +1,28 @@
1
+ @import './styles.scss';
2
+
1
3
  .payload-toast-container {
4
+ padding: 0;
5
+ margin: 0;
6
+
2
7
  .payload-toast-close-button {
8
+ position: absolute;
9
+ order: 3;
3
10
  left: unset;
4
- right: 0.5rem;
5
- top: 1.55rem;
6
- color: var(--theme-elevation-400);
11
+ inset-inline-end: base(0.5);
12
+ top: 50%;
13
+ transform: translateY(-50%);
14
+ color: var(--theme-elevation-600);
7
15
  background: unset;
8
16
  border: none;
9
- display: flex;
10
- width: 1.25rem;
11
- height: 1.25rem;
12
- justify-content: center;
13
- align-items: center;
14
17
 
15
- &:hover {
16
- background: none;
18
+ svg {
19
+ width: base(0.75);
20
+ height: base(0.75);
17
21
  }
18
22
 
19
- svg {
20
- width: 2rem;
21
- height: 2rem;
23
+ &:hover {
24
+ color: var(--theme-elevation-250);
25
+ background: none;
22
26
  }
23
27
 
24
28
  [dir='RTL'] & {
@@ -27,16 +31,20 @@
27
31
  }
28
32
  }
29
33
 
34
+ .toast-title {
35
+ line-height: base(1);
36
+ }
37
+
30
38
  .payload-toast-item {
31
- padding: 1rem 2.5rem 1rem 1rem;
32
- color: var(--theme-text);
39
+ padding: base(0.5);
40
+ color: var(--theme-elevation-800);
33
41
  font-style: normal;
34
42
  font-weight: 600;
35
43
  display: flex;
36
44
  gap: 1rem;
37
45
  align-items: center;
38
46
  width: 100%;
39
- border-radius: 0.15rem;
47
+ border-radius: 4px;
40
48
  border: 1px solid var(--theme-border-color);
41
49
  background: var(--theme-input-bg);
42
50
  box-shadow:
@@ -45,6 +53,7 @@
45
53
 
46
54
  .toast-content {
47
55
  transition: opacity 100ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
56
+ width: 100%;
48
57
  }
49
58
 
50
59
  &[data-front='false'] {
@@ -60,51 +69,72 @@
60
69
  }
61
70
 
62
71
  .toast-icon {
63
- svg {
64
- width: 2.4rem;
65
- height: 2.4rem;
72
+ width: base(1);
73
+ height: base(1);
74
+ margin: 0;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+
79
+ & > * {
80
+ width: base(1.2);
81
+ height: base(1.2);
66
82
  }
67
83
  }
68
84
 
69
85
  &.toast-warning {
70
- border-color: var(--theme-warning-200);
71
- background-color: var(--theme-warning-100);
86
+ color: var(--theme-warning-800);
87
+ border-color: var(--theme-warning-150);
88
+ background-color: var(--theme-warning-50);
89
+
90
+ .payload-toast-close-button {
91
+ color: var(--theme-warning-600);
92
+
93
+ &:hover {
94
+ color: var(--theme-warning-250);
95
+ }
96
+ }
72
97
  }
73
98
 
74
99
  &.toast-error {
75
- border-color: var(--theme-error-300);
76
- background-color: var(--theme-error-150);
100
+ color: var(--theme-error-800);
101
+ border-color: var(--theme-error-150);
102
+ background-color: var(--theme-error-50);
103
+
104
+ .payload-toast-close-button {
105
+ color: var(--theme-error-600);
106
+
107
+ &:hover {
108
+ color: var(--theme-error-250);
109
+ }
110
+ }
77
111
  }
78
112
 
79
113
  &.toast-success {
80
- border-color: var(--theme-success-200);
81
- background-color: var(--theme-success-100);
82
- }
114
+ color: var(--theme-success-800);
115
+ border-color: var(--theme-success-150);
116
+ background-color: var(--theme-success-50);
83
117
 
84
- &.toast-info {
85
- border-color: var(--theme-elevation-250);
86
- background-color: var(--theme-elevation-100);
87
- }
118
+ .payload-toast-close-button {
119
+ color: var(--theme-success-600);
88
120
 
89
- [data-theme='light'] & {
90
- &.toast-warning {
91
- border-color: var(--theme-warning-550);
92
- background-color: var(--theme-warning-100);
121
+ &:hover {
122
+ color: var(--theme-success-250);
123
+ }
93
124
  }
125
+ }
94
126
 
95
- &.toast-error {
96
- border-color: var(--theme-error-200);
97
- background-color: var(--theme-error-50);
98
- }
127
+ &.toast-info {
128
+ color: var(--theme-elevation-800);
129
+ border-color: var(--theme-elevation-150);
130
+ background-color: var(--theme-elevation-50);
99
131
 
100
- &.toast-success {
101
- border-color: var(--theme-success-550);
102
- background-color: var(--theme-success-50);
103
- }
132
+ .payload-toast-close-button {
133
+ color: var(--theme-elevation-600);
104
134
 
105
- &.toast-info {
106
- border-color: var(--theme-border-color);
107
- background-color: var(--theme-elevation-50);
135
+ &:hover {
136
+ color: var(--theme-elevation-250);
137
+ }
108
138
  }
109
139
  }
110
140
  }
@@ -15,17 +15,10 @@
15
15
  font-weight: 500;
16
16
  }
17
17
 
18
- %jumbo {
19
- font-size: base(2.5);
20
- line-height: 1;
21
- margin: 0 0 base(2);
22
- }
23
-
24
18
  %h1 {
25
19
  margin: 0 0 base(1);
26
- font-size: base(2);
27
- line-height: 1.15;
28
- letter-spacing: -1px;
20
+ font-size: base(1.6);
21
+ line-height: base(1.8);
29
22
 
30
23
  @include small-break {
31
24
  letter-spacing: -0.5px;
@@ -35,9 +28,8 @@
35
28
 
36
29
  %h2 {
37
30
  margin: 0 0 base(1);
38
- font-size: base(1.25);
39
- line-height: 1.15;
40
- letter-spacing: -0.5px;
31
+ font-size: base(1.3);
32
+ line-height: base(1.6);
41
33
 
42
34
  @include small-break {
43
35
  font-size: base(0.85);
@@ -46,9 +38,8 @@
46
38
 
47
39
  %h3 {
48
40
  margin: 0 0 base(1);
49
- font-size: base(0.925);
50
- line-height: 1.25;
51
- letter-spacing: -0.5px;
41
+ font-size: base(1);
42
+ line-height: base(1.2);
52
43
 
53
44
  @include small-break {
54
45
  font-size: base(0.65);
@@ -58,27 +49,27 @@
58
49
 
59
50
  %h4 {
60
51
  margin: 0 0 $baseline;
61
- font-size: base(0.75);
62
- line-height: 1.5;
52
+ font-size: base(0.8);
53
+ line-height: base(1);
63
54
  letter-spacing: -0.375px;
64
55
  }
65
56
 
66
57
  %h5 {
67
58
  margin: 0;
68
- font-size: base(0.5625);
69
- line-height: 1.5;
59
+ font-size: base(0.65);
60
+ line-height: base(0.8);
70
61
  }
71
62
 
72
63
  %h6 {
73
64
  margin: 0;
74
- font-size: base(0.5);
75
- line-height: 1.5;
65
+ font-size: base(0.6);
66
+ line-height: base(0.8);
76
67
  }
77
68
 
78
69
  %small {
79
70
  margin: 0;
80
- font-size: 11px;
81
- line-height: 1.5;
71
+ font-size: 12px;
72
+ line-height: 20px;
82
73
  }
83
74
 
84
75
  /////////////////////////////
@@ -13,7 +13,7 @@ $breakpoint-l-width: 1440px !default;
13
13
  // BASELINE GRID
14
14
  //////////////////////////////
15
15
 
16
- $baseline-px: 25px !default;
16
+ $baseline-px: 20px !default;
17
17
  $baseline-body-size: 13px !default;
18
18
  $baseline: math.div($baseline-px, $baseline-body-size) + rem;
19
19
 
@@ -40,7 +40,7 @@ $color-purple: #f3ddf3 !default;
40
40
 
41
41
  $style-radius-s: 3px !default;
42
42
  $style-radius-m: 4px !default;
43
- $style-radius-l: 9px !default;
43
+ $style-radius-l: 8px !default;
44
44
  $style-stroke-width: 1px !default;
45
45
 
46
46
  $style-stroke-width-s: 1px !default;
@@ -50,8 +50,8 @@ $style-stroke-width-m: 2px !default;
50
50
  // MISC
51
51
  //////////////////////////////
52
52
 
53
- $top-header-offset: calc(var(--base) - 1px);
54
- $top-header-offset-m: calc(var(--base) * 3);
53
+ $top-header-offset: calc(base(1) - 1px);
54
+ $top-header-offset-m: base(3);
55
55
  $focus-box-shadow: 0 0 0 $style-stroke-width-m var(--theme-success-500);
56
56
 
57
57
  //////////////////////////////
@@ -59,41 +59,19 @@ $focus-box-shadow: 0 0 0 $style-stroke-width-m var(--theme-success-500);
59
59
  //////////////////////////////
60
60
 
61
61
  @mixin shadow-sm {
62
- box-shadow:
63
- 0 2px 3px 0 rgba(0, 2, 4, 0.05),
64
- 0 10px 4px -8px rgba(0, 2, 4, 0.02);
62
+ box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
65
63
  }
66
64
 
67
65
  @mixin shadow-m {
68
- box-shadow:
69
- 0 0 30px 0 rgb(0 2 4 / 12%),
70
- 0 30px 25px -8px rgb(0 2 4 / 10%);
66
+ box-shadow: 0 4px 8px -3px rgba(0, 0, 0, 0.1);
71
67
  }
72
68
 
73
69
  @mixin shadow-lg {
74
- box-shadow:
75
- 0 20px 35px -10px rgba(0, 2, 4, 0.2),
76
- 0 6px 4px -4px rgba(0, 2, 4, 0.02);
70
+ box-shadow: 0 -2px 16px -2px rgba(0, 0, 0, 0.2);
77
71
  }
78
72
 
79
73
  @mixin shadow-lg-top {
80
- box-shadow:
81
- 0 -20px 35px -10px rgba(0, 2, 4, 0.2),
82
- 0 -6px 4px -4px rgba(0, 2, 4, 0.02);
83
- }
84
-
85
- @mixin shadow {
86
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
87
-
88
- &:hover {
89
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
90
- }
91
- }
92
-
93
- @mixin inputShadowActive {
94
- box-shadow:
95
- 0 2px 3px 0 rgba(0, 2, 4, 0.16),
96
- 0 6px 4px -4px rgba(0, 2, 4, 0.13);
74
+ box-shadow: 0 2px 16px -2px rgba(0, 0, 0, 0.2);
97
75
  }
98
76
 
99
77
  @mixin inputShadow {
@@ -101,15 +79,7 @@ $focus-box-shadow: 0 0 0 $style-stroke-width-m var(--theme-success-500);
101
79
 
102
80
  &:not(:disabled) {
103
81
  &:hover {
104
- box-shadow:
105
- 0 2px 3px 0 rgba(0, 2, 4, 0.13),
106
- 0 6px 4px -4px rgba(0, 2, 4, 0.1);
107
- }
108
-
109
- &:active,
110
- &:focus-within,
111
- &:focus {
112
- @include inputShadowActive;
82
+ box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.2);
113
83
  }
114
84
  }
115
85
  }
@@ -147,19 +117,33 @@ $focus-box-shadow: 0 0 0 $style-stroke-width-m var(--theme-success-500);
147
117
  @include blur-bg(var(--theme-bg), 0.3);
148
118
  }
149
119
 
120
+ @mixin readOnly {
121
+ background: var(--theme-elevation-100);
122
+ color: var(--theme-elevation-400);
123
+ box-shadow: none;
124
+
125
+ &:hover {
126
+ border-color: var(--theme-elevation-150);
127
+ box-shadow: none;
128
+ }
129
+ }
130
+
150
131
  @mixin formInput() {
151
132
  @include inputShadow;
152
133
  font-family: var(--font-body);
153
134
  width: 100%;
154
135
  border: 1px solid var(--theme-elevation-150);
136
+ border-radius: var(--style-radius-s);
155
137
  background: var(--theme-input-bg);
156
138
  color: var(--theme-elevation-800);
157
- border-radius: 0;
158
139
  font-size: 1rem;
159
140
  height: base(2);
160
141
  line-height: base(1);
161
- padding: base(0.5) base(0.75);
142
+ padding: base(0.4) base(0.75);
162
143
  -webkit-appearance: none;
144
+ transition-property: border, box-shadow;
145
+ transition-duration: 100ms;
146
+ transition-timing-function: cubic-bezier(0, 0.2, 0.2, 1);
163
147
 
164
148
  &[data-rtl='true'] {
165
149
  direction: rtl;
@@ -189,12 +173,7 @@ $focus-box-shadow: 0 0 0 $style-stroke-width-m var(--theme-success-500);
189
173
  }
190
174
 
191
175
  &:disabled {
192
- background: var(--theme-elevation-200);
193
- color: var(--theme-elevation-450);
194
-
195
- &:hover {
196
- border-color: var(--theme-elevation-150);
197
- }
176
+ @include readOnly;
198
177
  }
199
178
  }
200
179
 
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/utilities/meta.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAYzC,eAAO,MAAM,IAAI,SAAgB;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,KAAG,OAAO,CAAC,GAAG,CAwFhF,CAAA"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/utilities/meta.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,SAAS,CAAA;AAYrD,eAAO,MAAM,IAAI,SAAgB;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,KAAG,OAAO,CAAC,GAAG,CAwFhF,CAAA"}
@@ -22,11 +22,9 @@ export const meta = async (args)=>{
22
22
  url: typeof payloadFaviconLight === 'object' ? payloadFaviconLight?.src : payloadFaviconLight
23
23
  }
24
24
  ];
25
- let icons = customIcons ?? payloadIcons // TODO: fix this type assertion
26
- ;
25
+ let icons = payloadIcons;
27
26
  if (customIcons && typeof customIcons === 'object' && Array.isArray(customIcons)) {
28
- icons = payloadIcons.concat(customIcons) // TODO: fix this type assertion
29
- ;
27
+ icons = customIcons;
30
28
  }
31
29
  const metaTitle = `${title} ${titleSuffix}`;
32
30
  const ogTitle = `${typeof openGraphFromProps?.title === 'string' ? openGraphFromProps.title : title} ${titleSuffix}`;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/meta.ts"],"sourcesContent":["import type { Metadata } from 'next'\nimport type { Icon } from 'next/dist/lib/metadata/types/metadata-types.js'\nimport type { MetaConfig } from 'payload'\n\nimport { payloadFaviconDark, payloadFaviconLight, staticOGImage } from '@payloadcms/ui/assets'\nimport * as qs from 'qs-esm'\n\nconst defaultOpenGraph = {\n description:\n 'Payload is a headless CMS and application framework built with TypeScript, Node.js, and React.',\n siteName: 'Payload App',\n title: 'Payload App',\n}\n\nexport const meta = async (args: { serverURL: string } & MetaConfig): Promise<any> => {\n const {\n defaultOGImageType,\n description,\n icons: customIcons,\n keywords,\n openGraph: openGraphFromProps,\n serverURL,\n title,\n titleSuffix,\n } = args\n\n const payloadIcons: Icon[] = [\n {\n type: 'image/png',\n rel: 'icon',\n sizes: '32x32',\n url: typeof payloadFaviconDark === 'object' ? payloadFaviconDark?.src : payloadFaviconDark,\n },\n {\n type: 'image/png',\n media: '(prefers-color-scheme: dark)',\n rel: 'icon',\n sizes: '32x32',\n url: typeof payloadFaviconLight === 'object' ? payloadFaviconLight?.src : payloadFaviconLight,\n },\n ]\n\n let icons = customIcons ?? payloadIcons // TODO: fix this type assertion\n\n if (customIcons && typeof customIcons === 'object' && Array.isArray(customIcons)) {\n icons = payloadIcons.concat(customIcons) // TODO: fix this type assertion\n }\n\n const metaTitle = `${title} ${titleSuffix}`\n\n const ogTitle = `${typeof openGraphFromProps?.title === 'string' ? openGraphFromProps.title : title} ${titleSuffix}`\n\n const mergedOpenGraph: Metadata['openGraph'] = {\n ...(defaultOpenGraph || {}),\n ...(defaultOGImageType === 'dynamic'\n ? {\n images: [\n {\n alt: ogTitle,\n height: 630,\n url: `/api/og${qs.stringify(\n {\n description: openGraphFromProps?.description || defaultOpenGraph.description,\n title: ogTitle,\n },\n {\n addQueryPrefix: true,\n },\n )}`,\n width: 1200,\n },\n ],\n }\n : {}),\n ...(defaultOGImageType === 'static'\n ? {\n images: [\n {\n alt: ogTitle,\n height: 480,\n url: typeof staticOGImage === 'object' ? staticOGImage?.src : staticOGImage,\n width: 640,\n },\n ],\n }\n : {}),\n title: ogTitle,\n ...(openGraphFromProps || {}),\n }\n\n return Promise.resolve({\n description,\n icons,\n keywords,\n metadataBase: new URL(\n serverURL ||\n process.env.PAYLOAD_PUBLIC_SERVER_URL ||\n `http://localhost:${process.env.PORT || 3000}`,\n ),\n openGraph: mergedOpenGraph,\n title: metaTitle,\n })\n}\n"],"names":["payloadFaviconDark","payloadFaviconLight","staticOGImage","qs","defaultOpenGraph","description","siteName","title","meta","args","defaultOGImageType","icons","customIcons","keywords","openGraph","openGraphFromProps","serverURL","titleSuffix","payloadIcons","type","rel","sizes","url","src","media","Array","isArray","concat","metaTitle","ogTitle","mergedOpenGraph","images","alt","height","stringify","addQueryPrefix","width","Promise","resolve","metadataBase","URL","process","env","PAYLOAD_PUBLIC_SERVER_URL","PORT"],"mappings":"AAIA,SAASA,kBAAkB,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,wBAAuB;AAC9F,YAAYC,QAAQ,SAAQ;AAE5B,MAAMC,mBAAmB;IACvBC,aACE;IACFC,UAAU;IACVC,OAAO;AACT;AAEA,OAAO,MAAMC,O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MrB;oBAC9DkC,OAAO;gBACT;aACD;QACH,IACA,CAAC,CAAC;QACN7B,OAAOsB;QACP,GAAId,sBAAsB,CAAC,CAAC;IAC9B;IAEA,OAAOsB,QAAQC,OAAO,CAAC;QACrBjC;QACAM;QACAE;QACA0B,cAAc,IAAIC,IAChBxB,aACEyB,QAAQC,GAAG,CAACC,yBAAyB,IACrC,CAAC,iBAAiB,EAAEF,QAAQC,GAAG,CAACE,IAAI,IAAI,KAAK,CAAC;QAElD9B,WAAWgB;QACXvB,OAAOqB;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/meta.ts"],"sourcesContent":["import type { Metadata } from 'next'\nimport type { IconConfig, MetaConfig } from 'payload'\n\nimport { payloadFaviconDark, payloadFaviconLight, staticOGImage } from '@payloadcms/ui/assets'\nimport * as qs from 'qs-esm'\n\nconst defaultOpenGraph = {\n description:\n 'Payload is a headless CMS and application framework built with TypeScript, Node.js, and React.',\n siteName: 'Payload App',\n title: 'Payload App',\n}\n\nexport const meta = async (args: { serverURL: string } & MetaConfig): Promise<any> => {\n const {\n defaultOGImageType,\n description,\n icons: customIcons,\n keywords,\n openGraph: openGraphFromProps,\n serverURL,\n title,\n titleSuffix,\n } = args\n\n const payloadIcons: IconConfig[] = [\n {\n type: 'image/png',\n rel: 'icon',\n sizes: '32x32',\n url: typeof payloadFaviconDark === 'object' ? payloadFaviconDark?.src : payloadFaviconDark,\n },\n {\n type: 'image/png',\n media: '(prefers-color-scheme: dark)',\n rel: 'icon',\n sizes: '32x32',\n url: typeof payloadFaviconLight === 'object' ? payloadFaviconLight?.src : payloadFaviconLight,\n },\n ]\n\n let icons = payloadIcons\n\n if (customIcons && typeof customIcons === 'object' && Array.isArray(customIcons)) {\n icons = customIcons\n }\n\n const metaTitle = `${title} ${titleSuffix}`\n\n const ogTitle = `${typeof openGraphFromProps?.title === 'string' ? openGraphFromProps.title : title} ${titleSuffix}`\n\n const mergedOpenGraph: Metadata['openGraph'] = {\n ...(defaultOpenGraph || {}),\n ...(defaultOGImageType === 'dynamic'\n ? {\n images: [\n {\n alt: ogTitle,\n height: 630,\n url: `/api/og${qs.stringify(\n {\n description: openGraphFromProps?.description || defaultOpenGraph.description,\n title: ogTitle,\n },\n {\n addQueryPrefix: true,\n },\n )}`,\n width: 1200,\n },\n ],\n }\n : {}),\n ...(defaultOGImageType === 'static'\n ? {\n images: [\n {\n alt: ogTitle,\n height: 480,\n url: typeof staticOGImage === 'object' ? staticOGImage?.src : staticOGImage,\n width: 640,\n },\n ],\n }\n : {}),\n title: ogTitle,\n ...(openGraphFromProps || {}),\n }\n\n return Promise.resolve({\n description,\n icons,\n keywords,\n metadataBase: new URL(\n serverURL ||\n process.env.PAYLOAD_PUBLIC_SERVER_URL ||\n `http://localhost:${process.env.PORT || 3000}`,\n ),\n openGraph: mergedOpenGraph,\n title: metaTitle,\n })\n}\n"],"names":["payloadFaviconDark","payloadFaviconLight","staticOGImage","qs","defaultOpenGraph","description","siteName","title","meta","args","defaultOGImageType","icons","customIcons","keywords","openGraph","openGraphFromProps","serverURL","titleSuffix","payloadIcons","type","rel","sizes","url","src","media","Array","isArray","metaTitle","ogTitle","mergedOpenGraph","images","alt","height","stringify","addQueryPrefix","width","Promise","resolve","metadataBase","URL","process","env","PAYLOAD_PUBLIC_SERVER_URL","PORT"],"mappings":"AAGA,SAASA,kBAAkB,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,wBAAuB;AAC9F,YAAYC,QAAQ,SAAQ;AAE5B,MAAMC,mBAAmB;IACvBC,aACE;IACFC,UAAU;IACVC,OAAO;AACT;AAEA,OAAO,MAAMC,OAAO,OAAOC;IACzB,MAAM,EACJC,kBAAkB,EAClBL,WAAW,EACXM,OAAOC,WAAW,EAClBC,QAAQ,EACRC,WAAWC,kBAAkB,EAC7BC,SAAS,EACTT,KAAK,EACLU,WAAW,EACZ,GAAGR;IAEJ,MAAMS,eAA6B;QACjC;YACEC,MAAM;YACNC,KAAK;YACLC,OAAO;YACPC,KA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,CAAC;QAElD7B,WAAWe;QACXtB,OAAOoB;IACT;AACF,EAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { DocumentInfoProvider, HydrateClientUser } from '@payloadcms/ui';
2
+ import { DocumentInfoProvider, HydrateAuthProvider } from '@payloadcms/ui';
3
3
  import { RenderCustomComponent } from '@payloadcms/ui/shared';
4
4
  import { notFound } from 'next/navigation.js';
5
5
  import React from 'react';
@@ -54,9 +54,8 @@ export const Account = async ({ initPageResult, params, searchParams })=>{
54
54
  i18n: i18n,
55
55
  permissions: permissions
56
56
  }),
57
- /*#__PURE__*/ _jsx(HydrateClientUser, {
58
- permissions: permissions,
59
- user: user
57
+ /*#__PURE__*/ _jsx(HydrateAuthProvider, {
58
+ permissions: permissions
60
59
  }),
61
60
  /*#__PURE__*/ _jsx(RenderCustomComponent, {
62
61
  CustomComponent: typeof CustomAccountComponent === 'function' ? CustomAccountComponent : undefined,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/views/Account/index.tsx"],"sourcesContent":["import type { AdminViewProps, ServerSideEditViewProps } from 'payload'\n\nimport { DocumentInfoProvider, HydrateClientUser } from '@payloadcms/ui'\nimport { RenderCustomComponent } from '@payloadcms/ui/shared'\nimport { notFound } from 'next/navigation.js'\nimport React from 'react'\n\nimport { DocumentHeader } from '../../elements/DocumentHeader/index.js'\nimport { getDocumentData } from '../Document/getDocumentData.js'\nimport { getDocumentPermissions } from '../Document/getDocumentPermissions.js'\nimport { EditView } from '../Edit/index.js'\nimport { Settings } from './Settings/index.js'\n\nexport { generateAccountMetadata } from './meta.js'\n\nexport const Account: React.FC<AdminViewProps> = async ({\n initPageResult,\n params,\n searchParams,\n}) => {\n const {\n languageOptions,\n locale,\n permissions,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n user,\n },\n } = initPageResult\n\n const {\n admin: { components: { views: { Account: CustomAccountComponent } = {} } = {}, user: userSlug },\n routes: { api },\n serverURL,\n } = config\n\n const collectionConfig = config.collections.find((collection) => collection.slug === userSlug)\n\n if (collectionConfig && user?.id) {\n const { docPermissions, hasPublishPermission, hasSavePermission } =\n await getDocumentPermissions({\n id: user.id,\n collectionConfig,\n data: user,\n req,\n })\n\n const { data, formState } = await getDocumentData({\n id: user.id,\n collectionConfig,\n locale,\n req,\n })\n\n const viewComponentProps: ServerSideEditViewProps = {\n initPageResult,\n params,\n routeSegments: [],\n searchParams,\n }\n\n return (\n <DocumentInfoProvider\n AfterFields={<Settings i18n={i18n} languageOptions={languageOptions} />}\n apiURL={`${serverURL}${api}/${userSlug}${user?.id ? `/${user.id}` : ''}`}\n collectionSlug={userSlug}\n docPermissions={docPermissions}\n hasPublishPermission={hasPublishPermission}\n hasSavePermission={hasSavePermission}\n id={user?.id.toString()}\n initialData={data}\n initialState={formState}\n isEditing\n >\n <DocumentHeader\n collectionConfig={collectionConfig}\n config={payload.config}\n hideTabs\n i18n={i18n}\n permissions={permissions}\n />\n <HydrateClientUser permissions={permissions} user={user} />\n <RenderCustomComponent\n CustomComponent={\n typeof CustomAccountComponent === 'function' ? CustomAccountComponent : undefined\n }\n DefaultComponent={EditView}\n componentProps={viewComponentProps}\n serverOnlyProps={{\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }}\n />\n </DocumentInfoProvider>\n )\n }\n\n return notFound()\n}\n"],"names":["DocumentInfoProvider","HydrateClientUser","RenderCustomComponent","notFound","React","DocumentHeader","getDocumentData","getDocumentPermissions","EditView","Settings","generateAccountMetadata","Account","initPageResult","params","searchParams","languageOptions","locale","permissions","req","i18n","payload","config","user","admin","components","views","CustomAccountComponent","userSlug","routes","api","serverURL","collectionConfig","collections","find","collection","slug","id","docPermissions","hasPublishPermission","hasSavePermission","data","formState","viewComponentProps","routeSegments","AfterFields","apiURL","collectionSlug","toString","initialData","initialState","isEditing","hideTabs","CustomComponent","undefined","DefaultComponent","componentProps","serverOnlyProps"],"mappings":";AAEA,SAASA,oBAAoB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YACjB7B;QACF;QAEA,qBACE,MAACd;YACC4C,2BAAa,KAACnC;gBAASU,MAAMA;gBAAMJ,iBAAiBA;;YACpD8B,QAAQ,CAAC,EAAEf,UAAU,EAAED,IAAI,CAAC,EAAEF,SAAS,EAAEL,MAAMc,KAAK,CAAC,CAAC,EAAEd,KAAKc,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;YACxEU,gBAAgBnB;YAChBU,gBAAgBA;YAChBC,sBAAsBA;YACtBC,mBAAmBA;YACnBH,IAAId,MAAMc,GAAGW;YACbC,aAAaR;YACbS,cAAcR;YACdS,SAAS;;8BAET,KAAC7C;oBACC0B,kBAAkBA;oBAClBV,QAAQD,QAAQC,MAAM;oBACtB8B,QAAQ;oBACRhC,MAAMA;oBACNF,aAAaA;;8BAEf,KAAChB;oBAAkBgB,aAAaA;oBAAaK,MAAMA;;8BACnD,KAACpB;oBACCkD,iBACE,OAAO1B,2BAA2B,aAAaA,yBAAyB2B;oBAE1EC,kBAAkB9C;oBAClB+C,gBAAgBb;oBAChBc,iBAAiB;wBACfrC;wBACAH;wBACAH;wBACAO;wBACAH;wBACAH;wBACAQ;oBACF;;;;IAIR;IAEA,OAAOnB;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../src/views/Account/index.tsx"],"sourcesContent":["import type { AdminViewProps, ServerSideEditViewProps } from 'payload'\n\nimport { DocumentInfoProvider, HydrateAuthProvider } from '@payloadcms/ui'\nimport { RenderCustomComponent } from '@payloadcms/ui/shared'\nimport { notFound } from 'next/navigation.js'\nimport React from 'react'\n\nimport { DocumentHeader } from '../../elements/DocumentHeader/index.js'\nimport { getDocumentData } from '../Document/getDocumentData.js'\nimport { getDocumentPermissions } from '../Document/getDocumentPermissions.js'\nimport { EditView } from '../Edit/index.js'\nimport { Settings } from './Settings/index.js'\n\nexport { generateAccountMetadata } from './meta.js'\n\nexport const Account: React.FC<AdminViewProps> = async ({\n initPageResult,\n params,\n searchParams,\n}) => {\n const {\n languageOptions,\n locale,\n permissions,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n user,\n },\n } = initPageResult\n\n const {\n admin: { components: { views: { Account: CustomAccountComponent } = {} } = {}, user: userSlug },\n routes: { api },\n serverURL,\n } = config\n\n const collectionConfig = config.collections.find((collection) => collection.slug === userSlug)\n\n if (collectionConfig && user?.id) {\n const { docPermissions, hasPublishPermission, hasSavePermission } =\n await getDocumentPermissions({\n id: user.id,\n collectionConfig,\n data: user,\n req,\n })\n\n const { data, formState } = await getDocumentData({\n id: user.id,\n collectionConfig,\n locale,\n req,\n })\n\n const viewComponentProps: ServerSideEditViewProps = {\n initPageResult,\n params,\n routeSegments: [],\n searchParams,\n }\n\n return (\n <DocumentInfoProvider\n AfterFields={<Settings i18n={i18n} languageOptions={languageOptions} />}\n apiURL={`${serverURL}${api}/${userSlug}${user?.id ? `/${user.id}` : ''}`}\n collectionSlug={userSlug}\n docPermissions={docPermissions}\n hasPublishPermission={hasPublishPermission}\n hasSavePermission={hasSavePermission}\n id={user?.id.toString()}\n initialData={data}\n initialState={formState}\n isEditing\n >\n <DocumentHeader\n collectionConfig={collectionConfig}\n config={payload.config}\n hideTabs\n i18n={i18n}\n permissions={permissions}\n />\n <HydrateAuthProvider permissions={permissions} />\n <RenderCustomComponent\n CustomComponent={\n typeof CustomAccountComponent === 'function' ? CustomAccountComponent : undefined\n }\n DefaultComponent={EditView}\n componentProps={viewComponentProps}\n serverOnlyProps={{\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }}\n />\n </DocumentInfoProvider>\n )\n }\n\n return notFound()\n}\n"],"names":["DocumentInfoProvider","HydrateAuthProvider","RenderCustomComponent","notFound","React","DocumentHeader","getDocumentData","getDocumentPermissions","EditView","Settings","generateAccountMetadata","Account","initPageResult","params","searchParams","languageOptions","locale","permissions","req","i18n","payload","config","user","admin","components","views","CustomAccountComponent","userSlug","routes","api","serverURL","collectionConfig","collections","find","collection","slug","id","docPermissions","hasPublishPermission","hasSavePermission","data","formState","viewComponentProps","routeSegments","AfterFields","apiURL","collectionSlug","toString","initialData","initialState","isEditing","hideTabs","CustomComponent","undefined","DefaultComponent","componentProps","serverOnlyProps"],"mappings":";AAEA,SAASA,oBAAoB,EAAEC,mBAAmB,QAAQ,iBAAgB;AAC1E,SAASC,qBAAqB,QAAQ,wBAAuB;AAC7D,SAASC,QAAQ,QAAQ,qBAAoB;AAC7C,OAAOC,WAAW,QAAO;AAEzB,SAASC,cAAc,QAAQ,yCAAwC;AACvE,SAASC,eAAe,QAAQ,iCAAgC;AAChE,SAASC,sBAAsB,QAAQ,wCAAuC;AAC9E,SAASC,QAAQ,QAAQ,mBAAkB;AAC3C,SAASC,QAAQ,QAAQ,sBAAqB;AAE9C,SAASC,uBAAuB,QAAQ,YAAW;AAEnD,OAAO,MAAMC,UAAoC,OAAO,EACtDC,cAAc,EACdC,MAAM,EACNC,YAAY,EACb;IACC,MAAM,EACJC,eAAe,EACfC,MAAM,EACNC,WAAW,EACXC,GAAG,EACHA,KAAK,EACHC,IAAI,EACJC,OAAO,EACPA,SAAS,EAAEC,MAAM,EAAE,EACnBC,IAAI,EACL,EACF,GAAGV;IAEJ,MAAM,EACJW,OAAO,EAAEC,YAAY,EAAEC,OAAO,EAAEd,SAASe,sBAAsB,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAEJ,MAAMK,QAAQ,EAAE,EAC/FC,QAAQ,EAAEC,GAAG,EAAE,EACfC,SAAS,EACV,GAAGT;IAEJ,MAAMU,mBAAmBV,OAAOW,WAAW,CAACC,IAAI,CAAC,CAACC,aAAeA,WAAWC,IAAI,KAAKR;IAErF,IAAII,oBAAoBT,MAAMc,IAAI;QAChC,MAAM,EAAEC,cAAc,EAAEC,oBAAoB,EAAEC,iBAAiB,EAAE,GAC/D,MAAMhC,uBAAuB;YAC3B6B,IAAId,KAAKc,EAAE;YACXL;YACAS,MAAMlB;YACNJ;QACF;QAEF,MAAM,EAAEsB,IAAI,EAAEC,SAAS,EAAE,GAAG,MAAMnC,gBAAgB;YAChD8B,IAAId,KAAKc,EAAE;YACXL;YACAf;YACAE;QACF;QAEA,MAAMwB,qBAA8C;YAClD9B;YACAC;YACA8B,eAAe,EAAE;YACjB7B;QACF;QAEA,qBACE,MAACd;YACC4C,2BAAa,KAACnC;gBAASU,MAAMA;gBAAMJ,iBAAiBA;;YACpD8B,QAAQ,CAAC,EAAEf,UAAU,EAAED,IAAI,CAAC,EAAEF,SAAS,EAAEL,MAAMc,KAAK,CAAC,CAAC,EAAEd,KAAKc,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;YACxEU,gBAAgBnB;YAChBU,gBAAgBA;YAChBC,sBAAsBA;YACtBC,mBAAmBA;YACnBH,IAAId,MAAMc,GAAGW;YACbC,aAAaR;YACbS,cAAcR;YACdS,SAAS;;8BAET,KAAC7C;oBACC0B,kBAAkBA;oBAClBV,QAAQD,QAAQC,MAAM;oBACtB8B,QAAQ;oBACRhC,MAAMA;oBACNF,aAAaA;;8BAEf,KAAChB;oBAAoBgB,aAAaA;;8BAClC,KAACf;oBACCkD,iBACE,OAAO1B,2BAA2B,aAAaA,yBAAyB2B;oBAE1EC,kBAAkB9C;oBAClB+C,gBAAgBb;oBAChBc,iBAAiB;wBACfrC;wBACAH;wBACAH;wBACAO;wBACAH;wBACAH;wBACAQ;oBACF;;;;IAIR;IAEA,OAAOnB;AACT,EAAC"}
@@ -1,9 +1,8 @@
1
- import type { FormState } from 'payload';
1
+ import type { FormState, LoginWithUsernameOptions } from 'payload';
2
2
  import React from 'react';
3
3
  export declare const CreateFirstUserClient: React.FC<{
4
4
  initialState: FormState;
5
- loginType: 'email' | 'emailOrUsername' | 'username';
6
- requireEmail?: boolean;
5
+ loginWithUsername?: LoginWithUsernameOptions | false;
7
6
  userSlug: string;
8
7
  }>;
9
8
  //# sourceMappingURL=index.client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/views/CreateFirstUser/index.client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAcxC,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3C,YAAY,EAAE,SAAS,CAAA;IACvB,SAAS,EAAE,OAAO,GAAG,iBAAiB,GAAG,UAAU,CAAA;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;CACjB,CA0DA,CAAA"}
1
+ {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/views/CreateFirstUser/index.client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAclE,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3C,YAAY,EAAE,SAAS,CAAA;IACvB,iBAAiB,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAA;IACpD,QAAQ,EAAE,MAAM,CAAA;CACjB,CA6DA,CAAA"}
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ConfirmPasswordField, Form, FormSubmit, PasswordField, RenderFields, useComponentMap, useConfig, useTranslation } from '@payloadcms/ui';
4
4
  import { getFormState } from '@payloadcms/ui/shared';
5
5
  import React from 'react';
6
- import { LoginField } from '../Login/LoginField/index.js';
7
- export const CreateFirstUserClient = ({ initialState, loginType, requireEmail = true, userSlug })=>{
6
+ import { RenderEmailAndUsernameFields } from '../../elements/EmailAndUsername/index.js';
7
+ export const CreateFirstUserClient = ({ initialState, loginWithUsername, userSlug })=>{
8
8
  const { getFieldMap } = useComponentMap();
9
9
  const { routes: { admin, api: apiRoute }, serverURL } = useConfig();
10
10
  const { t } = useTranslation();
@@ -35,20 +35,14 @@ export const CreateFirstUserClient = ({ initialState, loginType, requireEmail =
35
35
  redirect: admin,
36
36
  validationOperation: "create",
37
37
  children: [
38
- [
39
- 'emailOrUsername',
40
- 'username'
41
- ].includes(loginType) && /*#__PURE__*/ _jsx(LoginField, {
42
- type: "username"
43
- }),
44
- [
45
- 'email',
46
- 'emailOrUsername'
47
- ].includes(loginType) && /*#__PURE__*/ _jsx(LoginField, {
48
- required: requireEmail,
49
- type: "email"
38
+ /*#__PURE__*/ _jsx(RenderEmailAndUsernameFields, {
39
+ className: "emailAndUsername",
40
+ loginWithUsername: loginWithUsername,
41
+ operation: "create",
42
+ readOnly: false
50
43
  }),
51
44
  /*#__PURE__*/ _jsx(PasswordField, {
45
+ autoComplete: "off",
52
46
  label: t('authentication:newPassword'),
53
47
  name: "password",
54
48
  path: "password",
@@ -64,6 +58,7 @@ export const CreateFirstUserClient = ({ initialState, loginType, requireEmail =
64
58
  schemaPath: userSlug
65
59
  }),
66
60
  /*#__PURE__*/ _jsx(FormSubmit, {
61
+ size: "large",
67
62
  children: t('general:create')
68
63
  })
69
64
  ]