@strapi/plugin-users-permissions 5.0.0-beta.6 → 5.0.0-beta.7

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 (144) hide show
  1. package/admin/src/components/BoundRoute/index.jsx +2 -2
  2. package/admin/src/components/FormModal/Input/index.jsx +32 -31
  3. package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx +1 -1
  4. package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +2 -2
  5. package/admin/src/components/Policies/index.jsx +2 -2
  6. package/admin/src/components/UsersPermissions/index.jsx +2 -2
  7. package/admin/src/pages/AdvancedSettings/index.jsx +6 -16
  8. package/admin/src/pages/EmailTemplates/components/EmailForm.jsx +2 -1
  9. package/admin/src/pages/EmailTemplates/index.jsx +5 -4
  10. package/admin/src/pages/Providers/index.jsx +6 -9
  11. package/admin/src/pages/Roles/pages/CreatePage.jsx +29 -24
  12. package/admin/src/pages/Roles/pages/EditPage.jsx +33 -24
  13. package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +1 -1
  14. package/admin/src/pages/Roles/pages/ListPage/index.jsx +8 -11
  15. package/dist/_chunks/ar-BguGUqwK.js +44 -0
  16. package/dist/_chunks/ar-BguGUqwK.js.map +1 -0
  17. package/dist/_chunks/ar-CK8BRRXB.mjs +44 -0
  18. package/dist/_chunks/ar-CK8BRRXB.mjs.map +1 -0
  19. package/dist/_chunks/cs-BVigMk0l.mjs +50 -0
  20. package/dist/_chunks/cs-BVigMk0l.mjs.map +1 -0
  21. package/dist/_chunks/cs-BW8-K_GY.js +50 -0
  22. package/dist/_chunks/cs-BW8-K_GY.js.map +1 -0
  23. package/dist/_chunks/de-BKUdRFI4.mjs +62 -0
  24. package/dist/_chunks/de-BKUdRFI4.mjs.map +1 -0
  25. package/dist/_chunks/de-owXpVluI.js +62 -0
  26. package/dist/_chunks/de-owXpVluI.js.map +1 -0
  27. package/dist/_chunks/dk-BQiTK50l.mjs +86 -0
  28. package/dist/_chunks/dk-BQiTK50l.mjs.map +1 -0
  29. package/dist/_chunks/dk-LXAnbuBk.js +86 -0
  30. package/dist/_chunks/dk-LXAnbuBk.js.map +1 -0
  31. package/dist/_chunks/en-DOHtPf-2.mjs +86 -0
  32. package/dist/_chunks/en-DOHtPf-2.mjs.map +1 -0
  33. package/dist/_chunks/en-MHo5mcsU.js +86 -0
  34. package/dist/_chunks/en-MHo5mcsU.js.map +1 -0
  35. package/dist/_chunks/es-BwLCLXAQ.js +86 -0
  36. package/dist/_chunks/es-BwLCLXAQ.js.map +1 -0
  37. package/dist/_chunks/es-DNgOVMjD.mjs +86 -0
  38. package/dist/_chunks/es-DNgOVMjD.mjs.map +1 -0
  39. package/dist/_chunks/fr-DkgRugiU.mjs +50 -0
  40. package/dist/_chunks/fr-DkgRugiU.mjs.map +1 -0
  41. package/dist/_chunks/fr-DkhpSjjm.js +50 -0
  42. package/dist/_chunks/fr-DkhpSjjm.js.map +1 -0
  43. package/dist/_chunks/id-BTemOeTZ.js +62 -0
  44. package/dist/_chunks/id-BTemOeTZ.js.map +1 -0
  45. package/dist/_chunks/id-BdEsvnaF.mjs +62 -0
  46. package/dist/_chunks/id-BdEsvnaF.mjs.map +1 -0
  47. package/dist/_chunks/index--VHJr8__-Cx-PmaTb.mjs +10577 -0
  48. package/dist/_chunks/index--VHJr8__-Cx-PmaTb.mjs.map +1 -0
  49. package/dist/_chunks/index--VHJr8__-a6vFdIyj.js +10601 -0
  50. package/dist/_chunks/index--VHJr8__-a6vFdIyj.js.map +1 -0
  51. package/dist/_chunks/index-B-kWBHFg.mjs +1153 -0
  52. package/dist/_chunks/index-B-kWBHFg.mjs.map +1 -0
  53. package/dist/_chunks/index-B0IECp2U.js +272 -0
  54. package/dist/_chunks/index-B0IECp2U.js.map +1 -0
  55. package/dist/_chunks/index-BEhglMSg.mjs +249 -0
  56. package/dist/_chunks/index-BEhglMSg.mjs.map +1 -0
  57. package/dist/_chunks/index-BRZCpa1U.mjs +335 -0
  58. package/dist/_chunks/index-BRZCpa1U.mjs.map +1 -0
  59. package/dist/_chunks/index-CYVy1i0_.mjs +253 -0
  60. package/dist/_chunks/index-CYVy1i0_.mjs.map +1 -0
  61. package/dist/_chunks/index-CvBfU3H9.js +634 -0
  62. package/dist/_chunks/index-CvBfU3H9.js.map +1 -0
  63. package/dist/_chunks/index-D6s_GV1d.js +357 -0
  64. package/dist/_chunks/index-D6s_GV1d.js.map +1 -0
  65. package/dist/_chunks/index-Du8DLJcX.mjs +611 -0
  66. package/dist/_chunks/index-Du8DLJcX.mjs.map +1 -0
  67. package/dist/_chunks/index-QrGtUO_1.js +248 -0
  68. package/dist/_chunks/index-QrGtUO_1.js.map +1 -0
  69. package/dist/_chunks/index-lnrC9bmZ.js +1183 -0
  70. package/dist/_chunks/index-lnrC9bmZ.js.map +1 -0
  71. package/dist/_chunks/it-B-rv0E24.mjs +62 -0
  72. package/dist/_chunks/it-B-rv0E24.mjs.map +1 -0
  73. package/dist/_chunks/it-D1rH6V6_.js +62 -0
  74. package/dist/_chunks/it-D1rH6V6_.js.map +1 -0
  75. package/dist/_chunks/ja-C8K-VBPD.mjs +48 -0
  76. package/dist/_chunks/ja-C8K-VBPD.mjs.map +1 -0
  77. package/dist/_chunks/ja-DqShgTMf.js +48 -0
  78. package/dist/_chunks/ja-DqShgTMf.js.map +1 -0
  79. package/dist/_chunks/ko-B9DGEPWH.js +86 -0
  80. package/dist/_chunks/ko-B9DGEPWH.js.map +1 -0
  81. package/dist/_chunks/ko-Busb0wIY.mjs +86 -0
  82. package/dist/_chunks/ko-Busb0wIY.mjs.map +1 -0
  83. package/dist/_chunks/ms-ByvsQjRt.mjs +49 -0
  84. package/dist/_chunks/ms-ByvsQjRt.mjs.map +1 -0
  85. package/dist/_chunks/ms-CPBU3LWf.js +49 -0
  86. package/dist/_chunks/ms-CPBU3LWf.js.map +1 -0
  87. package/dist/_chunks/nl-5qO8Rpcy.mjs +48 -0
  88. package/dist/_chunks/nl-5qO8Rpcy.mjs.map +1 -0
  89. package/dist/_chunks/nl-CwNB6YoO.js +48 -0
  90. package/dist/_chunks/nl-CwNB6YoO.js.map +1 -0
  91. package/dist/_chunks/pl-BdIzifBE.mjs +86 -0
  92. package/dist/_chunks/pl-BdIzifBE.mjs.map +1 -0
  93. package/dist/_chunks/pl-Do9UD69f.js +86 -0
  94. package/dist/_chunks/pl-Do9UD69f.js.map +1 -0
  95. package/dist/_chunks/pt-BIO24ioG.mjs +48 -0
  96. package/dist/_chunks/pt-BIO24ioG.mjs.map +1 -0
  97. package/dist/_chunks/pt-BR-D7dZhxuP.js +44 -0
  98. package/dist/_chunks/pt-BR-D7dZhxuP.js.map +1 -0
  99. package/dist/_chunks/pt-BR-f0p23AQZ.mjs +44 -0
  100. package/dist/_chunks/pt-BR-f0p23AQZ.mjs.map +1 -0
  101. package/dist/_chunks/pt-fdvyOnUp.js +48 -0
  102. package/dist/_chunks/pt-fdvyOnUp.js.map +1 -0
  103. package/dist/_chunks/ru-C94rjPGA.js +86 -0
  104. package/dist/_chunks/ru-C94rjPGA.js.map +1 -0
  105. package/dist/_chunks/ru-VWy-IB7K.mjs +86 -0
  106. package/dist/_chunks/ru-VWy-IB7K.mjs.map +1 -0
  107. package/dist/_chunks/sk-BABEhykl.js +50 -0
  108. package/dist/_chunks/sk-BABEhykl.js.map +1 -0
  109. package/dist/_chunks/sk-B_LIcepm.mjs +50 -0
  110. package/dist/_chunks/sk-B_LIcepm.mjs.map +1 -0
  111. package/dist/_chunks/sv-ABLKOokl.mjs +86 -0
  112. package/dist/_chunks/sv-ABLKOokl.mjs.map +1 -0
  113. package/dist/_chunks/sv-Be43LhA9.js +86 -0
  114. package/dist/_chunks/sv-Be43LhA9.js.map +1 -0
  115. package/dist/_chunks/th-DKyP7ueR.mjs +60 -0
  116. package/dist/_chunks/th-DKyP7ueR.mjs.map +1 -0
  117. package/dist/_chunks/th-DgVhVLhL.js +60 -0
  118. package/dist/_chunks/th-DgVhVLhL.js.map +1 -0
  119. package/dist/_chunks/tr-B_idhkEs.js +85 -0
  120. package/dist/_chunks/tr-B_idhkEs.js.map +1 -0
  121. package/dist/_chunks/tr-qa1Q5UjC.mjs +85 -0
  122. package/dist/_chunks/tr-qa1Q5UjC.mjs.map +1 -0
  123. package/dist/_chunks/uk-BmRqbeQc.mjs +49 -0
  124. package/dist/_chunks/uk-BmRqbeQc.mjs.map +1 -0
  125. package/dist/_chunks/uk-LHOivnhP.js +49 -0
  126. package/dist/_chunks/uk-LHOivnhP.js.map +1 -0
  127. package/dist/_chunks/vi-CdVRdKDw.js +50 -0
  128. package/dist/_chunks/vi-CdVRdKDw.js.map +1 -0
  129. package/dist/_chunks/vi-HW-EdMea.mjs +50 -0
  130. package/dist/_chunks/vi-HW-EdMea.mjs.map +1 -0
  131. package/dist/_chunks/zh-5hKkVPA4.mjs +86 -0
  132. package/dist/_chunks/zh-5hKkVPA4.mjs.map +1 -0
  133. package/dist/_chunks/zh-Cuq8gMnF.js +86 -0
  134. package/dist/_chunks/zh-Cuq8gMnF.js.map +1 -0
  135. package/dist/_chunks/zh-Hans-BHilK-yc.mjs +86 -0
  136. package/dist/_chunks/zh-Hans-BHilK-yc.mjs.map +1 -0
  137. package/dist/_chunks/zh-Hans-GQDMKtY4.js +86 -0
  138. package/dist/_chunks/zh-Hans-GQDMKtY4.js.map +1 -0
  139. package/dist/admin/index.js +4 -0
  140. package/dist/admin/index.js.map +1 -0
  141. package/dist/admin/index.mjs +5 -0
  142. package/dist/admin/index.mjs.map +1 -0
  143. package/package.json +8 -8
  144. package/server/utils/sanitize/visitors/remove-user-relation-from-role-entities.js +2 -2
@@ -5,7 +5,7 @@ import map from 'lodash/map';
5
5
  import tail from 'lodash/tail';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useIntl } from 'react-intl';
8
- import styled from 'styled-components';
8
+ import { styled } from 'styled-components';
9
9
 
10
10
  import getMethodColor from './getMethodColor';
11
11
 
@@ -24,7 +24,7 @@ function BoundRoute({ route }) {
24
24
 
25
25
  return (
26
26
  <Flex direction="column" alignItems="stretch" gap={2}>
27
- <Typography variant="delta" as="h3">
27
+ <Typography variant="delta" tag="h3">
28
28
  {formatMessage({
29
29
  id: 'users-permissions.BoundRoute.title',
30
30
  defaultMessage: 'Bound route to',
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
 
9
- import { TextInput, ToggleInput } from '@strapi/design-system';
9
+ import { TextInput, Toggle, Field } from '@strapi/design-system';
10
10
  import PropTypes from 'prop-types';
11
11
  import { useIntl } from 'react-intl';
12
12
 
@@ -41,25 +41,26 @@ const Input = ({
41
41
 
42
42
  if (type === 'bool') {
43
43
  return (
44
- <ToggleInput
45
- aria-label={name}
46
- checked={value}
47
- disabled={disabled}
48
- hint={hint}
49
- label={label}
50
- name={name}
51
- offLabel={formatMessage({
52
- id: 'app.components.ToggleCheckbox.off-label',
53
- defaultMessage: 'Off',
54
- })}
55
- onLabel={formatMessage({
56
- id: 'app.components.ToggleCheckbox.on-label',
57
- defaultMessage: 'On',
58
- })}
59
- onChange={(e) => {
60
- onChange({ target: { name, value: e.target.checked } });
61
- }}
62
- />
44
+ <Field.Root hint={hint} name={name}>
45
+ <Field.Label>{label}</Field.Label>
46
+ <Toggle
47
+ aria-label={name}
48
+ checked={value}
49
+ disabled={disabled}
50
+ offLabel={formatMessage({
51
+ id: 'app.components.ToggleCheckbox.off-label',
52
+ defaultMessage: 'Off',
53
+ })}
54
+ onLabel={formatMessage({
55
+ id: 'app.components.ToggleCheckbox.on-label',
56
+ defaultMessage: 'On',
57
+ })}
58
+ onChange={(e) => {
59
+ onChange({ target: { name, value: e.target.checked } });
60
+ }}
61
+ />
62
+ <Field.Hint />
63
+ </Field.Root>
63
64
  );
64
65
  }
65
66
 
@@ -73,17 +74,17 @@ const Input = ({
73
74
  const errorMessage = error ? formatMessage({ id: error, defaultMessage: error }) : '';
74
75
 
75
76
  return (
76
- <TextInput
77
- aria-label={name}
78
- disabled={disabled}
79
- error={errorMessage}
80
- label={label}
81
- name={name}
82
- onChange={onChange}
83
- placeholder={formattedPlaceholder}
84
- type={type}
85
- value={inputValue}
86
- />
77
+ <Field.Root error={errorMessage} name={name}>
78
+ <Field.Label>{label}</Field.Label>
79
+ <TextInput
80
+ disabled={disabled}
81
+ onChange={onChange}
82
+ placeholder={formattedPlaceholder}
83
+ type={type}
84
+ value={inputValue}
85
+ />
86
+ <Field.Error />
87
+ </Field.Root>
87
88
  );
88
89
  };
89
90
 
@@ -1,5 +1,5 @@
1
1
  import { Box } from '@strapi/design-system';
2
- import styled, { css } from 'styled-components';
2
+ import { styled, css } from 'styled-components';
3
3
 
4
4
  const activeCheckboxWrapperStyles = css`
5
5
  background: ${(props) => props.theme.colors.primary100};
@@ -13,7 +13,7 @@ import { Cog as CogIcon } from '@strapi/icons';
13
13
  import get from 'lodash/get';
14
14
  import PropTypes from 'prop-types';
15
15
  import { useIntl } from 'react-intl';
16
- import styled from 'styled-components';
16
+ import { styled } from 'styled-components';
17
17
 
18
18
  import { useUsersPermissions } from '../../../contexts/UsersPermissionsContext';
19
19
 
@@ -101,7 +101,7 @@ const SubCategory = ({ subCategory }) => {
101
101
  onClick={() => onSelectedAction(action.name)}
102
102
  style={{ display: 'inline-flex', alignItems: 'center' }}
103
103
  >
104
- <VisuallyHidden as="span">
104
+ <VisuallyHidden tag="span">
105
105
  {formatMessage(
106
106
  {
107
107
  id: 'app.utils.show-bound-route',
@@ -40,13 +40,13 @@ const Policies = () => {
40
40
  </Flex>
41
41
  ) : (
42
42
  <Flex direction="column" alignItems="stretch" gap={2}>
43
- <Typography variant="delta" as="h3">
43
+ <Typography variant="delta" tag="h3">
44
44
  {formatMessage({
45
45
  id: 'users-permissions.Policies.header.title',
46
46
  defaultMessage: 'Advanced settings',
47
47
  })}
48
48
  </Typography>
49
- <Typography as="p" textColor="neutral600">
49
+ <Typography tag="p" textColor="neutral600">
50
50
  {formatMessage({
51
51
  id: 'users-permissions.Policies.header.hint',
52
52
  defaultMessage:
@@ -65,13 +65,13 @@ const UsersPermissions = forwardRef(({ permissions, routes }, ref) => {
65
65
  <GridItem col={7} paddingTop={6} paddingBottom={6} paddingLeft={7} paddingRight={7}>
66
66
  <Flex direction="column" alignItems="stretch" gap={6}>
67
67
  <Flex direction="column" alignItems="stretch" gap={2}>
68
- <Typography variant="delta" as="h2">
68
+ <Typography variant="delta" tag="h2">
69
69
  {formatMessage({
70
70
  id: getTrad('Plugins.header.title'),
71
71
  defaultMessage: 'Permissions',
72
72
  })}
73
73
  </Typography>
74
- <Typography as="p" textColor="neutral600">
74
+ <Typography tag="p" textColor="neutral600">
75
75
  {formatMessage({
76
76
  id: getTrad('Plugins.header.description'),
77
77
  defaultMessage: 'Only actions bound by a route are listed below.',
@@ -1,16 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import {
4
- Box,
5
- Button,
6
- ContentLayout,
7
- Flex,
8
- Grid,
9
- GridItem,
10
- HeaderLayout,
11
- Typography,
12
- useNotifyAT,
13
- } from '@strapi/design-system';
3
+ import { Box, Button, Flex, Grid, GridItem, Typography, useNotifyAT } from '@strapi/design-system';
14
4
  import { Check } from '@strapi/icons';
15
5
  import {
16
6
  useAPIErrorHandler,
@@ -20,8 +10,8 @@ import {
20
10
  useNotification,
21
11
  useFetchClient,
22
12
  useRBAC,
13
+ Layouts,
23
14
  } from '@strapi/strapi/admin';
24
-
25
15
  import { useIntl } from 'react-intl';
26
16
  import { useMutation, useQuery, useQueryClient } from 'react-query';
27
17
 
@@ -133,7 +123,7 @@ const AdvancedSettingsPage = () => {
133
123
  {({ values, isSubmitting, modified }) => {
134
124
  return (
135
125
  <>
136
- <HeaderLayout
126
+ <Layouts.Header
137
127
  title={formatMessage({
138
128
  id: getTrad('HeaderNav.link.advancedSettings'),
139
129
  defaultMessage: 'Advanced Settings',
@@ -150,7 +140,7 @@ const AdvancedSettingsPage = () => {
150
140
  </Button>
151
141
  }
152
142
  />
153
- <ContentLayout>
143
+ <Layouts.Content>
154
144
  <Box
155
145
  background="neutral0"
156
146
  hasRadius
@@ -161,7 +151,7 @@ const AdvancedSettingsPage = () => {
161
151
  paddingRight={7}
162
152
  >
163
153
  <Flex direction="column" alignItems="stretch" gap={4}>
164
- <Typography variant="delta" as="h2">
154
+ <Typography variant="delta" tag="h2">
165
155
  {formatMessage({
166
156
  id: 'global.settings',
167
157
  defaultMessage: 'Settings',
@@ -207,7 +197,7 @@ const AdvancedSettingsPage = () => {
207
197
  </Grid>
208
198
  </Flex>
209
199
  </Box>
210
- </ContentLayout>
200
+ </Layouts.Content>
211
201
  </>
212
202
  );
213
203
  }}
@@ -8,8 +8,9 @@ import {
8
8
  ModalFooter,
9
9
  ModalHeader,
10
10
  ModalLayout,
11
+ Breadcrumbs,
12
+ Crumb,
11
13
  } from '@strapi/design-system';
12
- import { Breadcrumbs, Crumb } from '@strapi/design-system';
13
14
  import { Form, InputRenderer } from '@strapi/strapi/admin';
14
15
  import PropTypes from 'prop-types';
15
16
  import { useIntl } from 'react-intl';
@@ -1,13 +1,14 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  import { useTracking } from '@strapi/admin/strapi-admin';
4
- import { ContentLayout, HeaderLayout, useNotifyAT } from '@strapi/design-system';
4
+ import { useNotifyAT } from '@strapi/design-system';
5
5
  import {
6
6
  Page,
7
7
  useAPIErrorHandler,
8
8
  useNotification,
9
9
  useFetchClient,
10
10
  useRBAC,
11
+ Layouts,
11
12
  } from '@strapi/strapi/admin';
12
13
  import { useIntl } from 'react-intl';
13
14
  import { useMutation, useQuery, useQueryClient } from 'react-query';
@@ -125,13 +126,13 @@ const EmailTemplatesPage = () => {
125
126
  }
126
127
  )}
127
128
  </Page.Title>
128
- <HeaderLayout
129
+ <Layouts.Header
129
130
  title={formatMessage({
130
131
  id: getTrad('HeaderNav.link.emailTemplates'),
131
132
  defaultMessage: 'Email templates',
132
133
  })}
133
134
  />
134
- <ContentLayout>
135
+ <Layouts.Content>
135
136
  <EmailTable onEditClick={handleEditClick} canUpdate={canUpdate} />
136
137
  {isModalOpen && (
137
138
  <EmailForm
@@ -140,7 +141,7 @@ const EmailTemplatesPage = () => {
140
141
  onSubmit={handleSubmit}
141
142
  />
142
143
  )}
143
- </ContentLayout>
144
+ </Layouts.Content>
144
145
  </Page.Main>
145
146
  );
146
147
  };
@@ -1,11 +1,8 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { useTracking } from '@strapi/admin/strapi-admin';
3
+ import { useTracking, Layouts } from '@strapi/admin/strapi-admin';
4
4
  import {
5
- ContentLayout,
6
- HeaderLayout,
7
5
  IconButton,
8
- Layout,
9
6
  Table,
10
7
  Tbody,
11
8
  Td,
@@ -147,7 +144,7 @@ export const ProvidersPage = () => {
147
144
  }
148
145
 
149
146
  return (
150
- <Layout>
147
+ <Layouts.Root>
151
148
  <Page.Title>
152
149
  {formatMessage(
153
150
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
@@ -160,13 +157,13 @@ export const ProvidersPage = () => {
160
157
  )}
161
158
  </Page.Title>
162
159
  <Page.Main>
163
- <HeaderLayout
160
+ <Layouts.Header
164
161
  title={formatMessage({
165
162
  id: getTrad('HeaderNav.link.providers'),
166
163
  defaultMessage: 'Providers',
167
164
  })}
168
165
  />
169
- <ContentLayout>
166
+ <Layouts.Content>
170
167
  <Table colCount={3} rowCount={providers.length + 1}>
171
168
  <Thead>
172
169
  <Tr>
@@ -233,7 +230,7 @@ export const ProvidersPage = () => {
233
230
  ))}
234
231
  </Tbody>
235
232
  </Table>
236
- </ContentLayout>
233
+ </Layouts.Content>
237
234
  </Page.Main>
238
235
  <FormModal
239
236
  initialData={data[providerToEditName]}
@@ -251,7 +248,7 @@ export const ProvidersPage = () => {
251
248
  onSubmit={handleSubmit}
252
249
  providerToEditName={providerToEditName}
253
250
  />
254
- </Layout>
251
+ </Layouts.Root>
255
252
  );
256
253
  };
257
254
 
@@ -2,18 +2,17 @@ import * as React from 'react';
2
2
 
3
3
  import {
4
4
  Button,
5
- ContentLayout,
6
5
  Flex,
7
6
  Grid,
8
7
  GridItem,
9
- HeaderLayout,
10
8
  Main,
11
9
  Textarea,
12
10
  TextInput,
13
11
  Typography,
12
+ Field,
14
13
  } from '@strapi/design-system';
15
14
  import { Check } from '@strapi/icons';
16
- import { Page, useTracking, useNotification, useFetchClient } from '@strapi/strapi/admin';
15
+ import { Page, useTracking, useNotification, useFetchClient, Layouts } from '@strapi/strapi/admin';
17
16
  import { Formik, Form } from 'formik';
18
17
  import { useIntl } from 'react-intl';
19
18
  import { useMutation } from 'react-query';
@@ -85,7 +84,7 @@ export const CreatePage = () => {
85
84
  >
86
85
  {({ handleSubmit, values, handleChange, errors }) => (
87
86
  <Form noValidate onSubmit={handleSubmit}>
88
- <HeaderLayout
87
+ <Layouts.Header
89
88
  primaryAction={
90
89
  !isLoadingPlugins && (
91
90
  <Button type="submit" loading={mutation.isLoading} startIcon={<Check />}>
@@ -105,7 +104,7 @@ export const CreatePage = () => {
105
104
  defaultMessage: 'Define the rights given to the role',
106
105
  })}
107
106
  />
108
- <ContentLayout>
107
+ <Layouts.Content>
109
108
  <Flex
110
109
  background="neutral0"
111
110
  direction="column"
@@ -119,7 +118,7 @@ export const CreatePage = () => {
119
118
  shadow="filterShadow"
120
119
  >
121
120
  <Flex direction="column" alignItems="stretch">
122
- <Typography variant="delta" as="h2">
121
+ <Typography variant="delta" tag="h2">
123
122
  {formatMessage({
124
123
  id: getTrad('EditPage.form.roles'),
125
124
  defaultMessage: 'Role details',
@@ -128,31 +127,28 @@ export const CreatePage = () => {
128
127
 
129
128
  <Grid gap={4}>
130
129
  <GridItem col={6}>
131
- <TextInput
130
+ <Field.Root
132
131
  name="name"
133
- value={values.name || ''}
134
- onChange={handleChange}
135
- label={formatMessage({
136
- id: 'global.name',
137
- defaultMessage: 'Name',
138
- })}
139
132
  error={
140
133
  errors?.name
141
134
  ? formatMessage({ id: errors.name, defaultMessage: 'Name is required' })
142
135
  : false
143
136
  }
144
137
  required
145
- />
138
+ >
139
+ <Field.Label>
140
+ {formatMessage({
141
+ id: 'global.name',
142
+ defaultMessage: 'Name',
143
+ })}
144
+ </Field.Label>
145
+ <TextInput value={values.name || ''} onChange={handleChange} />
146
+ <Field.Error />
147
+ </Field.Root>
146
148
  </GridItem>
147
149
  <GridItem col={6}>
148
- <Textarea
149
- id="description"
150
- value={values.description || ''}
151
- onChange={handleChange}
152
- label={formatMessage({
153
- id: 'global.description',
154
- defaultMessage: 'Description',
155
- })}
150
+ <Field.Root
151
+ name="description"
156
152
  error={
157
153
  errors?.description
158
154
  ? formatMessage({
@@ -162,7 +158,16 @@ export const CreatePage = () => {
162
158
  : false
163
159
  }
164
160
  required
165
- />
161
+ >
162
+ <Field.Label>
163
+ {formatMessage({
164
+ id: 'global.description',
165
+ defaultMessage: 'Description',
166
+ })}
167
+ </Field.Label>
168
+ <Textarea value={values.description || ''} onChange={handleChange} />
169
+ <Field.Error />
170
+ </Field.Root>
166
171
  </GridItem>
167
172
  </Grid>
168
173
  </Flex>
@@ -175,7 +180,7 @@ export const CreatePage = () => {
175
180
  />
176
181
  )}
177
182
  </Flex>
178
- </ContentLayout>
183
+ </Layouts.Content>
179
184
  </Form>
180
185
  )}
181
186
  </Formik>
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  import {
4
- ContentLayout,
5
- HeaderLayout,
6
4
  Main,
7
5
  Button,
8
6
  Flex,
@@ -11,6 +9,7 @@ import {
11
9
  Typography,
12
10
  GridItem,
13
11
  Grid,
12
+ Field,
14
13
  } from '@strapi/design-system';
15
14
  import { Check } from '@strapi/icons';
16
15
  import {
@@ -19,6 +18,7 @@ import {
19
18
  useAPIErrorHandler,
20
19
  useNotification,
21
20
  useFetchClient,
21
+ Layouts,
22
22
  } from '@strapi/strapi/admin';
23
23
  import { Formik, Form } from 'formik';
24
24
  import { useIntl } from 'react-intl';
@@ -102,7 +102,7 @@ export const EditPage = () => {
102
102
  >
103
103
  {({ handleSubmit, values, handleChange, errors }) => (
104
104
  <Form noValidate onSubmit={handleSubmit}>
105
- <HeaderLayout
105
+ <Layouts.Header
106
106
  primaryAction={
107
107
  !isLoadingPlugins ? (
108
108
  <Button
@@ -122,7 +122,7 @@ export const EditPage = () => {
122
122
  subtitle={role.description}
123
123
  navigationAction={<BackButton />}
124
124
  />
125
- <ContentLayout>
125
+ <Layouts.Content>
126
126
  <Flex
127
127
  background="neutral0"
128
128
  direction="column"
@@ -136,7 +136,7 @@ export const EditPage = () => {
136
136
  shadow="filterShadow"
137
137
  >
138
138
  <Flex direction="column" alignItems="stretch" gap={4}>
139
- <Typography variant="delta" as="h2">
139
+ <Typography variant="delta" tag="h2">
140
140
  {formatMessage({
141
141
  id: getTrad('EditPage.form.roles'),
142
142
  defaultMessage: 'Role details',
@@ -145,31 +145,31 @@ export const EditPage = () => {
145
145
 
146
146
  <Grid gap={4}>
147
147
  <GridItem col={6}>
148
- <TextInput
148
+ <Field.Root
149
149
  name="name"
150
- value={values.name || ''}
151
- onChange={handleChange}
152
- label={formatMessage({
153
- id: 'global.name',
154
- defaultMessage: 'Name',
155
- })}
156
150
  error={
157
151
  errors?.name
158
- ? formatMessage({ id: errors.name, defaultMessage: 'Name is required' })
152
+ ? formatMessage({
153
+ id: errors.name,
154
+ defaultMessage: 'Name is required',
155
+ })
159
156
  : false
160
157
  }
161
158
  required
162
- />
159
+ >
160
+ <Field.Label>
161
+ {formatMessage({
162
+ id: 'global.name',
163
+ defaultMessage: 'Name',
164
+ })}
165
+ </Field.Label>
166
+ <TextInput value={values.name || ''} onChange={handleChange} />
167
+ <Field.Error />
168
+ </Field.Root>
163
169
  </GridItem>
164
170
  <GridItem col={6}>
165
- <Textarea
166
- id="description"
167
- value={values.description || ''}
168
- onChange={handleChange}
169
- label={formatMessage({
170
- id: 'global.description',
171
- defaultMessage: 'Description',
172
- })}
171
+ <Field.Root
172
+ name="description"
173
173
  error={
174
174
  errors?.description
175
175
  ? formatMessage({
@@ -179,7 +179,16 @@ export const EditPage = () => {
179
179
  : false
180
180
  }
181
181
  required
182
- />
182
+ >
183
+ <Field.Label>
184
+ {formatMessage({
185
+ id: 'global.description',
186
+ defaultMessage: 'Description',
187
+ })}
188
+ </Field.Label>
189
+ <Textarea value={values.description || ''} onChange={handleChange} />
190
+ <Field.Error />
191
+ </Field.Root>
183
192
  </GridItem>
184
193
  </Grid>
185
194
  </Flex>
@@ -192,7 +201,7 @@ export const EditPage = () => {
192
201
  />
193
202
  )}
194
203
  </Flex>
195
- </ContentLayout>
204
+ </Layouts.Content>
196
205
  </Form>
197
206
  )}
198
207
  </Formik>
@@ -5,7 +5,7 @@ import { Pencil, Trash } from '@strapi/icons';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useIntl } from 'react-intl';
7
7
  import { useNavigate } from 'react-router-dom';
8
- import styled from 'styled-components';
8
+ import { styled } from 'styled-components';
9
9
 
10
10
  const EditLink = styled(Link)`
11
11
  align-items: center;
@@ -1,10 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
 
3
3
  import {
4
- ActionLayout,
5
- ContentLayout,
6
- HeaderLayout,
7
- Layout,
8
4
  Table,
9
5
  Th,
10
6
  Thead,
@@ -28,6 +24,7 @@ import {
28
24
  useQueryParams,
29
25
  useFetchClient,
30
26
  useRBAC,
27
+ Layouts,
31
28
  } from '@strapi/strapi/admin';
32
29
  import { useIntl } from 'react-intl';
33
30
  import { useMutation, useQuery } from 'react-query';
@@ -156,7 +153,7 @@ export const RolesListPage = () => {
156
153
  }
157
154
 
158
155
  return (
159
- <Layout>
156
+ <Layouts.Root>
160
157
  <Page.Title>
161
158
  {formatMessage(
162
159
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
@@ -164,7 +161,7 @@ export const RolesListPage = () => {
164
161
  )}
165
162
  </Page.Title>
166
163
  <Page.Main>
167
- <HeaderLayout
164
+ <Layouts.Header
168
165
  title={formatMessage({
169
166
  id: 'global.roles',
170
167
  defaultMessage: 'Roles',
@@ -177,7 +174,7 @@ export const RolesListPage = () => {
177
174
  canCreate ? (
178
175
  <LinkButton
179
176
  to="new"
180
- as={NavLink}
177
+ tag={NavLink}
181
178
  onClick={() => trackUsage('willCreateRole')}
182
179
  startIcon={<Plus />}
183
180
  size="S"
@@ -192,7 +189,7 @@ export const RolesListPage = () => {
192
189
  navigationAction={<BackButton />}
193
190
  />
194
191
 
195
- <ActionLayout
192
+ <Layouts.Action
196
193
  startActions={
197
194
  <SearchInput
198
195
  label={formatMessage({
@@ -203,7 +200,7 @@ export const RolesListPage = () => {
203
200
  }
204
201
  />
205
202
 
206
- <ContentLayout>
203
+ <Layouts.Content>
207
204
  {!canRead && <Page.NoPermissions />}
208
205
  {canRead && sortedRoles && sortedRoles?.length ? (
209
206
  <Table colCount={colCount} rowCount={rowCount}>
@@ -252,14 +249,14 @@ export const RolesListPage = () => {
252
249
  ) : (
253
250
  <EmptyStateLayout content={formatMessage(emptyLayout[emptyContent])} />
254
251
  )}
255
- </ContentLayout>
252
+ </Layouts.Content>
256
253
  <ConfirmDialog
257
254
  onConfirm={handleConfirmDelete}
258
255
  onClose={handleShowConfirmDelete}
259
256
  isOpen={showConfirmDelete}
260
257
  />
261
258
  </Page.Main>
262
- </Layout>
259
+ </Layouts.Root>
263
260
  );
264
261
  };
265
262