@octaviaflow/core 3.1.0-beta.112 → 3.1.0-beta.113

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.
package/dist/index.js CHANGED
@@ -5333,13 +5333,18 @@ var CommandPalette = forwardRef26(
5333
5333
  open,
5334
5334
  onClose,
5335
5335
  groups,
5336
- placeholder = "Search for actions, pages, datasets\u2026",
5336
+ placeholder = "Search\u2026",
5337
5337
  onSelect,
5338
5338
  emptyState,
5339
5339
  footer,
5340
5340
  filter = defaultFilter,
5341
5341
  container,
5342
5342
  disableAnimation = false,
5343
+ query: controlledQuery,
5344
+ onQueryChange,
5345
+ shouldFilter = true,
5346
+ loading = false,
5347
+ loadingLabel = "Searching\u2026",
5343
5348
  id: providedId,
5344
5349
  className,
5345
5350
  ...rest
@@ -5349,14 +5354,16 @@ var CommandPalette = forwardRef26(
5349
5354
  const reducedMotion = useReducedMotion3();
5350
5355
  const inputRef = useRef10(null);
5351
5356
  const listRef = useRef10(null);
5352
- const [query, setQuery] = useState16("");
5357
+ const isQueryControlled = controlledQuery !== void 0;
5358
+ const [internalQuery, setInternalQuery] = useState16("");
5359
+ const query = isQueryControlled ? controlledQuery : internalQuery;
5353
5360
  const [activeIndex, setActiveIndex] = useState16(0);
5354
5361
  const filteredGroups = useMemo5(() => {
5355
5362
  return groups.map((g) => ({
5356
5363
  ...g,
5357
- items: g.items.filter((it) => filter(it, query, g.heading))
5364
+ items: g.shouldFilter ?? shouldFilter ? g.items.filter((it) => filter(it, query, g.heading)) : g.items
5358
5365
  })).filter((g) => g.items.length > 0);
5359
- }, [groups, query, filter]);
5366
+ }, [groups, query, filter, shouldFilter]);
5360
5367
  const flatItems = useMemo5(
5361
5368
  () => filteredGroups.flatMap((g) => g.items),
5362
5369
  [filteredGroups]
@@ -5368,7 +5375,7 @@ var CommandPalette = forwardRef26(
5368
5375
  }, [flatItems.length, activeIndex]);
5369
5376
  useEffect8(() => {
5370
5377
  if (open) {
5371
- setQuery("");
5378
+ if (!isQueryControlled) setInternalQuery("");
5372
5379
  setActiveIndex(0);
5373
5380
  requestAnimationFrame(() => inputRef.current?.focus());
5374
5381
  }
@@ -5447,76 +5454,85 @@ var CommandPalette = forwardRef26(
5447
5454
  placeholder,
5448
5455
  value: query,
5449
5456
  onChange: (e) => {
5450
- setQuery(e.target.value);
5457
+ const next = e.target.value;
5458
+ if (!isQueryControlled) setInternalQuery(next);
5459
+ onQueryChange?.(next);
5451
5460
  setActiveIndex(0);
5452
5461
  }
5453
5462
  }
5454
5463
  ),
5455
5464
  /* @__PURE__ */ jsx30("kbd", { className: "ods-cmdk__esc-hint", "aria-hidden": "true", children: "Esc" })
5456
5465
  ] }),
5457
- /* @__PURE__ */ jsx30(
5466
+ /* @__PURE__ */ jsxs30(
5458
5467
  "div",
5459
5468
  {
5460
5469
  ref: listRef,
5461
5470
  id: `${baseId}-list`,
5462
5471
  role: "listbox",
5463
5472
  className: "ods-cmdk__list",
5464
- children: filteredGroups.length === 0 ? /* @__PURE__ */ jsx30("div", { className: "ods-cmdk__empty", children: emptyState ?? /* @__PURE__ */ jsxs30(Fragment10, { children: [
5465
- /* @__PURE__ */ jsx30("p", { className: "ods-cmdk__empty-title", children: "No results" }),
5466
- /* @__PURE__ */ jsx30("p", { className: "ods-cmdk__empty-hint", children: "Try a different keyword." })
5467
- ] }) }) : (() => {
5468
- let flatIdx = -1;
5469
- return filteredGroups.map((g, gi) => /* @__PURE__ */ jsxs30(
5470
- "div",
5471
- {
5472
- className: "ods-cmdk__group",
5473
- role: "group",
5474
- "aria-label": typeof g.heading === "string" ? g.heading : void 0,
5475
- children: [
5476
- /* @__PURE__ */ jsx30("div", { className: "ods-cmdk__group-heading", children: g.heading }),
5477
- g.items.map((item) => {
5478
- flatIdx += 1;
5479
- const idx = flatIdx;
5480
- const isActive2 = idx === activeIndex;
5481
- return /* @__PURE__ */ jsxs30(
5482
- "div",
5483
- {
5484
- id: `${baseId}-opt-${idx}`,
5485
- role: "option",
5486
- "aria-selected": isActive2,
5487
- "aria-disabled": item.disabled || void 0,
5488
- className: cn(
5489
- "ods-cmdk__option",
5490
- isActive2 && "ods-cmdk__option--active",
5491
- item.danger && "ods-cmdk__option--danger",
5492
- item.disabled && "ods-cmdk__option--disabled"
5493
- ),
5494
- onMouseEnter: () => setActiveIndex(idx),
5495
- onClick: () => handleItemClick(item),
5496
- children: [
5497
- item.icon && /* @__PURE__ */ jsx30(
5498
- "span",
5499
- {
5500
- className: "ods-cmdk__option-icon",
5501
- "aria-hidden": "true",
5502
- children: item.icon
5503
- }
5473
+ "aria-busy": loading || void 0,
5474
+ children: [
5475
+ filteredGroups.length === 0 ? loading ? null : /* @__PURE__ */ jsx30("div", { className: "ods-cmdk__empty", children: emptyState ?? /* @__PURE__ */ jsxs30(Fragment10, { children: [
5476
+ /* @__PURE__ */ jsx30("p", { className: "ods-cmdk__empty-title", children: "No results" }),
5477
+ /* @__PURE__ */ jsx30("p", { className: "ods-cmdk__empty-hint", children: "Try a different keyword." })
5478
+ ] }) }) : (() => {
5479
+ let flatIdx = -1;
5480
+ return filteredGroups.map((g, gi) => /* @__PURE__ */ jsxs30(
5481
+ "div",
5482
+ {
5483
+ className: "ods-cmdk__group",
5484
+ role: "group",
5485
+ "aria-label": typeof g.heading === "string" ? g.heading : void 0,
5486
+ children: [
5487
+ /* @__PURE__ */ jsx30("div", { className: "ods-cmdk__group-heading", children: g.heading }),
5488
+ g.items.map((item) => {
5489
+ flatIdx += 1;
5490
+ const idx = flatIdx;
5491
+ const isActive2 = idx === activeIndex;
5492
+ return /* @__PURE__ */ jsxs30(
5493
+ "div",
5494
+ {
5495
+ id: `${baseId}-opt-${idx}`,
5496
+ role: "option",
5497
+ "aria-selected": isActive2,
5498
+ "aria-disabled": item.disabled || void 0,
5499
+ className: cn(
5500
+ "ods-cmdk__option",
5501
+ isActive2 && "ods-cmdk__option--active",
5502
+ item.danger && "ods-cmdk__option--danger",
5503
+ item.disabled && "ods-cmdk__option--disabled"
5504
5504
  ),
5505
- /* @__PURE__ */ jsxs30("span", { className: "ods-cmdk__option-body", children: [
5506
- /* @__PURE__ */ jsx30("span", { className: "ods-cmdk__option-label", children: item.label }),
5507
- item.description && /* @__PURE__ */ jsx30("span", { className: "ods-cmdk__option-desc", children: item.description })
5508
- ] }),
5509
- item.shortcut && /* @__PURE__ */ jsx30("kbd", { className: "ods-cmdk__option-shortcut", children: item.shortcut })
5510
- ]
5511
- },
5512
- item.id
5513
- );
5514
- })
5515
- ]
5516
- },
5517
- gi
5518
- ));
5519
- })()
5505
+ onMouseEnter: () => setActiveIndex(idx),
5506
+ onClick: () => handleItemClick(item),
5507
+ children: [
5508
+ item.icon && /* @__PURE__ */ jsx30(
5509
+ "span",
5510
+ {
5511
+ className: "ods-cmdk__option-icon",
5512
+ "aria-hidden": "true",
5513
+ children: item.icon
5514
+ }
5515
+ ),
5516
+ /* @__PURE__ */ jsxs30("span", { className: "ods-cmdk__option-body", children: [
5517
+ /* @__PURE__ */ jsx30("span", { className: "ods-cmdk__option-label", children: item.label }),
5518
+ item.description && /* @__PURE__ */ jsx30("span", { className: "ods-cmdk__option-desc", children: item.description })
5519
+ ] }),
5520
+ item.shortcut && /* @__PURE__ */ jsx30("kbd", { className: "ods-cmdk__option-shortcut", children: item.shortcut })
5521
+ ]
5522
+ },
5523
+ item.id
5524
+ );
5525
+ })
5526
+ ]
5527
+ },
5528
+ gi
5529
+ ));
5530
+ })(),
5531
+ loading && /* @__PURE__ */ jsxs30("div", { className: "ods-cmdk__loading", role: "status", "aria-live": "polite", children: [
5532
+ /* @__PURE__ */ jsx30(Spinner, { size: "sm", tone: "muted", "aria-hidden": "true" }),
5533
+ /* @__PURE__ */ jsx30("span", { children: loadingLabel })
5534
+ ] })
5535
+ ]
5520
5536
  }
5521
5537
  ),
5522
5538
  footer && /* @__PURE__ */ jsx30("div", { className: "ods-cmdk__footer", children: footer })
@@ -38338,6 +38354,14 @@ var DEFAULT_NOTIFICATION_CATALOG = [
38338
38354
  subjectNoun: "app",
38339
38355
  defaultEmail: false
38340
38356
  },
38357
+ {
38358
+ key: "connector.expiring_soon",
38359
+ label: "App sign-in expires soon",
38360
+ phrase: "an app's sign-in is about to expire",
38361
+ severity: "warning",
38362
+ audience: "org",
38363
+ subjectNoun: "app"
38364
+ },
38341
38365
  {
38342
38366
  key: "connector.test_failed",
38343
38367
  label: "Connection test failed",