@workos-inc/widgets 1.5.1 → 1.6.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.
Files changed (192) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/admin-portal-domain-verification.client.cjs +32 -17
  3. package/dist/cjs/admin-portal-domain-verification.client.cjs.map +1 -1
  4. package/dist/cjs/admin-portal-domain-verification.client.d.cts +3 -2
  5. package/dist/cjs/{admin-portal-sso-connection-client.cjs → admin-portal-sso-connection.client.cjs} +58 -31
  6. package/dist/cjs/admin-portal-sso-connection.client.cjs.map +1 -0
  7. package/dist/cjs/admin-portal-sso-connection.client.d.cts +16 -0
  8. package/dist/cjs/api/api-provider.cjs +1 -1
  9. package/dist/cjs/api/api-provider.cjs.map +1 -1
  10. package/dist/cjs/api/api-provider.d.cts +1 -1
  11. package/dist/cjs/api/endpoint.cjs +62 -2
  12. package/dist/cjs/api/endpoint.cjs.map +1 -1
  13. package/dist/cjs/api/endpoint.d.cts +62 -1
  14. package/dist/cjs/{api-keys-client.cjs → api-keys.client.cjs} +42 -25
  15. package/dist/cjs/api-keys.client.cjs.map +1 -0
  16. package/dist/cjs/api-keys.client.d.cts +15 -0
  17. package/dist/cjs/index.cjs +9 -2
  18. package/dist/cjs/index.cjs.map +1 -1
  19. package/dist/cjs/index.d.cts +6 -2
  20. package/dist/cjs/lib/admin-portal-domain-verification.cjs +33 -34
  21. package/dist/cjs/lib/admin-portal-domain-verification.cjs.map +1 -1
  22. package/dist/cjs/lib/admin-portal-domain-verification.d.cts +10 -6
  23. package/dist/cjs/lib/admin-portal-sso-connection.cjs +79 -79
  24. package/dist/cjs/lib/admin-portal-sso-connection.cjs.map +1 -1
  25. package/dist/cjs/lib/admin-portal-sso-connection.d.cts +13 -6
  26. package/dist/cjs/lib/api-keys/api-keys.cjs +70 -66
  27. package/dist/cjs/lib/api-keys/api-keys.cjs.map +1 -1
  28. package/dist/cjs/lib/api-keys/api-keys.d.cts +16 -8
  29. package/dist/cjs/lib/constants.cjs +5 -2
  30. package/dist/cjs/lib/constants.cjs.map +1 -1
  31. package/dist/cjs/lib/constants.d.cts +2 -1
  32. package/dist/cjs/lib/elevated-access.cjs.map +1 -1
  33. package/dist/cjs/lib/empty-state.cjs +24 -8
  34. package/dist/cjs/lib/empty-state.cjs.map +1 -1
  35. package/dist/cjs/lib/empty-state.d.cts +6 -2
  36. package/dist/cjs/lib/generic-error.cjs +33 -24
  37. package/dist/cjs/lib/generic-error.cjs.map +1 -1
  38. package/dist/cjs/lib/generic-error.d.cts +5 -2
  39. package/dist/cjs/lib/identity-providers.cjs +2 -1
  40. package/dist/cjs/lib/identity-providers.cjs.map +1 -1
  41. package/dist/cjs/lib/identity-providers.d.cts +2 -2
  42. package/dist/cjs/lib/oauth-icons.cjs +12 -7
  43. package/dist/cjs/lib/oauth-icons.cjs.map +1 -1
  44. package/dist/cjs/lib/oauth-icons.d.cts +7 -3
  45. package/dist/cjs/lib/organization-switcher.cjs +62 -9
  46. package/dist/cjs/lib/organization-switcher.cjs.map +1 -1
  47. package/dist/cjs/lib/organization-switcher.d.cts +12 -9
  48. package/dist/cjs/lib/otp-input.cjs +1 -1
  49. package/dist/cjs/lib/otp-input.cjs.map +1 -1
  50. package/dist/cjs/lib/pipes.cjs +343 -0
  51. package/dist/cjs/lib/pipes.cjs.map +1 -0
  52. package/dist/cjs/lib/pipes.d.cts +19 -0
  53. package/dist/cjs/lib/provider-icon.cjs +0 -6
  54. package/dist/cjs/lib/provider-icon.cjs.map +1 -1
  55. package/dist/cjs/lib/provider-icon.d.cts +4 -1
  56. package/dist/cjs/lib/save-button.cjs.map +1 -1
  57. package/dist/cjs/lib/user-profile.cjs +77 -83
  58. package/dist/cjs/lib/user-profile.cjs.map +1 -1
  59. package/dist/cjs/lib/user-profile.d.cts +11 -7
  60. package/dist/cjs/lib/user-security.cjs +30 -24
  61. package/dist/cjs/lib/user-security.cjs.map +1 -1
  62. package/dist/cjs/lib/user-security.d.cts +10 -7
  63. package/dist/cjs/lib/user-sessions.cjs +19 -9
  64. package/dist/cjs/lib/user-sessions.cjs.map +1 -1
  65. package/dist/cjs/lib/user-sessions.d.cts +10 -6
  66. package/dist/cjs/lib/users-management.cjs +224 -216
  67. package/dist/cjs/lib/users-management.cjs.map +1 -1
  68. package/dist/cjs/lib/users-management.d.cts +10 -7
  69. package/dist/cjs/lib/utils.cjs +43 -0
  70. package/dist/cjs/lib/utils.cjs.map +1 -1
  71. package/dist/cjs/lib/utils.d.cts +29 -2
  72. package/dist/cjs/organization-switcher.client.cjs +45 -16
  73. package/dist/cjs/organization-switcher.client.cjs.map +1 -1
  74. package/dist/cjs/organization-switcher.client.d.cts +2 -1
  75. package/dist/cjs/pipes.client.cjs +64 -0
  76. package/dist/cjs/pipes.client.cjs.map +1 -0
  77. package/dist/cjs/pipes.client.d.cts +15 -0
  78. package/dist/cjs/user-profile.client.cjs +27 -10
  79. package/dist/cjs/user-profile.client.cjs.map +1 -1
  80. package/dist/cjs/user-profile.client.d.cts +4 -3
  81. package/dist/cjs/user-security.client.cjs +27 -10
  82. package/dist/cjs/user-security.client.cjs.map +1 -1
  83. package/dist/cjs/user-security.client.d.cts +3 -2
  84. package/dist/cjs/user-sessions.client.cjs +34 -16
  85. package/dist/cjs/user-sessions.client.cjs.map +1 -1
  86. package/dist/cjs/user-sessions.client.d.cts +4 -2
  87. package/dist/cjs/users-management.client.cjs +35 -18
  88. package/dist/cjs/users-management.client.cjs.map +1 -1
  89. package/dist/cjs/users-management.client.d.cts +3 -2
  90. package/dist/cjs/workos-widgets.client.cjs +7 -12
  91. package/dist/cjs/workos-widgets.client.cjs.map +1 -1
  92. package/dist/css/lib/provider-icon.css +16 -11
  93. package/dist/esm/admin-portal-domain-verification.client.d.ts +3 -2
  94. package/dist/esm/admin-portal-domain-verification.client.js +31 -17
  95. package/dist/esm/admin-portal-domain-verification.client.js.map +1 -1
  96. package/dist/esm/admin-portal-sso-connection.client.d.ts +16 -0
  97. package/dist/esm/{admin-portal-sso-connection-client.js → admin-portal-sso-connection.client.js} +57 -31
  98. package/dist/esm/admin-portal-sso-connection.client.js.map +1 -0
  99. package/dist/esm/api/api-provider.d.ts +1 -1
  100. package/dist/esm/api/api-provider.js +1 -1
  101. package/dist/esm/api/api-provider.js.map +1 -1
  102. package/dist/esm/api/endpoint.d.ts +62 -1
  103. package/dist/esm/api/endpoint.js +56 -2
  104. package/dist/esm/api/endpoint.js.map +1 -1
  105. package/dist/esm/api-keys.client.d.ts +15 -0
  106. package/dist/esm/api-keys.client.js +75 -0
  107. package/dist/esm/api-keys.client.js.map +1 -0
  108. package/dist/esm/index.d.ts +6 -2
  109. package/dist/esm/index.js +9 -2
  110. package/dist/esm/index.js.map +1 -1
  111. package/dist/esm/lib/admin-portal-domain-verification.d.ts +10 -6
  112. package/dist/esm/lib/admin-portal-domain-verification.js +33 -34
  113. package/dist/esm/lib/admin-portal-domain-verification.js.map +1 -1
  114. package/dist/esm/lib/admin-portal-sso-connection.d.ts +13 -6
  115. package/dist/esm/lib/admin-portal-sso-connection.js +83 -80
  116. package/dist/esm/lib/admin-portal-sso-connection.js.map +1 -1
  117. package/dist/esm/lib/api-keys/api-keys.d.ts +16 -8
  118. package/dist/esm/lib/api-keys/api-keys.js +69 -54
  119. package/dist/esm/lib/api-keys/api-keys.js.map +1 -1
  120. package/dist/esm/lib/constants.d.ts +2 -1
  121. package/dist/esm/lib/constants.js +3 -1
  122. package/dist/esm/lib/constants.js.map +1 -1
  123. package/dist/esm/lib/elevated-access.js.map +1 -1
  124. package/dist/esm/lib/empty-state.d.ts +6 -2
  125. package/dist/esm/lib/empty-state.js +24 -8
  126. package/dist/esm/lib/empty-state.js.map +1 -1
  127. package/dist/esm/lib/generic-error.d.ts +5 -2
  128. package/dist/esm/lib/generic-error.js +33 -24
  129. package/dist/esm/lib/generic-error.js.map +1 -1
  130. package/dist/esm/lib/identity-providers.d.ts +2 -2
  131. package/dist/esm/lib/identity-providers.js +2 -1
  132. package/dist/esm/lib/identity-providers.js.map +1 -1
  133. package/dist/esm/lib/oauth-icons.d.ts +7 -3
  134. package/dist/esm/lib/oauth-icons.js +11 -6
  135. package/dist/esm/lib/oauth-icons.js.map +1 -1
  136. package/dist/esm/lib/organization-switcher.d.ts +12 -9
  137. package/dist/esm/lib/organization-switcher.js +54 -9
  138. package/dist/esm/lib/organization-switcher.js.map +1 -1
  139. package/dist/esm/lib/otp-input.js +1 -1
  140. package/dist/esm/lib/otp-input.js.map +1 -1
  141. package/dist/esm/lib/pipes.d.ts +19 -0
  142. package/dist/esm/lib/pipes.js +334 -0
  143. package/dist/esm/lib/pipes.js.map +1 -0
  144. package/dist/esm/lib/provider-icon.d.ts +4 -1
  145. package/dist/esm/lib/provider-icon.js +0 -8
  146. package/dist/esm/lib/provider-icon.js.map +1 -1
  147. package/dist/esm/lib/save-button.js.map +1 -1
  148. package/dist/esm/lib/user-profile.d.ts +11 -7
  149. package/dist/esm/lib/user-profile.js +82 -75
  150. package/dist/esm/lib/user-profile.js.map +1 -1
  151. package/dist/esm/lib/user-security.d.ts +10 -7
  152. package/dist/esm/lib/user-security.js +34 -25
  153. package/dist/esm/lib/user-security.js.map +1 -1
  154. package/dist/esm/lib/user-sessions.d.ts +10 -6
  155. package/dist/esm/lib/user-sessions.js +20 -9
  156. package/dist/esm/lib/user-sessions.js.map +1 -1
  157. package/dist/esm/lib/users-management.d.ts +10 -7
  158. package/dist/esm/lib/users-management.js +230 -217
  159. package/dist/esm/lib/users-management.js.map +1 -1
  160. package/dist/esm/lib/utils.d.ts +29 -2
  161. package/dist/esm/lib/utils.js +46 -1
  162. package/dist/esm/lib/utils.js.map +1 -1
  163. package/dist/esm/organization-switcher.client.d.ts +2 -1
  164. package/dist/esm/organization-switcher.client.js +44 -16
  165. package/dist/esm/organization-switcher.client.js.map +1 -1
  166. package/dist/esm/pipes.client.d.ts +15 -0
  167. package/dist/esm/pipes.client.js +42 -0
  168. package/dist/esm/pipes.client.js.map +1 -0
  169. package/dist/esm/user-profile.client.d.ts +4 -3
  170. package/dist/esm/user-profile.client.js +26 -10
  171. package/dist/esm/user-profile.client.js.map +1 -1
  172. package/dist/esm/user-security.client.d.ts +3 -2
  173. package/dist/esm/user-security.client.js +26 -10
  174. package/dist/esm/user-security.client.js.map +1 -1
  175. package/dist/esm/user-sessions.client.d.ts +4 -2
  176. package/dist/esm/user-sessions.client.js +33 -16
  177. package/dist/esm/user-sessions.client.js.map +1 -1
  178. package/dist/esm/users-management.client.d.ts +3 -2
  179. package/dist/esm/users-management.client.js +34 -18
  180. package/dist/esm/users-management.client.js.map +1 -1
  181. package/dist/esm/workos-widgets.client.js +7 -12
  182. package/dist/esm/workos-widgets.client.js.map +1 -1
  183. package/package.json +17 -10
  184. package/dist/cjs/admin-portal-sso-connection-client.cjs.map +0 -1
  185. package/dist/cjs/admin-portal-sso-connection-client.d.cts +0 -12
  186. package/dist/cjs/api-keys-client.cjs.map +0 -1
  187. package/dist/cjs/api-keys-client.d.cts +0 -10
  188. package/dist/esm/admin-portal-sso-connection-client.d.ts +0 -12
  189. package/dist/esm/admin-portal-sso-connection-client.js.map +0 -1
  190. package/dist/esm/api-keys-client.d.ts +0 -10
  191. package/dist/esm/api-keys-client.js +0 -60
  192. package/dist/esm/api-keys-client.js.map +0 -1
@@ -47,13 +47,13 @@ var import_users_search = require("./users-search.js");
47
47
  var import_utils = require("./utils.js");
48
48
  var import_constants = require("./constants.js");
49
49
  var import_users_management_context = require("./users-management-context.js");
50
- var import_clsx = __toESM(require("clsx"), 1);
51
50
  var import_generic_error = require("./generic-error.js");
52
51
  const UsersManagement = ({
53
52
  userData,
54
53
  rolesData,
55
54
  isPending,
56
- disableRolesFilter
55
+ disableRolesFilter,
56
+ ...domProps
57
57
  }) => {
58
58
  const users = userData?.data ?? [];
59
59
  const usersCount = users?.length ?? 0;
@@ -75,237 +75,237 @@ const UsersManagement = ({
75
75
  }
76
76
  }, [isPending]);
77
77
  const showPagination = !!(pagination.before || pagination.after);
78
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_search_provider.SearchProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(UsersManagementRoot, { children: [
79
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Grid, { columns: "1fr auto", gap: "2", children: [
80
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", children: [
81
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexBasis: "380px", flexGrow: "0", flexShrink: "1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_users_search.UsersSearch, {}) }),
82
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
83
- import_users_filter.UsersFilter,
84
- {
85
- roles: rolesData.roles,
86
- disabled: disableRolesFilter
87
- }
88
- ) })
89
- ] }),
90
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", style: { placeSelf: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_invite_user_dialog.InviteUserDialog, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.PrimaryButton, { children: "Invite user" }) }) })
91
- ] }),
92
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Root, { variant: "ghost", size: "1", children: [
93
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { children: [
94
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "260px", children: "User" }),
95
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "100px", children: `Role${isMultipleRolesEnabled ? "s" : ""}` }),
96
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "140px", children: "Last active" }),
97
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "28px" })
98
- ] }) }),
99
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
- import_themes.Table.Body,
101
- {
102
- style: {
103
- transition: `opacity 0.2s ease-out ${isPending ? "0.2s" : "0s"}`,
104
- opacity: isPending && usersCount > 0 ? 0.5 : 1
105
- },
106
- children: users.length > 0 ? users.map((user) => {
107
- const userDisplayName = (0, import_utils.getBestName)(user);
108
- const dimText = user.status === "InviteRevoked" || user.status === "InviteExpired";
109
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { align: "center", children: [
110
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.RowHeaderCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
111
- import_themes.Flex,
112
- {
113
- align: "center",
114
- gap: "3",
115
- overflow: "hidden",
116
- height: "var(--space-7)",
117
- children: [
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_search_provider.SearchProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
79
+ import_themes.Flex,
80
+ {
81
+ direction: "column",
82
+ gap: "3",
83
+ ...getWidgetRootDomProps("resolved", domProps),
84
+ children: [
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Grid, { columns: "1fr auto", gap: "2", children: [
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", children: [
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexBasis: "380px", flexGrow: "0", flexShrink: "1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_users_search.UsersSearch, {}) }),
88
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
+ import_users_filter.UsersFilter,
90
+ {
91
+ roles: rolesData.roles,
92
+ disabled: disableRolesFilter
93
+ }
94
+ ) })
95
+ ] }),
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", style: { placeSelf: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_invite_user_dialog.InviteUserDialog, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.PrimaryButton, { children: "Invite user" }) }) })
97
+ ] }),
98
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Root, { variant: "ghost", size: "1", children: [
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { children: [
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "260px", children: "User" }),
101
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "100px", children: `Role${isMultipleRolesEnabled ? "s" : ""}` }),
102
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "140px", children: "Last active" }),
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "28px" })
104
+ ] }) }),
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ import_themes.Table.Body,
107
+ {
108
+ style: {
109
+ transition: `opacity 0.2s ease-out ${isPending ? "0.2s" : "0s"}`,
110
+ opacity: isPending && usersCount > 0 ? 0.5 : 1
111
+ },
112
+ children: users.length > 0 ? users.map((user) => {
113
+ const userDisplayName = (0, import_utils.getBestName)(user);
114
+ const dimText = user.status === "InviteRevoked" || user.status === "InviteExpired";
115
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { align: "center", children: [
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.RowHeaderCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
117
+ import_themes.Flex,
118
+ {
119
+ align: "center",
120
+ gap: "3",
121
+ overflow: "hidden",
122
+ height: "var(--space-7)",
123
+ children: [
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
125
+ import_elements.Avatar,
126
+ {
127
+ size: "2",
128
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FallbackUserIcon, {}),
129
+ src: user.profilePictureUrl ?? void 0,
130
+ dim: dimText
131
+ }
132
+ ),
133
+ userDisplayName ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
134
+ import_themes.Flex,
135
+ {
136
+ direction: "column",
137
+ align: "start",
138
+ height: "var(--space-7)",
139
+ justify: "center",
140
+ overflow: "hidden",
141
+ children: [
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", minWidth: "0", children: [
143
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCellText, { dim: dimText, children: userDisplayName }),
144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserBadge, { user })
145
+ ] }),
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
147
+ TableCellText,
148
+ {
149
+ level: "secondary",
150
+ title: user.email,
151
+ dim: dimText,
152
+ children: user.email
153
+ }
154
+ )
155
+ ]
156
+ }
157
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", minWidth: "0", children: [
158
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCellText, { dim: dimText, title: user.email, children: user.email }),
159
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserBadge, { user })
160
+ ] })
161
+ ]
162
+ }
163
+ ) }),
164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
165
+ UserRolesCellContent,
166
+ {
167
+ user,
168
+ isMultipleRolesEnabled,
169
+ dimText
170
+ }
171
+ ) }),
172
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LastActive, { user, isHydrated }) }),
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_user_actions_dropdown.UserActionsDropdown, { user, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_elements.IconButton, { title: "User actions", children: [
174
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.VisuallyHidden, { children: "User actions" }),
118
175
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
- import_elements.Avatar,
176
+ "svg",
120
177
  {
121
- size: "2",
122
- fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FallbackUserIcon, {}),
123
- src: user.profilePictureUrl ?? void 0,
124
- dim: dimText
125
- }
126
- ),
127
- userDisplayName ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
128
- import_themes.Flex,
129
- {
130
- direction: "column",
131
- align: "start",
132
- height: "var(--space-7)",
133
- justify: "center",
134
- overflow: "hidden",
135
- children: [
136
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", minWidth: "0", children: [
137
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCellText, { dim: dimText, children: userDisplayName }),
138
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserBadge, { user })
139
- ] }),
140
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
141
- TableCellText,
142
- {
143
- level: "secondary",
144
- title: user.email,
145
- dim: dimText,
146
- children: user.email
147
- }
148
- )
149
- ]
150
- }
151
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", minWidth: "0", children: [
152
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCellText, { dim: dimText, title: user.email, children: user.email }),
153
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserBadge, { user })
154
- ] })
155
- ]
156
- }
157
- ) }),
158
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
159
- UserRolesCellContent,
160
- {
161
- user,
162
- isMultipleRolesEnabled,
163
- dimText
164
- }
165
- ) }),
166
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LastActive, { user, isHydrated }) }),
167
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_user_actions_dropdown.UserActionsDropdown, { user, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_elements.IconButton, { title: "User actions", children: [
168
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.VisuallyHidden, { children: "User actions" }),
169
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
170
- "svg",
171
- {
172
- xmlns: "http://www.w3.org/2000/svg",
173
- fill: "none",
174
- viewBox: "0 0 24 24",
175
- width: "16",
176
- height: "16",
177
- strokeWidth: 1.5,
178
- stroke: "currentColor",
179
- "aria-hidden": true,
180
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
181
- "path",
182
- {
183
- strokeLinecap: "round",
184
- strokeLinejoin: "round",
185
- d: "M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
178
+ xmlns: "http://www.w3.org/2000/svg",
179
+ fill: "none",
180
+ viewBox: "0 0 24 24",
181
+ width: "16",
182
+ height: "16",
183
+ strokeWidth: 1.5,
184
+ stroke: "currentColor",
185
+ "aria-hidden": true,
186
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
187
+ "path",
188
+ {
189
+ strokeLinecap: "round",
190
+ strokeLinejoin: "round",
191
+ d: "M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
192
+ }
193
+ )
186
194
  }
187
195
  )
188
- }
189
- )
190
- ] }) }) })
191
- ] }, user.id);
192
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Row, { align: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { colSpan: 4, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsersManagementEmptyState, { isPending }) }) })
193
- }
194
- )
195
- ] }),
196
- showPagination ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", justify: "end", children: [
197
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
198
- import_elements.SecondaryButton,
199
- {
200
- size: "1",
201
- disabled: !pagination.after || isPending || void 0,
202
- loading: deferredLoading,
203
- onClick: () => {
204
- if (pagination.after) {
205
- dispatch({
206
- type: "SET_PAGINATION",
207
- pagination: { after: pagination.after }
208
- });
196
+ ] }) }) })
197
+ ] }, user.id);
198
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Row, { align: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { colSpan: 4, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsersManagementEmptyState, { isPending }) }) })
209
199
  }
210
- },
211
- children: "Previous"
212
- }
213
- ),
214
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
215
- import_elements.SecondaryButton,
216
- {
217
- size: "1",
218
- disabled: !pagination.before || isPending || void 0,
219
- loading: deferredLoading,
220
- onClick: () => {
221
- if (pagination.before) {
222
- dispatch({
223
- type: "SET_PAGINATION",
224
- pagination: { before: pagination.before }
225
- });
200
+ )
201
+ ] }),
202
+ showPagination ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", justify: "end", children: [
203
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
204
+ import_elements.SecondaryButton,
205
+ {
206
+ size: "1",
207
+ disabled: !pagination.after || isPending || void 0,
208
+ loading: deferredLoading,
209
+ onClick: () => {
210
+ if (pagination.after) {
211
+ dispatch({
212
+ type: "SET_PAGINATION",
213
+ pagination: { after: pagination.after }
214
+ });
215
+ }
216
+ },
217
+ children: "Previous"
226
218
  }
227
- },
228
- children: "Next"
229
- }
230
- )
231
- ] }) : null
232
- ] }) });
233
- };
234
- const UsersManagementLoading = () => {
235
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(UsersManagementRoot, { children: [
236
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Grid, { columns: "1fr auto", gap: "2", children: [
237
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", children: [
238
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexBasis: "380px", flexGrow: "0", flexShrink: "1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.TextField, {}) }) }),
239
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Select.Root, { value: "all", onValueChange: () => void 0, children: [
240
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SelectTrigger, { children: "All" }),
241
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SelectItem, { value: "all", children: "All" }) })
242
- ] }) }) })
243
- ] }),
244
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", style: { placeSelf: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.PrimaryButton, { children: "Invite user" }) }) })
245
- ] }),
246
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Root, { variant: "ghost", size: "1", children: [
247
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { children: [
248
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "260px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: "User" }) }),
249
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "100px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: "Role" }) }),
250
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "140px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: "Last active" }) }),
251
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "28px" })
252
- ] }) }),
253
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Body, { children: Array.from({ length: import_constants.USER_ROW_LIMIT }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { align: "center", children: [
254
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.RowHeaderCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { align: "center", gap: "3", children: [
255
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Avatar, { size: "2", fallback: "F" }) }),
256
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
257
- import_themes.Flex,
219
+ ),
220
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
221
+ import_elements.SecondaryButton,
258
222
  {
259
- direction: "column",
260
- height: "var(--space-7)",
261
- justify: "center",
262
- children: [
263
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "180px", height: "var(--space-4)" }),
264
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "90px", height: "var(--space-3)", mt: "1" })
265
- ]
223
+ size: "1",
224
+ disabled: !pagination.before || isPending || void 0,
225
+ loading: deferredLoading,
226
+ onClick: () => {
227
+ if (pagination.before) {
228
+ dispatch({
229
+ type: "SET_PAGINATION",
230
+ pagination: { before: pagination.before }
231
+ });
232
+ }
233
+ },
234
+ children: "Next"
266
235
  }
267
236
  )
268
- ] }) }),
269
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Flex, { wrap: "wrap", gap: "1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "75px", height: "var(--space-4)" }) }) }),
270
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "120px", height: "var(--space-4)" }) }),
271
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { justify: "end" })
272
- ] }, index)) })
273
- ] }),
274
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", justify: "end", children: [
275
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SecondaryButton, { size: "1", children: "Previous" }) }),
276
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SecondaryButton, { size: "1", children: "Next" }) })
277
- ] })
278
- ] });
237
+ ] }) : null
238
+ ]
239
+ }
240
+ ) });
279
241
  };
280
- function UsersManagementError({ error }) {
281
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
282
- UsersManagementRoot,
242
+ const UsersManagementLoading = (props) => {
243
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
244
+ import_themes.Flex,
283
245
  {
284
- direction: "row",
285
- justify: "center",
286
- align: "center",
287
- minHeight: "676px",
288
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_generic_error.GenericError, { error })
246
+ direction: "column",
247
+ gap: "3",
248
+ ...getWidgetRootDomProps("loading", props),
249
+ children: [
250
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Grid, { columns: "1fr auto", gap: "2", children: [
251
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", align: "center", children: [
252
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexBasis: "380px", flexGrow: "0", flexShrink: "1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.TextField, {}) }) }),
253
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Select.Root, { value: "all", onValueChange: () => void 0, children: [
254
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SelectTrigger, { children: "All" }),
255
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SelectItem, { value: "all", children: "All" }) })
256
+ ] }) }) })
257
+ ] }),
258
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Box, { flexGrow: "0", flexShrink: "0", style: { placeSelf: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.PrimaryButton, { children: "Invite user" }) }) })
259
+ ] }),
260
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Root, { variant: "ghost", size: "1", children: [
261
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { children: [
262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "260px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: "User" }) }),
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "100px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: "Role" }) }),
264
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "140px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: "Last active" }) }),
265
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.ColumnHeaderCell, { width: "28px" })
266
+ ] }) }),
267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Body, { children: Array.from({ length: import_constants.USER_ROW_LIMIT }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Table.Row, { align: "center", children: [
268
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.RowHeaderCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { align: "center", gap: "3", children: [
269
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Avatar, { size: "2", fallback: "F" }) }),
270
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
271
+ import_themes.Flex,
272
+ {
273
+ direction: "column",
274
+ height: "var(--space-7)",
275
+ justify: "center",
276
+ children: [
277
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "180px", height: "var(--space-4)" }),
278
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "90px", height: "var(--space-3)", mt: "1" })
279
+ ]
280
+ }
281
+ )
282
+ ] }) }),
283
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Flex, { wrap: "wrap", gap: "1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "75px", height: "var(--space-4)" }) }) }),
284
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { width: "120px", height: "var(--space-4)" }) }),
285
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Table.Cell, { justify: "end" })
286
+ ] }, index)) })
287
+ ] }),
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "2", justify: "end", children: [
289
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SecondaryButton, { size: "1", children: "Previous" }) }),
290
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { loading: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.SecondaryButton, { size: "1", children: "Next" }) })
291
+ ] })
292
+ ]
289
293
  }
290
294
  );
291
- }
292
- function UsersManagementRoot({
293
- className,
294
- children,
295
- ...props
296
- }) {
295
+ };
296
+ const UsersManagementError = ({
297
+ error,
298
+ ...domProps
299
+ }) => {
297
300
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
298
- import_themes.Flex,
301
+ import_generic_error.GenericError,
299
302
  {
300
- className: (0, import_clsx.default)("woswidgets-widget", className),
301
- "data-woswidgets-widget-id": "users-management",
302
- direction: "column",
303
- gap: "3",
304
- ...props,
305
- children
303
+ error,
304
+ minHeight: "676px",
305
+ ...getWidgetRootDomProps("error", domProps)
306
306
  }
307
307
  );
308
- }
308
+ };
309
309
  function UserBadge({ user }) {
310
310
  if (user.isLoggedInUser) {
311
311
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Badge, { color: "gray", style: { userSelect: "none" }, children: "You" });
@@ -476,6 +476,14 @@ function UserRolesCellContent({
476
476
  }
477
477
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCellText, { dim: dimText, children: user.roles?.[0]?.name });
478
478
  }
479
+ function getWidgetRootDomProps(state, domProps) {
480
+ return (0, import_utils.getDomProps)({
481
+ ...domProps,
482
+ isWidgetRoot: true,
483
+ widgetId: "users-management",
484
+ widgetState: state
485
+ });
486
+ }
479
487
  // Annotate the CommonJS export names for ESM import in node:
480
488
  0 && (module.exports = {
481
489
  UsersManagement,