@questpie/admin 3.2.5 → 3.2.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 (39) hide show
  1. package/dist/client/blocks/block-renderer.d.mts +2 -2
  2. package/dist/client/components/fields/select-field.mjs +29 -5
  3. package/dist/client/components/primitives/select-multi.mjs +38 -22
  4. package/dist/client/components/primitives/select-single.mjs +25 -11
  5. package/dist/client/preview/block-scope-context.d.mts +2 -2
  6. package/dist/client/preview/preview-banner.d.mts +2 -2
  7. package/dist/client/preview/preview-field.d.mts +4 -4
  8. package/dist/client/preview/use-collection-preview.mjs +0 -35
  9. package/dist/client/scope/picker.d.mts +2 -2
  10. package/dist/client/scope/provider.d.mts +2 -2
  11. package/dist/client/utils/build-field-definitions-from-schema.mjs +4 -2
  12. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  13. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  14. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  15. package/dist/client/views/auth/login-form.d.mts +2 -2
  16. package/dist/client/views/collection/cells/primitive-cells.mjs +24 -10
  17. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  18. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  19. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  20. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  21. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  22. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  23. package/dist/server/modules/admin/collections/assets.d.mts +39 -39
  24. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  25. package/dist/server/modules/admin/collections/user.d.mts +63 -63
  26. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  27. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  28. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  29. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  30. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  31. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  32. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  33. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  34. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  35. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
  36. package/dist/server/modules/audit/.generated/module.d.mts +6 -6
  37. package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
  38. package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
  39. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import { BlockContent } from "./types.mjs";
2
2
  import * as React from "react";
3
- import * as react_jsx_runtime25 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/client/blocks/block-renderer.d.ts
6
6
 
@@ -50,6 +50,6 @@ declare function BlockRenderer({
50
50
  onBlockClick,
51
51
  onBlockInsert,
52
52
  className
53
- }: BlockRendererProps): react_jsx_runtime25.JSX.Element | null;
53
+ }: BlockRendererProps): react_jsx_runtime19.JSX.Element | null;
54
54
  //#endregion
55
55
  export { BlockRenderer, BlockRendererProps };
@@ -1,16 +1,40 @@
1
1
  import { cn } from "../../lib/utils.mjs";
2
+ import { isComponentReference, resolveIconElement } from "../component-renderer.mjs";
2
3
  import { useResolvedControl } from "./field-utils.mjs";
3
4
  import { FieldWrapper } from "./field-wrapper.mjs";
4
5
  import { SelectSingle } from "../primitives/select-single.mjs";
5
6
  import { SelectMulti } from "../primitives/select-multi.mjs";
7
+ import { useMemo } from "react";
6
8
  import { jsx } from "react/jsx-runtime";
7
9
  import { Controller } from "react-hook-form";
8
10
 
9
11
  //#region src/client/components/fields/select-field.tsx
12
+ /**
13
+ * Convert option icons from server-shaped ComponentReference to ReactNode,
14
+ * so primitives receive renderable icon elements.
15
+ *
16
+ * Options authored on the client (e.g. with React elements as icons) pass
17
+ * through unchanged.
18
+ */
19
+ function resolveOptionIcons(options) {
20
+ if (!options) return options;
21
+ return options.map((option) => isComponentReference(option.icon) ? {
22
+ ...option,
23
+ icon: resolveIconElement(option.icon)
24
+ } : option);
25
+ }
10
26
  function SelectField({ name, label, description, placeholder, required, disabled, localized, locale, control, className, options, loadOptions, multiple, clearable, maxSelections, emptyMessage }) {
27
+ const resolvedControl = useResolvedControl(control);
28
+ const resolvedOptions = useMemo(() => resolveOptionIcons(options), [options]);
29
+ const resolvedLoadOptions = useMemo(() => {
30
+ if (!loadOptions) return void 0;
31
+ return async (search) => {
32
+ return resolveOptionIcons(await loadOptions(search)) ?? [];
33
+ };
34
+ }, [loadOptions]);
11
35
  return /* @__PURE__ */ jsx(Controller, {
12
36
  name,
13
- control: useResolvedControl(control),
37
+ control: resolvedControl,
14
38
  render: ({ field, fieldState }) => /* @__PURE__ */ jsx(FieldWrapper, {
15
39
  name,
16
40
  label,
@@ -24,8 +48,8 @@ function SelectField({ name, label, description, placeholder, required, disabled
24
48
  id: name,
25
49
  value: Array.isArray(field.value) ? field.value : field.value != null ? [field.value] : [],
26
50
  onChange: field.onChange,
27
- options,
28
- loadOptions,
51
+ options: resolvedOptions,
52
+ loadOptions: resolvedLoadOptions,
29
53
  maxSelections,
30
54
  emptyMessage,
31
55
  placeholder,
@@ -36,8 +60,8 @@ function SelectField({ name, label, description, placeholder, required, disabled
36
60
  id: name,
37
61
  value: field.value ?? null,
38
62
  onChange: field.onChange,
39
- options,
40
- loadOptions,
63
+ options: resolvedOptions,
64
+ loadOptions: resolvedLoadOptions,
41
65
  clearable,
42
66
  emptyMessage,
43
67
  placeholder,
@@ -120,6 +120,7 @@ function SelectMulti({ value, onChange, options: staticOptions, loadOptions, que
120
120
  resolveText,
121
121
  translate
122
122
  ]);
123
+ const findOption = useCallback((val) => allOptions.find((opt) => opt.value === val), [allOptions]);
123
124
  const handleToggle = useCallback((selectedValue) => {
124
125
  const typedValue = selectedValue;
125
126
  if (resolvedValue.includes(typedValue)) onChange(resolvedValue.filter((v) => v !== typedValue));
@@ -164,24 +165,31 @@ function SelectMulti({ value, onChange, options: staticOptions, loadOptions, que
164
165
  children: [resolvedValue.length === 0 ? /* @__PURE__ */ jsx("span", {
165
166
  className: "text-muted-foreground text-xs",
166
167
  children: resolvedPlaceholder
167
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [visibleChips.map((val) => /* @__PURE__ */ jsxs(Badge, {
168
- variant: "secondary",
169
- className: "min-h-7 gap-1 pr-1",
170
- children: [/* @__PURE__ */ jsx("span", {
171
- className: "max-w-24 truncate",
172
- children: getLabel(val)
173
- }), !disabled && /* @__PURE__ */ jsx("span", {
174
- "aria-hidden": "true",
175
- title: t("field.removeItem", "Remove option"),
176
- onPointerDown: (e) => handleRemove(val, e),
177
- onClick: (e) => handleRemove(val, e),
178
- className: "hover:bg-muted-foreground/20 inline-flex size-5 items-center justify-center rounded-full transition-colors",
179
- children: /* @__PURE__ */ jsx(Icon, {
180
- icon: "ph:x",
181
- className: "size-2.5"
182
- })
183
- })]
184
- }, String(val))), hiddenCount > 0 && /* @__PURE__ */ jsxs(Badge, {
168
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [visibleChips.map((val) => {
169
+ const chipOption = findOption(val);
170
+ return /* @__PURE__ */ jsxs(Badge, {
171
+ variant: "secondary",
172
+ className: cn("min-h-7 gap-1 pr-1", chipOption?.className),
173
+ children: [
174
+ chipOption?.icon,
175
+ /* @__PURE__ */ jsx("span", {
176
+ className: "max-w-24 truncate",
177
+ children: getLabel(val)
178
+ }),
179
+ !disabled && /* @__PURE__ */ jsx("span", {
180
+ "aria-hidden": "true",
181
+ title: t("field.removeItem", "Remove option"),
182
+ onPointerDown: (e) => handleRemove(val, e),
183
+ onClick: (e) => handleRemove(val, e),
184
+ className: "hover:bg-muted-foreground/20 inline-flex size-5 items-center justify-center rounded-full transition-colors",
185
+ children: /* @__PURE__ */ jsx(Icon, {
186
+ icon: "ph:x",
187
+ className: "size-2.5"
188
+ })
189
+ })
190
+ ]
191
+ }, String(val));
192
+ }), hiddenCount > 0 && /* @__PURE__ */ jsxs(Badge, {
185
193
  variant: "outline",
186
194
  className: "text-muted-foreground",
187
195
  children: [
@@ -227,22 +235,30 @@ function SelectMulti({ value, onChange, options: staticOptions, loadOptions, que
227
235
  /* @__PURE__ */ jsx(CommandGroup, { children: filteredOptions.map((option) => {
228
236
  const isSelected = resolvedValue.includes(option.value);
229
237
  const isDisabled = option.disabled || !isSelected && !canAddMore;
238
+ const description = option.description ? resolveText(option.description) : void 0;
230
239
  return /* @__PURE__ */ jsxs(CommandItem, {
231
240
  value: String(option.value),
232
241
  onSelect: handleToggle,
233
242
  disabled: isDisabled,
243
+ className: cn("items-start", option.className),
234
244
  children: [
235
245
  /* @__PURE__ */ jsx("div", {
236
- className: cn("flex size-4 items-center justify-center border", isSelected ? "border-foreground bg-foreground text-background" : "border-muted-foreground/30"),
246
+ className: cn("mt-0.5 flex size-4 shrink-0 items-center justify-center border", isSelected ? "border-foreground bg-foreground text-background" : "border-muted-foreground/30"),
237
247
  children: isSelected && /* @__PURE__ */ jsx(Icon, {
238
248
  icon: "ph:check",
239
249
  className: "size-3"
240
250
  })
241
251
  }),
242
252
  option.icon,
243
- /* @__PURE__ */ jsx("span", {
244
- className: "truncate",
245
- children: getOptionLabel(option)
253
+ /* @__PURE__ */ jsxs("div", {
254
+ className: "flex min-w-0 flex-1 flex-col",
255
+ children: [/* @__PURE__ */ jsx("span", {
256
+ className: "truncate",
257
+ children: getOptionLabel(option)
258
+ }), description && /* @__PURE__ */ jsx("span", {
259
+ className: "text-muted-foreground truncate text-xs",
260
+ children: description
261
+ })]
246
262
  })
247
263
  ]
248
264
  }, String(option.value));
@@ -143,6 +143,7 @@ function SelectSingle({ value, onChange, options: staticOptions, loadOptions, qu
143
143
  ]);
144
144
  const showLoading = isFetching || externalLoading;
145
145
  const listboxId = `${instanceId}-listbox`;
146
+ const selectedOption = value ? allOptions.find((opt) => opt.value === value) : void 0;
146
147
  const TriggerButton = /* @__PURE__ */ jsxs(FieldSelectTrigger, {
147
148
  id,
148
149
  role: "combobox",
@@ -153,12 +154,15 @@ function SelectSingle({ value, onChange, options: staticOptions, loadOptions, qu
153
154
  hasValue: !!value,
154
155
  onKeyDown: handleTriggerKeyDown,
155
156
  asInputGroupControl,
156
- className: cn(className),
157
+ className: cn(className, selectedOption?.className),
157
158
  children: [/* @__PURE__ */ jsxs("span", {
158
159
  className: "flex min-w-0 flex-1 items-center gap-1.5 truncate",
159
160
  children: [isLoadingValue && value ? /* @__PURE__ */ jsx(Icon, {
160
161
  icon: "ph:circle-notch",
161
162
  className: "text-muted-foreground size-3 shrink-0 animate-spin"
163
+ }) : selectedOption?.icon ? /* @__PURE__ */ jsx("span", {
164
+ className: "flex shrink-0 items-center",
165
+ children: selectedOption.icon
162
166
  }) : null, /* @__PURE__ */ jsx("span", {
163
167
  className: cn("truncate", isLoadingValue && value && "text-muted-foreground"),
164
168
  children: value ? getLabel(value) : resolvedPlaceholder
@@ -198,16 +202,26 @@ function SelectSingle({ value, onChange, options: staticOptions, loadOptions, qu
198
202
  })
199
203
  }),
200
204
  /* @__PURE__ */ jsx(CommandEmpty, { children: resolvedEmptyMessage }),
201
- /* @__PURE__ */ jsx(CommandGroup, { children: filteredOptions.map((option) => /* @__PURE__ */ jsxs(CommandItem, {
202
- value: String(option.value),
203
- onSelect: handleSelect,
204
- disabled: option.disabled,
205
- "data-checked": value === option.value,
206
- children: [option.icon, /* @__PURE__ */ jsx("span", {
207
- className: "truncate",
208
- children: getOptionLabel(option)
209
- })]
210
- }, String(option.value))) })
205
+ /* @__PURE__ */ jsx(CommandGroup, { children: filteredOptions.map((option) => {
206
+ const description = option.description ? resolveText(option.description) : void 0;
207
+ return /* @__PURE__ */ jsxs(CommandItem, {
208
+ value: String(option.value),
209
+ onSelect: handleSelect,
210
+ disabled: option.disabled,
211
+ "data-checked": value === option.value,
212
+ className: cn("items-start", option.className),
213
+ children: [option.icon, /* @__PURE__ */ jsxs("div", {
214
+ className: "flex min-w-0 flex-1 flex-col",
215
+ children: [/* @__PURE__ */ jsx("span", {
216
+ className: "truncate",
217
+ children: getOptionLabel(option)
218
+ }), description && /* @__PURE__ */ jsx("span", {
219
+ className: "text-muted-foreground truncate text-xs",
220
+ children: description
221
+ })]
222
+ })]
223
+ }, String(option.value));
224
+ }) })
211
225
  ]
212
226
  })]
213
227
  });
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import * as react_jsx_runtime20 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime25 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/preview/block-scope-context.d.ts
5
5
 
@@ -35,7 +35,7 @@ declare function BlockScopeProvider({
35
35
  blockId,
36
36
  basePath,
37
37
  children
38
- }: BlockScopeProviderProps): react_jsx_runtime20.JSX.Element;
38
+ }: BlockScopeProviderProps): react_jsx_runtime25.JSX.Element;
39
39
  /**
40
40
  * Get current block scope context.
41
41
  *
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime21 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime24 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/preview/preview-banner.d.ts
4
4
 
@@ -40,6 +40,6 @@ declare function PreviewBanner({
40
40
  isPreviewMode,
41
41
  className,
42
42
  exitPreviewUrl
43
- }: PreviewBannerProps): react_jsx_runtime21.JSX.Element | null;
43
+ }: PreviewBannerProps): react_jsx_runtime24.JSX.Element | null;
44
44
  //#endregion
45
45
  export { PreviewBanner, PreviewBannerProps };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import * as react_jsx_runtime22 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime21 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/preview/preview-field.d.ts
5
5
 
@@ -68,7 +68,7 @@ declare function PreviewProvider({
68
68
  }) => void;
69
69
  onFieldValueEdited?: (payload: PreviewFieldValueEditedPayload) => void;
70
70
  children: React.ReactNode;
71
- }): react_jsx_runtime22.JSX.Element;
71
+ }): react_jsx_runtime21.JSX.Element;
72
72
  /**
73
73
  * Hook to access preview context.
74
74
  */
@@ -107,7 +107,7 @@ declare function PreviewField({
107
107
  style,
108
108
  onClick,
109
109
  onValueCommit
110
- }: PreviewFieldProps): react_jsx_runtime22.JSX.Element;
110
+ }: PreviewFieldProps): react_jsx_runtime21.JSX.Element;
111
111
  /**
112
112
  * Standalone PreviewField that works without context.
113
113
  * Useful when you can't use PreviewProvider.
@@ -131,6 +131,6 @@ declare function StandalonePreviewField({
131
131
  blockId?: string;
132
132
  fieldType?: "regular" | "block" | "relation";
133
133
  }) => void;
134
- }): react_jsx_runtime22.JSX.Element;
134
+ }): react_jsx_runtime21.JSX.Element;
135
135
  //#endregion
136
136
  export { PreviewField, PreviewFieldProps, PreviewProvider, StandalonePreviewField, usePreviewContext };
@@ -48,7 +48,6 @@ function useCollectionPreview({ initialData, onRefresh }) {
48
48
  const [isPreviewMode, setIsPreviewMode] = React.useState(false);
49
49
  const lastAppliedSeqRef = React.useRef(null);
50
50
  const initialDataRef = React.useRef(initialData);
51
- const focusScrollTimerRef = React.useRef(null);
52
51
  React.useEffect(() => {
53
52
  try {
54
53
  setIsPreviewMode(window.self !== window.top);
@@ -67,18 +66,6 @@ function useCollectionPreview({ initialData, onRefresh }) {
67
66
  React.useEffect(() => {
68
67
  if (!isPreviewMode) return;
69
68
  window.parent.postMessage({ type: "PREVIEW_READY" }, "*");
70
- const scheduleFocusScroll = (fieldPath) => {
71
- if (focusScrollTimerRef.current !== null) window.clearTimeout(focusScrollTimerRef.current);
72
- focusScrollTimerRef.current = window.setTimeout(() => {
73
- focusScrollTimerRef.current = null;
74
- const element = findPreviewFieldElement(fieldPath);
75
- if (!element || shouldSkipPreviewAutoScroll(element)) return;
76
- if (!isElementNearViewport(element)) element.scrollIntoView({
77
- behavior: "auto",
78
- block: "nearest"
79
- });
80
- }, 80);
81
- };
82
69
  const handleMessage = async (event) => {
83
70
  const message = event.data;
84
71
  if (!isPreviewAdminMessage(message)) return;
@@ -96,7 +83,6 @@ function useCollectionPreview({ initialData, onRefresh }) {
96
83
  break;
97
84
  case "FOCUS_FIELD":
98
85
  setFocusedField((current) => current === message.fieldPath ? current : message.fieldPath);
99
- scheduleFocusScroll(message.fieldPath);
100
86
  break;
101
87
  case "INIT_SNAPSHOT":
102
88
  lastAppliedSeqRef.current = message.seq;
@@ -138,10 +124,6 @@ function useCollectionPreview({ initialData, onRefresh }) {
138
124
  window.addEventListener("message", handleMessage);
139
125
  return () => {
140
126
  window.removeEventListener("message", handleMessage);
141
- if (focusScrollTimerRef.current !== null) {
142
- window.clearTimeout(focusScrollTimerRef.current);
143
- focusScrollTimerRef.current = null;
144
- }
145
127
  };
146
128
  }, [isPreviewMode]);
147
129
  const handleFieldClick = React.useCallback((fieldPath, context) => {
@@ -199,23 +181,6 @@ function isPreviewPatchOp(value) {
199
181
  const op = value;
200
182
  return (op.op === "set" || op.op === "remove") && typeof op.path === "string";
201
183
  }
202
- function findPreviewFieldElement(fieldPath) {
203
- const escaped = typeof CSS !== "undefined" && typeof CSS.escape === "function" ? CSS.escape(fieldPath) : fieldPath.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
204
- return document.querySelector(`[data-preview-field="${escaped}"]`);
205
- }
206
- function shouldSkipPreviewAutoScroll(element) {
207
- const activeElement = document.activeElement;
208
- if (activeElement && element.contains(activeElement)) return true;
209
- return element instanceof HTMLElement && element.dataset.previewEditing === "true";
210
- }
211
- function isElementNearViewport(element) {
212
- const rect = element.getBoundingClientRect();
213
- const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
214
- const viewportWidth = window.innerWidth || document.documentElement.clientWidth;
215
- const verticalMargin = Math.min(120, viewportHeight * .2);
216
- const horizontalMargin = Math.min(120, viewportWidth * .2);
217
- return rect.bottom >= -verticalMargin && rect.top <= viewportHeight + verticalMargin && rect.right >= -horizontalMargin && rect.left <= viewportWidth + horizontalMargin;
218
- }
219
184
 
220
185
  //#endregion
221
186
  export { useCollectionPreview };
@@ -1,5 +1,5 @@
1
1
  import { ScopePickerProps } from "./types.mjs";
2
- import * as react_jsx_runtime27 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime26 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/scope/picker.d.ts
5
5
 
@@ -48,6 +48,6 @@ declare function ScopePicker({
48
48
  clearText,
49
49
  className,
50
50
  compact
51
- }: ScopePickerProps): react_jsx_runtime27.JSX.Element;
51
+ }: ScopePickerProps): react_jsx_runtime26.JSX.Element;
52
52
  //#endregion
53
53
  export { ScopePicker };
@@ -1,5 +1,5 @@
1
1
  import { ScopeContextValue, ScopeProviderProps } from "./types.mjs";
2
- import * as react_jsx_runtime26 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime27 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/scope/provider.d.ts
5
5
 
@@ -29,7 +29,7 @@ declare function ScopeProvider({
29
29
  headerName,
30
30
  storageKey,
31
31
  defaultScope
32
- }: ScopeProviderProps): react_jsx_runtime26.JSX.Element;
32
+ }: ScopeProviderProps): react_jsx_runtime27.JSX.Element;
33
33
  /**
34
34
  * Hook to access the current scope context.
35
35
  *
@@ -113,11 +113,13 @@ function isNestedMetadata(m) {
113
113
  return m.type === "object" || m.type === "array" || m.type === "blocks";
114
114
  }
115
115
  /**
116
- * Apply select field config
116
+ * Apply select field config — preserves visual metadata (icon, description,
117
+ * className, disabled) so the admin UI can render rich options without
118
+ * per-project cell overrides.
117
119
  */
118
120
  function applySelectConfig(config, metadata) {
119
121
  config.options = metadata.options.map((opt) => ({
120
- value: opt.value,
122
+ ...opt,
121
123
  label: opt.label ?? String(opt.value)
122
124
  }));
123
125
  if (metadata.multiple !== void 0) config.multiple = metadata.multiple;
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/views/auth/accept-invite-form.d.ts
4
4
  /**
@@ -67,6 +67,6 @@ declare function AcceptInviteForm({
67
67
  className,
68
68
  error,
69
69
  minPasswordLength
70
- }: AcceptInviteFormProps): react_jsx_runtime2.JSX.Element;
70
+ }: AcceptInviteFormProps): react_jsx_runtime0.JSX.Element;
71
71
  //#endregion
72
72
  export { AcceptInviteForm };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/views/auth/auth-layout.d.ts
5
5
 
@@ -26,7 +26,7 @@ declare function AuthDefaultLogo({
26
26
  brandName
27
27
  }: {
28
28
  brandName: string;
29
- }): react_jsx_runtime0.JSX.Element;
29
+ }): react_jsx_runtime1.JSX.Element;
30
30
  /**
31
31
  * Minimal split layout for authentication pages (login, register, forgot password, etc.)
32
32
  *
@@ -50,6 +50,6 @@ declare function AuthDefaultLogo({
50
50
  * </AuthLayout>
51
51
  * ```
52
52
  */
53
- declare function AuthLayout(props: AuthLayoutProps): react_jsx_runtime0.JSX.Element;
53
+ declare function AuthLayout(props: AuthLayoutProps): react_jsx_runtime1.JSX.Element;
54
54
  //#endregion
55
55
  export { AuthDefaultLogo, AuthLayout, AuthLayoutProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/views/auth/forgot-password-form.d.ts
4
4
  /**
@@ -53,6 +53,6 @@ declare function ForgotPasswordForm({
53
53
  defaultValues,
54
54
  className,
55
55
  error
56
- }: ForgotPasswordFormProps): react_jsx_runtime4.JSX.Element;
56
+ }: ForgotPasswordFormProps): react_jsx_runtime3.JSX.Element;
57
57
  //#endregion
58
58
  export { ForgotPasswordForm };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/views/auth/login-form.d.ts
4
4
  /**
@@ -70,6 +70,6 @@ declare function LoginForm({
70
70
  className,
71
71
  error,
72
72
  minPasswordLength
73
- }: LoginFormProps): react_jsx_runtime3.JSX.Element;
73
+ }: LoginFormProps): react_jsx_runtime4.JSX.Element;
74
74
  //#endregion
75
75
  export { LoginForm };
@@ -1,4 +1,7 @@
1
1
  import { useResolveText, useTranslation } from "../../../i18n/hooks.mjs";
2
+ import { cn } from "../../../lib/utils.mjs";
3
+ import { resolveIconElement } from "../../../components/component-renderer.mjs";
4
+ import { flattenOptions } from "../../../components/primitives/types.mjs";
2
5
  import { resolveOptionLabelForValue } from "../../../components/primitives/option-label.mjs";
3
6
  import { Badge } from "../../../components/ui/badge.mjs";
4
7
  import "react";
@@ -156,6 +159,10 @@ function getSelectOptions(fieldDef) {
156
159
  const options = fieldDef?.["~options"]?.options;
157
160
  return Array.isArray(options) ? options : void 0;
158
161
  }
162
+ function findSelectOption(options, value) {
163
+ if (!options) return void 0;
164
+ return flattenOptions(options).find((opt) => String(opt.value) === String(value));
165
+ }
159
166
  function resolveSelectCellLabel({ value, fieldDef, resolveText, t, locale }) {
160
167
  return resolveOptionLabelForValue({
161
168
  value,
@@ -172,18 +179,25 @@ function SelectCell({ value, fieldDef }) {
172
179
  className: "text-muted-foreground",
173
180
  children: "-"
174
181
  });
182
+ const values = Array.isArray(value) ? value : [value];
183
+ const options = getSelectOptions(fieldDef);
175
184
  return /* @__PURE__ */ jsx("span", {
176
185
  className: "inline-flex max-w-[300px] flex-wrap gap-1",
177
- children: (Array.isArray(value) ? value : [value]).map((item, index) => /* @__PURE__ */ jsx(Badge, {
178
- variant: "outline",
179
- children: resolveSelectCellLabel({
180
- value: item,
181
- fieldDef,
182
- resolveText,
183
- t,
184
- locale
185
- })
186
- }, `${String(item)}-${index}`))
186
+ children: values.map((item, index) => {
187
+ const option = findSelectOption(options, item);
188
+ const icon = resolveIconElement(option?.icon);
189
+ return /* @__PURE__ */ jsxs(Badge, {
190
+ variant: "outline",
191
+ className: cn("gap-1", option?.className),
192
+ children: [icon, resolveSelectCellLabel({
193
+ value: item,
194
+ fieldDef,
195
+ resolveText,
196
+ t,
197
+ locale
198
+ })]
199
+ }, `${String(item)}-${index}`);
200
+ })
187
201
  });
188
202
  }
189
203
 
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime17 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime20 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/rich-text/rich-text-renderer.d.ts
4
4
  /**
@@ -98,6 +98,6 @@ declare function RichTextRenderer({
98
98
  content,
99
99
  styles: customStyles,
100
100
  className
101
- }: RichTextRendererProps): react_jsx_runtime17.JSX.Element | null;
101
+ }: RichTextRendererProps): react_jsx_runtime20.JSX.Element | null;
102
102
  //#endregion
103
103
  export { RichTextRenderer, RichTextStyles, TipTapDoc, TipTapNode };