@dimah-s3/ui 2.0.0-beta.8 → 2.0.0-beta.9

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 (25) hide show
  1. package/dist/components/dimah-s3/attachment/file-name.d.ts +6 -1
  2. package/dist/components/dimah-s3/attachment/file-name.d.ts.map +1 -1
  3. package/dist/components/dimah-s3/list/object-list-context.d.ts +22 -0
  4. package/dist/components/dimah-s3/list/object-list-context.d.ts.map +1 -1
  5. package/dist/components/dimah-s3/list/object-list-controls.d.ts +0 -24
  6. package/dist/components/dimah-s3/list/object-list-controls.d.ts.map +1 -1
  7. package/dist/components/dimah-s3/list/object-list-entry.d.ts.map +1 -1
  8. package/dist/components/dimah-s3/list/object-list-feedback.d.ts +4 -3
  9. package/dist/components/dimah-s3/list/object-list-feedback.d.ts.map +1 -1
  10. package/dist/components/dimah-s3/list/object-list-header.d.ts +9 -11
  11. package/dist/components/dimah-s3/list/object-list-header.d.ts.map +1 -1
  12. package/dist/components/dimah-s3/list/object-list-item-menu.d.ts +2 -0
  13. package/dist/components/dimah-s3/list/object-list-item-menu.d.ts.map +1 -1
  14. package/dist/components/dimah-s3/list/object-list-keyboard.d.ts +1 -0
  15. package/dist/components/dimah-s3/list/object-list-keyboard.d.ts.map +1 -1
  16. package/dist/components/dimah-s3/list/object-list-search.d.ts +75 -0
  17. package/dist/components/dimah-s3/list/object-list-search.d.ts.map +1 -0
  18. package/dist/components/dimah-s3/list/object-list-states.d.ts +7 -2
  19. package/dist/components/dimah-s3/list/object-list-states.d.ts.map +1 -1
  20. package/dist/components/dimah-s3/list/object-list.d.ts.map +1 -1
  21. package/dist/index.d.ts +2 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +546 -172
  24. package/dist/index.js.map +1 -1
  25. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createContext, memo, useId, useRef, useState, useEffect, useSyncExternalStore, useContext, useCallback, useMemo, useEffectEvent, useLayoutEffect } from 'react';
3
3
  import { objectKeyOf, truncateFileName, mergeUploadRequest } from '@dimah-s3/react/engine';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
- import { CheckIcon, XIcon, MoreHorizontalIcon, Loader2Icon, CloudUpload, PencilIcon, LoaderIcon, DownloadIcon, LinkIcon, Trash2Icon, RotateCwIcon, PauseIcon, BanIcon, FileUpIcon, CameraIcon, SearchIcon, HomeIcon, FolderIcon, FolderPlusIcon, ArrowDownUpIcon, ListIcon, LayoutGridIcon, UserIcon, LoaderCircleIcon, AlertCircleIcon, CheckCircleIcon, ChevronRightIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon } from 'lucide-react';
5
+ import { CheckIcon, XIcon, MoreHorizontalIcon, FolderIcon, ChevronRightIcon, Loader2Icon, FolderOpenIcon, CloudUpload, PencilIcon, LoaderIcon, DownloadIcon, LinkIcon, Trash2Icon, RotateCwIcon, PauseIcon, BanIcon, FileUpIcon, CameraIcon, SearchIcon, HomeIcon, FolderPlusIcon, ArrowDownUpIcon, ListIcon, LayoutGridIcon, UserIcon, LoaderCircleIcon, AlertCircleIcon, CheckCircleIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon } from 'lucide-react';
6
6
  import { useTranslations } from '@fuma-translate/react';
7
7
  import { cn } from 'cn';
8
8
  import { Button as Button$1 } from '@base-ui/react/button';
@@ -11,9 +11,9 @@ import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
11
11
  import { useFormatFileSize, useFormatDate, useFormatError, useFormatNumber, useFormatEta, useFormatAcceptLabels, useUploadLimit, useObjectUrl } from '@dimah-s3/react';
12
12
  import { mergeProps } from '@base-ui/react/merge-props';
13
13
  import { useRender } from '@base-ui/react/use-render';
14
+ import { findSearchMatches, fileNameFromKey, isS3ErrorCode } from '@dimah-s3/core';
14
15
  import { FileIcon, defaultStyles } from 'react-file-icon';
15
16
  import { Toast as Toast$1 } from '@base-ui/react/toast';
16
- import { fileNameFromKey, isS3ErrorCode } from '@dimah-s3/core';
17
17
  import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
18
18
  import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
19
19
  import { Menu } from '@base-ui/react/menu';
@@ -39,6 +39,10 @@ function createObjectListEntryStore(initial) {
39
39
  }
40
40
  };
41
41
  }
42
+ var ObjectListHeaderContext = createContext(null);
43
+ function useOptionalObjectListHeader() {
44
+ return useContext(ObjectListHeaderContext);
45
+ }
42
46
  var ObjectListContext = createContext(
43
47
  null
44
48
  );
@@ -674,13 +678,40 @@ function splitFileName(name) {
674
678
  if (!FILE_EXTENSION.test(extension)) return { stem: name, extension: "" };
675
679
  return { stem: name.slice(0, dot), extension };
676
680
  }
681
+ function markMatches(text, offset, ranges) {
682
+ if (ranges.length === 0) return text;
683
+ const parts = [];
684
+ let at = 0;
685
+ for (const [start, end] of ranges) {
686
+ const from = Math.max(start - offset, at);
687
+ const to = Math.min(end - offset, text.length);
688
+ if (to <= from) continue;
689
+ if (from > at) parts.push(text.slice(at, from));
690
+ parts.push(
691
+ /* @__PURE__ */ jsx(
692
+ "mark",
693
+ {
694
+ "data-slot": "file-name-match",
695
+ className: "rounded-[2px] bg-dimah-s3-warning/30 text-inherit",
696
+ children: text.slice(from, to)
697
+ },
698
+ from
699
+ )
700
+ );
701
+ at = to;
702
+ }
703
+ if (at < text.length) parts.push(text.slice(at));
704
+ return parts;
705
+ }
677
706
  function FileName({
678
707
  name,
679
708
  extension: keepExtension = true,
709
+ highlight,
680
710
  className,
681
711
  ...props
682
712
  }) {
683
713
  const { stem, extension } = keepExtension ? splitFileName(name) : { stem: name, extension: "" };
714
+ const ranges = highlight ? findSearchMatches(name, highlight) : [];
684
715
  return /* @__PURE__ */ jsxs(
685
716
  "span",
686
717
  {
@@ -690,8 +721,8 @@ function FileName({
690
721
  ...props,
691
722
  className: cn("inline-flex max-w-full min-w-0 align-top", className),
692
723
  children: [
693
- /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: stem }),
694
- extension ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: extension }) : null
724
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: markMatches(stem, 0, ranges) }),
725
+ extension ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: markMatches(extension, stem.length, ranges) }) : null
695
726
  ]
696
727
  }
697
728
  );
@@ -3304,7 +3335,8 @@ function useObjectListAnnouncement() {
3304
3335
  }
3305
3336
  function ObjectListAnnouncer({
3306
3337
  announcement,
3307
- status
3338
+ status,
3339
+ search = null
3308
3340
  }) {
3309
3341
  return /* @__PURE__ */ jsxs(
3310
3342
  "div",
@@ -3314,6 +3346,7 @@ function ObjectListAnnouncer({
3314
3346
  "aria-live": "polite",
3315
3347
  children: [
3316
3348
  /* @__PURE__ */ jsx("p", { "data-slot": "object-list-status", children: status }),
3349
+ /* @__PURE__ */ jsx("p", { "data-slot": "object-list-search-announcement", children: search }),
3317
3350
  announcement ? /* @__PURE__ */ jsxs("p", { children: [
3318
3351
  announcement.feedback.title,
3319
3352
  announcement.feedback.description != null ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -3473,6 +3506,7 @@ function ObjectListItemMenu({
3473
3506
  const objectKey = objectKeyProp ?? (file ? objectKeyOf(file) : "");
3474
3507
  const isFile = objectKey !== "";
3475
3508
  const rows = {
3509
+ reveal: entry?.location != null && Boolean(scope?.search),
3476
3510
  // A folder takes uploads only when the source can place files in it.
3477
3511
  upload: folder != null && scope?.folderUploads === true,
3478
3512
  download: isFile && scope?.download === true,
@@ -3547,7 +3581,15 @@ function ItemMenuItems({
3547
3581
  const showTransfer = download != null || linkSource != null;
3548
3582
  const showExtra = rows.extra;
3549
3583
  const canRename = rows.rename && context != null && entryKey != null;
3584
+ const entry = useObjectListEntry();
3585
+ const reveal = rows.reveal && context != null && entry != null ? () => context.revealEntry(entry) : null;
3586
+ const showMain = uploadToFolder != null || showTransfer || canRename;
3550
3587
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3588
+ reveal ? /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: reveal, children: [
3589
+ /* @__PURE__ */ jsx(FolderOpenIcon, {}),
3590
+ t("Show in folder", { note: "object list menu" })
3591
+ ] }) }) : null,
3592
+ reveal && (showMain || showExtra || rows.delete) ? /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) : null,
3551
3593
  uploadToFolder || showTransfer || canRename ? /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
3552
3594
  uploadToFolder ? /* @__PURE__ */ jsxs(
3553
3595
  DropdownMenuItem,
@@ -3896,6 +3938,389 @@ function ObjectListRenameField({
3896
3938
  }
3897
3939
  );
3898
3940
  }
3941
+ var ENTRY_TRIGGER = "[data-slot=object-list-entry-trigger]";
3942
+ function canChooseSearchScope(list) {
3943
+ return list.parent != null && list.searchScopes.includes("folder") && list.searchScopes.includes("all");
3944
+ }
3945
+ function ObjectListSearch({
3946
+ placeholder,
3947
+ delay = 250,
3948
+ collapsible = true,
3949
+ className
3950
+ }) {
3951
+ const t = useTranslations();
3952
+ const { list } = useObjectListContext();
3953
+ const header = useOptionalObjectListHeader();
3954
+ const { setSearch } = list;
3955
+ const [draft, setDraft] = useState(null);
3956
+ const value = draft ?? list.search;
3957
+ const defaultLabel = useSearchPlaceholder(list);
3958
+ const label = placeholder ?? defaultLabel;
3959
+ const collapses = collapsible && header != null;
3960
+ const [open, setOpen] = useState(false);
3961
+ const expanded = !collapses || open || value !== "";
3962
+ const inputRef = useRef(null);
3963
+ const buttonRef = useRef(null);
3964
+ const rootRef = useRef(null);
3965
+ const focusRef = useRef(null);
3966
+ const loading = draft != null && draft.trim() !== list.search.trim() || list.isSearching && (list.isLoading || list.isRefreshing);
3967
+ useEffect(() => {
3968
+ if (draft == null) return;
3969
+ const timer = window.setTimeout(() => {
3970
+ setSearch(draft);
3971
+ setDraft(null);
3972
+ }, delay);
3973
+ return () => window.clearTimeout(timer);
3974
+ }, [delay, draft, setSearch]);
3975
+ const setSearchExpanded = header?.setSearchExpanded;
3976
+ useLayoutEffect(() => {
3977
+ if (!collapses || !setSearchExpanded) return;
3978
+ setSearchExpanded(expanded);
3979
+ return () => setSearchExpanded(false);
3980
+ }, [collapses, expanded, setSearchExpanded]);
3981
+ useEffect(() => {
3982
+ const target = focusRef.current;
3983
+ if (!target) return;
3984
+ focusRef.current = null;
3985
+ (target === "input" ? inputRef : buttonRef).current?.focus();
3986
+ });
3987
+ useEffect(() => {
3988
+ if (!collapses || !open || value !== "") return;
3989
+ if (rootRef.current?.contains(document.activeElement)) return;
3990
+ setOpen(false);
3991
+ }, [collapses, open, value]);
3992
+ function commit(next) {
3993
+ setDraft(null);
3994
+ setSearch(next);
3995
+ }
3996
+ function close() {
3997
+ commit("");
3998
+ setOpen(false);
3999
+ focusRef.current = "button";
4000
+ }
4001
+ function onKeyDown(event) {
4002
+ if (event.key === "Enter") commit(value);
4003
+ if (event.key === "ArrowDown") {
4004
+ event.preventDefault();
4005
+ if (loading) {
4006
+ if (draft != null) commit(draft);
4007
+ return;
4008
+ }
4009
+ const frame = event.currentTarget.closest("[data-slot=object-list]");
4010
+ const entry = frame?.querySelector(`${ENTRY_TRIGGER}[tabindex="0"]`) ?? frame?.querySelector(ENTRY_TRIGGER);
4011
+ entry?.focus();
4012
+ return;
4013
+ }
4014
+ if (event.key !== "Escape") return;
4015
+ if (value) {
4016
+ event.preventDefault();
4017
+ commit("");
4018
+ } else if (collapses) {
4019
+ event.preventDefault();
4020
+ close();
4021
+ }
4022
+ }
4023
+ if (!expanded) {
4024
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
4025
+ /* @__PURE__ */ jsx(
4026
+ TooltipTrigger,
4027
+ {
4028
+ render: /* @__PURE__ */ jsx(
4029
+ Button,
4030
+ {
4031
+ ref: buttonRef,
4032
+ type: "button",
4033
+ variant: "ghost",
4034
+ size: "icon-sm",
4035
+ "data-slot": "object-list-search",
4036
+ "aria-label": label,
4037
+ "aria-keyshortcuts": "/",
4038
+ className,
4039
+ onClick: () => {
4040
+ focusRef.current = "input";
4041
+ setOpen(true);
4042
+ }
4043
+ }
4044
+ ),
4045
+ children: /* @__PURE__ */ jsx(SearchIcon, {})
4046
+ }
4047
+ ),
4048
+ /* @__PURE__ */ jsx(TooltipContent, { children: label })
4049
+ ] });
4050
+ }
4051
+ const spinner = loading ? /* @__PURE__ */ jsx(
4052
+ Spinner,
4053
+ {
4054
+ className: "size-3.5 text-dimah-s3-muted-foreground",
4055
+ "aria-label": t("Searching", { note: "object list search" })
4056
+ }
4057
+ ) : null;
4058
+ return /* @__PURE__ */ jsxs(
4059
+ "div",
4060
+ {
4061
+ ref: rootRef,
4062
+ "data-slot": "object-list-search",
4063
+ "data-expanded": "",
4064
+ "data-loading": loading ? "" : void 0,
4065
+ className: cn(
4066
+ "relative flex min-w-0 items-center",
4067
+ collapses ? "w-full flex-1" : "w-40 sm:w-52",
4068
+ className
4069
+ ),
4070
+ onBlur: (event) => {
4071
+ if (!collapses || value !== "") return;
4072
+ const next = event.relatedTarget;
4073
+ if (next instanceof Node && event.currentTarget.contains(next)) return;
4074
+ setOpen(false);
4075
+ },
4076
+ children: [
4077
+ /* @__PURE__ */ jsx(
4078
+ SearchIcon,
4079
+ {
4080
+ "aria-hidden": true,
4081
+ className: "pointer-events-none absolute start-2.5 size-3.5 text-dimah-s3-muted-foreground"
4082
+ }
4083
+ ),
4084
+ /* @__PURE__ */ jsx(
4085
+ "input",
4086
+ {
4087
+ ref: inputRef,
4088
+ type: "search",
4089
+ value,
4090
+ placeholder: label,
4091
+ "aria-label": label,
4092
+ "aria-keyshortcuts": "/",
4093
+ "aria-busy": loading || void 0,
4094
+ autoComplete: "off",
4095
+ spellCheck: false,
4096
+ enterKeyHint: "search",
4097
+ className: cn(
4098
+ "w-full min-w-0 rounded-md border border-dimah-s3-border bg-transparent ps-8 text-sm text-dimah-s3-foreground outline-none placeholder:text-dimah-s3-muted-foreground focus-visible:border-dimah-s3-ring focus-visible:ring-3 focus-visible:ring-dimah-s3-ring/50 [&::-webkit-search-cancel-button]:appearance-none",
4099
+ collapses ? "h-8 pe-14" : "h-7 pe-12"
4100
+ ),
4101
+ onChange: (event) => setDraft(event.target.value),
4102
+ onKeyDown
4103
+ }
4104
+ ),
4105
+ collapses ? /* @__PURE__ */ jsxs("div", { className: "absolute end-1.5 flex items-center gap-1", children: [
4106
+ spinner,
4107
+ /* @__PURE__ */ jsx(
4108
+ Button,
4109
+ {
4110
+ type: "button",
4111
+ variant: "ghost",
4112
+ size: "icon-xs",
4113
+ "aria-label": t("Close search", { note: "object list" }),
4114
+ onClick: close,
4115
+ children: /* @__PURE__ */ jsx(XIcon, {})
4116
+ }
4117
+ )
4118
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "absolute end-1 flex items-center gap-1", children: [
4119
+ spinner,
4120
+ value ? /* @__PURE__ */ jsx(
4121
+ "button",
4122
+ {
4123
+ type: "button",
4124
+ "aria-label": t("Clear search", { note: "object list" }),
4125
+ className: "flex size-5 items-center justify-center rounded-sm text-dimah-s3-muted-foreground outline-none hover:text-dimah-s3-foreground focus-visible:ring-2 focus-visible:ring-dimah-s3-ring/50",
4126
+ onClick: () => commit(""),
4127
+ children: /* @__PURE__ */ jsx(XIcon, { className: "size-3.5" })
4128
+ }
4129
+ ) : null
4130
+ ] })
4131
+ ]
4132
+ }
4133
+ );
4134
+ }
4135
+ function useSearchPlaceholder(list) {
4136
+ const t = useTranslations();
4137
+ const folder = list.trail.at(-1);
4138
+ if (!folder || list.searchScopes.length === 0) {
4139
+ return t("Search files", { note: "object list" });
4140
+ }
4141
+ if (list.searchScope === "all" && canChooseSearchScope(list)) {
4142
+ return t("Search all files", { note: "object list search" });
4143
+ }
4144
+ return t("Search in \u201C{folder}\u201D", {
4145
+ note: "object list search",
4146
+ variables: { folder: folder.name }
4147
+ });
4148
+ }
4149
+ function useObjectListSearchStatus(list) {
4150
+ const t = useTranslations();
4151
+ const formatNumber = useFormatNumber();
4152
+ if (!list.isSearching) return null;
4153
+ if (list.isLoading || list.isRefreshing) {
4154
+ return {
4155
+ label: t("Searching\u2026", { note: "object list search" }),
4156
+ settled: false
4157
+ };
4158
+ }
4159
+ if (list.error) return null;
4160
+ const files = list.total ?? list.items.length;
4161
+ const count = list.folders.length + files;
4162
+ const more = list.total == null && list.hasMore;
4163
+ if (count === 0) {
4164
+ return { label: t("No results", { note: "object list" }), settled: true };
4165
+ }
4166
+ if (more) {
4167
+ return {
4168
+ label: t("{count}+ results", {
4169
+ note: "object list search",
4170
+ variables: { count: formatNumber(count) }
4171
+ }),
4172
+ settled: true
4173
+ };
4174
+ }
4175
+ return {
4176
+ label: count === 1 ? t("1 result", { note: "object list search" }) : t("{count} results", {
4177
+ note: "object list search",
4178
+ variables: { count: formatNumber(count) }
4179
+ }),
4180
+ settled: true
4181
+ };
4182
+ }
4183
+ function ObjectListSearchBar({ className }) {
4184
+ const t = useTranslations();
4185
+ const { list, label: rootLabel } = useObjectListContext();
4186
+ const status = useObjectListSearchStatus(list);
4187
+ if (!status) return null;
4188
+ const folder = list.trail.at(-1);
4189
+ const choose = canChooseSearchScope(list);
4190
+ const inLabel = t("Search in", { note: "object list search" });
4191
+ return /* @__PURE__ */ jsxs(
4192
+ "div",
4193
+ {
4194
+ "data-slot": "object-list-search-bar",
4195
+ className: cn(
4196
+ "flex min-h-9 min-w-0 items-center gap-2 px-2 py-1 text-xs text-dimah-s3-muted-foreground",
4197
+ className
4198
+ ),
4199
+ children: [
4200
+ /* @__PURE__ */ jsx("span", { className: "shrink-0", children: inLabel }),
4201
+ choose && folder ? /* @__PURE__ */ jsxs(
4202
+ "div",
4203
+ {
4204
+ role: "radiogroup",
4205
+ "aria-label": inLabel,
4206
+ className: "flex min-w-0 items-center gap-0.5 rounded-lg border border-dimah-s3-border p-0.5",
4207
+ children: [
4208
+ /* @__PURE__ */ jsx(
4209
+ ScopeChoice,
4210
+ {
4211
+ scope: "folder",
4212
+ current: list.searchScope,
4213
+ onSelect: list.setSearchScope,
4214
+ icon: /* @__PURE__ */ jsx(FolderIcon, { "aria-hidden": true }),
4215
+ label: folder.name
4216
+ }
4217
+ ),
4218
+ /* @__PURE__ */ jsx(
4219
+ ScopeChoice,
4220
+ {
4221
+ scope: "all",
4222
+ current: list.searchScope,
4223
+ onSelect: list.setSearchScope,
4224
+ icon: /* @__PURE__ */ jsx(HomeIcon, { "aria-hidden": true }),
4225
+ label: rootLabel
4226
+ }
4227
+ )
4228
+ ]
4229
+ }
4230
+ ) : /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1 font-medium text-dimah-s3-foreground", children: [
4231
+ folder ? /* @__PURE__ */ jsx(FolderIcon, { "aria-hidden": true, className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx(HomeIcon, { "aria-hidden": true, className: "size-3.5 shrink-0" }),
4232
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: /* @__PURE__ */ jsx("bdi", { children: folder?.name ?? rootLabel }) })
4233
+ ] }),
4234
+ /* @__PURE__ */ jsx(
4235
+ "span",
4236
+ {
4237
+ "data-slot": "object-list-search-status",
4238
+ className: "ms-auto shrink-0 tabular-nums",
4239
+ children: status.label
4240
+ }
4241
+ )
4242
+ ]
4243
+ }
4244
+ );
4245
+ }
4246
+ function ScopeChoice({
4247
+ scope,
4248
+ current,
4249
+ onSelect,
4250
+ icon,
4251
+ label
4252
+ }) {
4253
+ const checked = scope === current;
4254
+ return /* @__PURE__ */ jsxs(
4255
+ Button,
4256
+ {
4257
+ type: "button",
4258
+ variant: "ghost",
4259
+ size: "xs",
4260
+ role: "radio",
4261
+ "aria-checked": checked,
4262
+ tabIndex: checked ? 0 : -1,
4263
+ className: "min-w-0 aria-checked:bg-dimah-s3-muted aria-checked:text-dimah-s3-foreground",
4264
+ onClick: () => onSelect(scope),
4265
+ onKeyDown: (event) => {
4266
+ if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(
4267
+ event.key
4268
+ )) {
4269
+ return;
4270
+ }
4271
+ event.preventDefault();
4272
+ const next = scope === "folder" ? "all" : "folder";
4273
+ onSelect(next);
4274
+ const group = event.currentTarget.parentElement;
4275
+ requestAnimationFrame(
4276
+ () => group?.querySelector("[role=radio][aria-checked=true]")?.focus()
4277
+ );
4278
+ },
4279
+ children: [
4280
+ icon,
4281
+ /* @__PURE__ */ jsx("span", { className: "max-w-32 truncate", children: /* @__PURE__ */ jsx("bdi", { children: label }) })
4282
+ ]
4283
+ }
4284
+ );
4285
+ }
4286
+ function ObjectListLocation({
4287
+ location,
4288
+ className
4289
+ }) {
4290
+ const { label: rootLabel } = useObjectListContext();
4291
+ const names = location.length === 0 ? [rootLabel] : location.map((folder) => folder.name);
4292
+ const shown = names.length > 2 ? ["\u2026", ...names.slice(-2)] : names;
4293
+ return /* @__PURE__ */ jsxs(
4294
+ "span",
4295
+ {
4296
+ "data-slot": "object-list-location",
4297
+ title: [rootLabel, ...location.map((folder) => folder.name)].join(" / "),
4298
+ className: cn("min-w-0", className),
4299
+ children: [
4300
+ /* @__PURE__ */ jsx(
4301
+ FolderIcon,
4302
+ {
4303
+ "aria-hidden": true,
4304
+ className: "me-1 inline-block size-3 shrink-0 align-[-0.125rem]"
4305
+ }
4306
+ ),
4307
+ shown.map((name, index) => /* @__PURE__ */ jsxs("span", { children: [
4308
+ index > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
4309
+ /* @__PURE__ */ jsx(
4310
+ ChevronRightIcon,
4311
+ {
4312
+ "aria-hidden": true,
4313
+ className: "mx-0.5 inline-block size-3 align-[-0.125rem] rtl:rotate-180"
4314
+ }
4315
+ ),
4316
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: " / " })
4317
+ ] }) : null,
4318
+ /* @__PURE__ */ jsx("bdi", { children: name })
4319
+ ] }, index))
4320
+ ]
4321
+ }
4322
+ );
4323
+ }
3899
4324
  function ObjectListCheckbox({
3900
4325
  checked,
3901
4326
  indeterminate,
@@ -3929,6 +4354,7 @@ function ObjectListCheckbox({
3929
4354
  );
3930
4355
  }
3931
4356
  var DROP_TARGET = "data-drag-active:bg-dimah-s3-primary/10 data-drag-active:ring-2 data-drag-active:ring-dimah-s3-primary data-drag-active:ring-inset";
4357
+ var REVEALED = "data-revealed:bg-dimah-s3-primary/15";
3932
4358
  var ObjectListRow = memo(function ObjectListRow2(props) {
3933
4359
  const { entry, className } = props;
3934
4360
  const parts = useEntryParts(props);
@@ -3947,6 +4373,7 @@ var ObjectListRow = memo(function ObjectListRow2(props) {
3947
4373
  parts.checkbox ? parts.actions ? "grid-cols-[auto_minmax(0,1fr)_auto]" : "grid-cols-[auto_minmax(0,1fr)]" : parts.actions ? "grid-cols-[minmax(0,1fr)_auto]" : "grid-cols-[minmax(0,1fr)]",
3948
4374
  parts.selected ? "bg-dimah-s3-primary/10 hover:bg-dimah-s3-primary/15" : "hover:bg-dimah-s3-muted",
3949
4375
  DROP_TARGET,
4376
+ REVEALED,
3950
4377
  className
3951
4378
  ),
3952
4379
  children: [
@@ -3970,7 +4397,14 @@ var ObjectListRow = memo(function ObjectListRow2(props) {
3970
4397
  ),
3971
4398
  children: [
3972
4399
  /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
3973
- /* @__PURE__ */ jsx("span", { className: "block w-full min-w-0 overflow-hidden text-sm leading-snug text-dimah-s3-foreground", children: /* @__PURE__ */ jsx(FileName, { name: entry.name, extension: entry.kind === "file" }) }),
4400
+ /* @__PURE__ */ jsx("span", { className: "block w-full min-w-0 overflow-hidden text-sm leading-snug text-dimah-s3-foreground", children: /* @__PURE__ */ jsx(
4401
+ FileName,
4402
+ {
4403
+ name: entry.name,
4404
+ extension: entry.kind === "file",
4405
+ highlight: parts.highlight
4406
+ }
4407
+ ) }),
3974
4408
  parts.meta ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: parts.meta }) : null
3975
4409
  ] }),
3976
4410
  parts.description ? /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-xs leading-4 text-dimah-s3-muted-foreground", children: parts.description }) : null
@@ -4002,6 +4436,7 @@ var ObjectListTile = memo(function ObjectListTile2(props) {
4002
4436
  "group/entry relative flex h-full min-w-0 flex-col overflow-hidden rounded-lg border transition-colors duration-150",
4003
4437
  parts.selected ? "border-dimah-s3-primary bg-dimah-s3-primary/10" : "border-dimah-s3-border hover:bg-dimah-s3-muted",
4004
4438
  DROP_TARGET,
4439
+ REVEALED,
4005
4440
  className
4006
4441
  ),
4007
4442
  children: [
@@ -4017,7 +4452,14 @@ var ObjectListTile = memo(function ObjectListTile2(props) {
4017
4452
  /* @__PURE__ */ jsx("span", { className: "flex aspect-[4/3] w-full items-center justify-center overflow-hidden bg-dimah-s3-muted/60", children: parts.media ?? /* @__PURE__ */ jsx(EntryMedia, { entry, tile: true }) }),
4018
4453
  /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col gap-0.5 px-2 py-1.5", children: [
4019
4454
  /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
4020
- /* @__PURE__ */ jsx("span", { className: "block min-w-0 flex-1 overflow-hidden text-sm leading-snug text-dimah-s3-foreground", children: /* @__PURE__ */ jsx(FileName, { name: entry.name, extension: entry.kind === "file" }) }),
4455
+ /* @__PURE__ */ jsx("span", { className: "block min-w-0 flex-1 overflow-hidden text-sm leading-snug text-dimah-s3-foreground", children: /* @__PURE__ */ jsx(
4456
+ FileName,
4457
+ {
4458
+ name: entry.name,
4459
+ extension: entry.kind === "file",
4460
+ highlight: parts.highlight
4461
+ }
4462
+ ) }),
4021
4463
  parts.meta ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: parts.meta }) : null
4022
4464
  ] }),
4023
4465
  parts.description ? /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-xs leading-4 text-dimah-s3-muted-foreground", children: parts.description }) : null
@@ -4050,12 +4492,13 @@ function useEntryParts({
4050
4492
  const t = useTranslations();
4051
4493
  const scope = useObjectListEntryScope();
4052
4494
  const { selected, selectable, selecting, renaming, tabStop } = useObjectListEntryStatus(entry.key);
4053
- const defaultDescription = useDefaultDescription(entry);
4495
+ const location = scope.search ? entry.location : void 0;
4496
+ const defaultDescription = useDefaultDescription(entry, location);
4054
4497
  const folder = entry.kind === "folder";
4055
4498
  const canRename = folder ? scope.renameFolder : scope.renameFile;
4056
4499
  const opens = folder || scope.opensFiles;
4057
4500
  const takesDrops = folder && scope.folderUploads;
4058
- const hasMenu = folder ? takesDrops || canRename : scope.download || scope.share || scope.delete || canRename;
4501
+ const hasMenu = location != null || (folder ? takesDrops || canRename : scope.download || scope.share || scope.delete || canRename);
4059
4502
  const resolvedActions = actions !== void 0 ? actions : scope.renderActions ? scope.renderActions(entry) : hasMenu ? /* @__PURE__ */ jsx(ObjectListItemMenu, {}) : null;
4060
4503
  return {
4061
4504
  selected,
@@ -4081,6 +4524,7 @@ function useEntryParts({
4081
4524
  meta: present(meta !== void 0 ? meta : scope.renderMeta?.(entry)),
4082
4525
  media: present(media),
4083
4526
  dropTarget: takesDrops ? scope.folderDropTarget(entry.id) : null,
4527
+ highlight: scope.search || void 0,
4084
4528
  entryKey: entry.key,
4085
4529
  onClick: opens || selectable ? (event) => {
4086
4530
  if (selectable) {
@@ -4161,15 +4605,19 @@ function EntryMedia({
4161
4605
  }
4162
4606
  );
4163
4607
  }
4164
- function useDefaultDescription(entry) {
4608
+ function useDefaultDescription(entry, location) {
4165
4609
  const formatFileSize = useFormatFileSize();
4166
4610
  const formatDate = useFormatDate();
4167
- if (entry.kind === "folder") return null;
4168
- const parts = [
4611
+ const parts = entry.kind === "folder" ? [] : [
4169
4612
  entry.file.size != null ? formatFileSize(entry.file.size) : "",
4170
4613
  formatDate(entry.file.updatedAt)
4171
4614
  ].filter(Boolean);
4172
- return parts.length > 0 ? parts.join(" \xB7 ") : null;
4615
+ const details = parts.length > 0 ? parts.join(" \xB7 ") : null;
4616
+ if (!location) return details;
4617
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
4618
+ /* @__PURE__ */ jsx(ObjectListLocation, { location }),
4619
+ details ? ` \xB7 ${details}` : null
4620
+ ] });
4173
4621
  }
4174
4622
  function present(node) {
4175
4623
  return node == null || node === false || node === "" ? null : node;
@@ -4281,10 +4729,19 @@ function ObjectListEmpty({
4281
4729
  const t = useTranslations();
4282
4730
  const { list, upload } = useObjectListContext();
4283
4731
  const search = list.search.trim();
4732
+ const folder = list.trail.at(-1);
4733
+ const recursive = list.searchScopes.length > 0;
4734
+ const everywhere = canChooseSearchScope(list) && list.searchScope === "folder";
4284
4735
  const defaultTitle = search ? t("No results", { note: "object list" }) : t("This folder is empty", { note: "object list" });
4285
- const defaultDescription = search ? t("Nothing in this folder matches \u201C{search}\u201D.", {
4736
+ const defaultDescription = search ? !recursive && folder ? t("Nothing in this folder matches \u201C{search}\u201D.", {
4286
4737
  note: "object list",
4287
4738
  variables: { search }
4739
+ }) : folder && list.searchScope === "folder" ? t("Nothing in \u201C{folder}\u201D or its folders matches \u201C{search}\u201D.", {
4740
+ note: "object list search",
4741
+ variables: { folder: folder.name, search }
4742
+ }) : t("Nothing matches \u201C{search}\u201D.", {
4743
+ note: "object list search",
4744
+ variables: { search }
4288
4745
  }) : upload ? t("Drop files here to add them to this folder.", {
4289
4746
  note: "object list"
4290
4747
  }) : t("Files and folders you add here will show up in this list.", {
@@ -4296,7 +4753,18 @@ function ObjectListEmpty({
4296
4753
  /* @__PURE__ */ jsx(EmptyTitle, { children: title ?? defaultTitle }),
4297
4754
  /* @__PURE__ */ jsx(EmptyDescription, { className: "[overflow-wrap:anywhere]", children: description ?? defaultDescription })
4298
4755
  ] }),
4299
- children ? /* @__PURE__ */ jsx(EmptyContent, { children }) : null
4756
+ children ? /* @__PURE__ */ jsx(EmptyContent, { children }) : search ? /* @__PURE__ */ jsxs(EmptyContent, { className: "flex-row flex-wrap justify-center gap-2", children: [
4757
+ everywhere ? /* @__PURE__ */ jsx(
4758
+ Button,
4759
+ {
4760
+ variant: "outline",
4761
+ size: "sm",
4762
+ onClick: () => list.setSearchScope("all"),
4763
+ children: t("Search everywhere", { note: "object list search" })
4764
+ }
4765
+ ) : null,
4766
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => list.setSearch(""), children: t("Clear search", { note: "object list" }) })
4767
+ ] }) : null
4300
4768
  ] });
4301
4769
  }
4302
4770
  function ObjectListError({
@@ -4715,15 +5183,12 @@ function PathMenu({
4715
5183
  ] }) })
4716
5184
  ] });
4717
5185
  }
4718
- var ObjectListHeaderContext = createContext(null);
4719
- function useOptionalObjectListHeader() {
4720
- return useContext(ObjectListHeaderContext);
4721
- }
4722
5186
  var OBJECT_LIST_HEADER_COMPACT_LABEL = "@max-[36rem]/object-list-header:sr-only";
4723
5187
  var OBJECT_LIST_HEADER_COMPACT_BUTTON = "@max-[36rem]/object-list-header:aspect-square @max-[36rem]/object-list-header:px-0!";
4724
5188
  function ObjectListHeader({
4725
5189
  children,
4726
5190
  breadcrumb,
5191
+ searchBar = true,
4727
5192
  selectionActions,
4728
5193
  className
4729
5194
  }) {
@@ -4795,6 +5260,7 @@ function ObjectListHeader({
4795
5260
  }
4796
5261
  )
4797
5262
  ] }),
5263
+ searchBar && list.isSearching ? /* @__PURE__ */ jsx(ObjectListSearchBar, { className: "border-t border-dimah-s3-border" }) : null,
4798
5264
  selecting && !replaced ? /* @__PURE__ */ jsx(
4799
5265
  ObjectListSelectionBar,
4800
5266
  {
@@ -5256,6 +5722,16 @@ function useObjectListKeyboard({
5256
5722
  startRename(found.key);
5257
5723
  return;
5258
5724
  }
5725
+ if (isSearchKey(event) && !modifier && !event.altKey) {
5726
+ const search = frame.querySelector(
5727
+ "[data-slot=object-list-search]"
5728
+ );
5729
+ if (!search) return;
5730
+ event.preventDefault();
5731
+ if (search instanceof HTMLButtonElement) search.click();
5732
+ else search.querySelector("input")?.focus();
5733
+ return;
5734
+ }
5259
5735
  if (event.key === " " && !modifier) {
5260
5736
  const key = selectableKey(target);
5261
5737
  if (!key || !selection) return;
@@ -5364,6 +5840,10 @@ function isOverlayTarget(target) {
5364
5840
  )
5365
5841
  );
5366
5842
  }
5843
+ function isSearchKey(event) {
5844
+ if (event.key === "/") return true;
5845
+ return event.code === "Slash" && !/^[\x20-\x7e]$/.test(event.key);
5846
+ }
5367
5847
  function isSelectAllKey(event) {
5368
5848
  if (/^[a-z]$/i.test(event.key)) return event.key.toLowerCase() === "a";
5369
5849
  return event.code === "KeyA";
@@ -5494,6 +5974,8 @@ function ObjectList({
5494
5974
  const deleteFocus = useFocusAfterDelete();
5495
5975
  const { announcement, announce } = useObjectListAnnouncement();
5496
5976
  const selectionCount = useSelectionCount(list, selection ?? null);
5977
+ const searchStatus = useObjectListSearchStatus(list);
5978
+ const revealRef = useRef(null);
5497
5979
  const [renamingKey, setRenamingKey] = useState(null);
5498
5980
  const renameFocusKey = useRef(null);
5499
5981
  const previousRenaming = useRef(null);
@@ -5576,6 +6058,14 @@ function ObjectList({
5576
6058
  },
5577
6059
  [store]
5578
6060
  );
6061
+ const revealEntry = useCallback((entry) => {
6062
+ const { location } = entry;
6063
+ if (!location) return;
6064
+ const current = latest.current.list;
6065
+ revealRef.current = entry.key;
6066
+ current.setSearch("");
6067
+ current.navigate(location);
6068
+ }, []);
5579
6069
  const open = useCallback((entry) => {
5580
6070
  const current = latest.current;
5581
6071
  if (entry.kind === "folder") current.list.openFolder(entry.folder);
@@ -5625,6 +6115,7 @@ function ObjectList({
5625
6115
  renamingKey,
5626
6116
  startRename,
5627
6117
  endRename,
6118
+ revealEntry,
5628
6119
  renderEntry,
5629
6120
  renderActions,
5630
6121
  renderDescription,
@@ -5647,6 +6138,7 @@ function ObjectList({
5647
6138
  renderEntry,
5648
6139
  renderMeta,
5649
6140
  resolveFolderKeys,
6141
+ revealEntry,
5650
6142
  selection,
5651
6143
  selectionActions,
5652
6144
  setView,
@@ -5658,6 +6150,29 @@ function ObjectList({
5658
6150
  view
5659
6151
  ]
5660
6152
  );
6153
+ useEffect(() => {
6154
+ const revealKey = revealRef.current;
6155
+ if (revealKey == null) return;
6156
+ if (list.isSearching || list.isLoading || list.isRefreshing) return;
6157
+ revealRef.current = null;
6158
+ const trigger = deleteFocus.frameRef.current?.querySelector(
6159
+ `[data-slot="object-list-entry-trigger"][data-entry-key="${CSS.escape(revealKey)}"]`
6160
+ );
6161
+ if (!trigger) return;
6162
+ store.set({ tabStop: revealKey });
6163
+ trigger.focus({ preventScroll: true });
6164
+ trigger.scrollIntoView({ block: "nearest" });
6165
+ const row = trigger.closest("[data-slot=object-list-entry]");
6166
+ row?.setAttribute("data-revealed", "");
6167
+ window.setTimeout(() => row?.removeAttribute("data-revealed"), 2e3);
6168
+ }, [
6169
+ deleteFocus.frameRef,
6170
+ list.entries,
6171
+ list.isLoading,
6172
+ list.isRefreshing,
6173
+ list.isSearching,
6174
+ store
6175
+ ]);
5661
6176
  const opensFiles = onOpenItem != null;
5662
6177
  const folderUploads = upload != null && list.uploadOptions != null;
5663
6178
  const canDownload = download != null;
@@ -5665,6 +6180,11 @@ function ObjectList({
5665
6180
  const canDelete = del != null;
5666
6181
  const renameFile = list.renameFile != null;
5667
6182
  const renameFolder = list.renameFolder != null;
6183
+ const currentSearch = list.isSearching ? list.search.trim() : "";
6184
+ const [search, setShownSearch] = useState(currentSearch);
6185
+ if (!list.isLoading && !list.isRefreshing && search !== currentSearch) {
6186
+ setShownSearch(currentSearch);
6187
+ }
5668
6188
  const scope = useMemo(
5669
6189
  () => ({
5670
6190
  store,
@@ -5676,11 +6196,13 @@ function ObjectList({
5676
6196
  delete: canDelete,
5677
6197
  renameFile,
5678
6198
  renameFolder,
6199
+ search,
5679
6200
  open,
5680
6201
  toggle,
5681
6202
  folderDropTarget,
5682
6203
  startRename,
5683
6204
  endRename,
6205
+ revealEntry,
5684
6206
  renderActions,
5685
6207
  renderDescription,
5686
6208
  renderMeta
@@ -5699,6 +6221,8 @@ function ObjectList({
5699
6221
  renderActions,
5700
6222
  renderDescription,
5701
6223
  renderMeta,
6224
+ revealEntry,
6225
+ search,
5702
6226
  selectableKeys,
5703
6227
  startRename,
5704
6228
  store,
@@ -5771,7 +6295,8 @@ function ObjectList({
5771
6295
  ObjectListAnnouncer,
5772
6296
  {
5773
6297
  announcement,
5774
- status: selectionCount
6298
+ status: selectionCount,
6299
+ search: searchStatus?.settled ? searchStatus.label : null
5775
6300
  }
5776
6301
  )
5777
6302
  ] });
@@ -5942,157 +6467,6 @@ function cssLength(value) {
5942
6467
  const trimmed = value.trim();
5943
6468
  return trimmed.length > 0 ? trimmed : void 0;
5944
6469
  }
5945
- function ObjectListSearch({
5946
- placeholder,
5947
- delay = 250,
5948
- collapsible = true,
5949
- className
5950
- }) {
5951
- const t = useTranslations();
5952
- const { list } = useObjectListContext();
5953
- const header = useOptionalObjectListHeader();
5954
- const { setSearch } = list;
5955
- const [draft, setDraft] = useState(null);
5956
- const value = draft ?? list.search;
5957
- const label = placeholder ?? t("Search files", { note: "object list" });
5958
- const collapses = collapsible && header != null;
5959
- const [open, setOpen] = useState(false);
5960
- const expanded = !collapses || open || value !== "";
5961
- const inputRef = useRef(null);
5962
- const buttonRef = useRef(null);
5963
- const focusRef = useRef(null);
5964
- useEffect(() => {
5965
- if (draft == null) return;
5966
- const timer = window.setTimeout(() => {
5967
- setSearch(draft);
5968
- setDraft(null);
5969
- }, delay);
5970
- return () => window.clearTimeout(timer);
5971
- }, [delay, draft, setSearch]);
5972
- const setSearchExpanded = header?.setSearchExpanded;
5973
- useLayoutEffect(() => {
5974
- if (!collapses || !setSearchExpanded) return;
5975
- setSearchExpanded(expanded);
5976
- return () => setSearchExpanded(false);
5977
- }, [collapses, expanded, setSearchExpanded]);
5978
- useEffect(() => {
5979
- const target = focusRef.current;
5980
- if (!target) return;
5981
- focusRef.current = null;
5982
- (target === "input" ? inputRef : buttonRef).current?.focus();
5983
- });
5984
- function commit(next) {
5985
- setDraft(null);
5986
- setSearch(next);
5987
- }
5988
- function close() {
5989
- commit("");
5990
- setOpen(false);
5991
- focusRef.current = "button";
5992
- }
5993
- if (!expanded) {
5994
- return /* @__PURE__ */ jsxs(Tooltip, { children: [
5995
- /* @__PURE__ */ jsx(
5996
- TooltipTrigger,
5997
- {
5998
- render: /* @__PURE__ */ jsx(
5999
- Button,
6000
- {
6001
- ref: buttonRef,
6002
- type: "button",
6003
- variant: "ghost",
6004
- size: "icon-sm",
6005
- "data-slot": "object-list-search",
6006
- "aria-label": label,
6007
- className,
6008
- onClick: () => {
6009
- focusRef.current = "input";
6010
- setOpen(true);
6011
- }
6012
- }
6013
- ),
6014
- children: /* @__PURE__ */ jsx(SearchIcon, {})
6015
- }
6016
- ),
6017
- /* @__PURE__ */ jsx(TooltipContent, { children: label })
6018
- ] });
6019
- }
6020
- return /* @__PURE__ */ jsxs(
6021
- "div",
6022
- {
6023
- "data-slot": "object-list-search",
6024
- "data-expanded": "",
6025
- className: cn(
6026
- "relative flex min-w-0 items-center",
6027
- collapses ? "w-full flex-1" : "w-40 sm:w-52",
6028
- className
6029
- ),
6030
- onBlur: (event) => {
6031
- if (!collapses || value !== "") return;
6032
- const next = event.relatedTarget;
6033
- if (next instanceof Node && event.currentTarget.contains(next)) return;
6034
- setOpen(false);
6035
- },
6036
- children: [
6037
- /* @__PURE__ */ jsx(
6038
- SearchIcon,
6039
- {
6040
- "aria-hidden": true,
6041
- className: "pointer-events-none absolute start-2.5 size-3.5 text-dimah-s3-muted-foreground"
6042
- }
6043
- ),
6044
- /* @__PURE__ */ jsx(
6045
- "input",
6046
- {
6047
- ref: inputRef,
6048
- type: "search",
6049
- value,
6050
- placeholder: label,
6051
- "aria-label": label,
6052
- autoComplete: "off",
6053
- className: cn(
6054
- "w-full min-w-0 rounded-md border border-dimah-s3-border bg-transparent ps-8 text-sm text-dimah-s3-foreground outline-none placeholder:text-dimah-s3-muted-foreground focus-visible:border-dimah-s3-ring focus-visible:ring-3 focus-visible:ring-dimah-s3-ring/50 [&::-webkit-search-cancel-button]:appearance-none",
6055
- collapses ? "h-8 pe-9" : "h-7 pe-7"
6056
- ),
6057
- onChange: (event) => setDraft(event.target.value),
6058
- onKeyDown: (event) => {
6059
- if (event.key === "Enter") commit(value);
6060
- if (event.key !== "Escape") return;
6061
- if (value) {
6062
- event.preventDefault();
6063
- commit("");
6064
- } else if (collapses) {
6065
- event.preventDefault();
6066
- close();
6067
- }
6068
- }
6069
- }
6070
- ),
6071
- collapses ? /* @__PURE__ */ jsx(
6072
- Button,
6073
- {
6074
- type: "button",
6075
- variant: "ghost",
6076
- size: "icon-xs",
6077
- "aria-label": t("Close search", { note: "object list" }),
6078
- className: "absolute end-1.5",
6079
- onClick: close,
6080
- children: /* @__PURE__ */ jsx(XIcon, {})
6081
- }
6082
- ) : value ? /* @__PURE__ */ jsx(
6083
- "button",
6084
- {
6085
- type: "button",
6086
- "aria-label": t("Clear search", { note: "object list" }),
6087
- className: "absolute end-1 flex size-5 items-center justify-center rounded-sm text-dimah-s3-muted-foreground outline-none hover:text-dimah-s3-foreground focus-visible:ring-2 focus-visible:ring-dimah-s3-ring/50",
6088
- onClick: () => commit(""),
6089
- children: /* @__PURE__ */ jsx(XIcon, { className: "size-3.5" })
6090
- }
6091
- ) : null
6092
- ]
6093
- }
6094
- );
6095
- }
6096
6470
  function ObjectListSortMenu({
6097
6471
  options,
6098
6472
  className
@@ -6211,6 +6585,6 @@ function ObjectListViewToggle({ className }) {
6211
6585
  );
6212
6586
  }
6213
6587
 
6214
- export { AttachmentAction, AttachmentGroup, AttachmentTrigger, AvatarUpload, CircleProgress, Delete, DeleteConfirmDialog, DeleteToasts, DeleteTrigger, DismissAttachmentAction, Download, DownloadProgress, DownloadToasts, DownloadTrigger, FileAttachment, FileName, FileTypeGlyph, FolderGlyph, ObjectCard, ObjectImage, ObjectList, ObjectListBreadcrumb, ObjectListBulkDelete, ObjectListCheckbox, ObjectListContent, ObjectListEmpty, ObjectListHeader, ObjectListItemMenu, ObjectListNewFolder, ObjectListRow, ObjectListSearch, ObjectListSelectAll, ObjectListSelectionBar, ObjectListSortMenu, ObjectListTile, ObjectListUploadStatus, ObjectListUsage, ObjectListViewToggle, StatusAttachment, Toaster, Upload, UploadDropzone, UploadDropzoneTrigger, UploadField, UploadFieldValue, UploadFileItem, UploadFileList, UploadStatus, UploadToasts, UploadTrigger, toast, useDeleteContext, useDownloadContext, useObjectListContext, useObjectListEntry, usePasteFiles, useToastOwner, useUploadContext, useUploadFieldContext, useUploadHints };
6588
+ export { AttachmentAction, AttachmentGroup, AttachmentTrigger, AvatarUpload, CircleProgress, Delete, DeleteConfirmDialog, DeleteToasts, DeleteTrigger, DismissAttachmentAction, Download, DownloadProgress, DownloadToasts, DownloadTrigger, FileAttachment, FileName, FileTypeGlyph, FolderGlyph, ObjectCard, ObjectImage, ObjectList, ObjectListBreadcrumb, ObjectListBulkDelete, ObjectListCheckbox, ObjectListContent, ObjectListEmpty, ObjectListHeader, ObjectListItemMenu, ObjectListLocation, ObjectListNewFolder, ObjectListRow, ObjectListSearch, ObjectListSearchBar, ObjectListSelectAll, ObjectListSelectionBar, ObjectListSortMenu, ObjectListTile, ObjectListUploadStatus, ObjectListUsage, ObjectListViewToggle, StatusAttachment, Toaster, Upload, UploadDropzone, UploadDropzoneTrigger, UploadField, UploadFieldValue, UploadFileItem, UploadFileList, UploadStatus, UploadToasts, UploadTrigger, toast, useDeleteContext, useDownloadContext, useObjectListContext, useObjectListEntry, usePasteFiles, useToastOwner, useUploadContext, useUploadFieldContext, useUploadHints };
6215
6589
  //# sourceMappingURL=index.js.map
6216
6590
  //# sourceMappingURL=index.js.map