@foldkit/ui 0.154.0-canary.cc8d62ecc9cf → 0.154.0-canary.dc82c7255dbf

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.
@@ -395,21 +395,28 @@ export const update = (model, message) => {
395
395
  *
396
396
  * Exposed so Scene tests can call
397
397
  * `Scene.Mount.resolve(AnchorMenu, Message.CompletedAnchorMenu())`. */
398
- export const AnchorMenu = Mount.define('AnchorMenu', { buttonId: S.String, anchor: AnchorConfig }, Message.CompletedAnchorMenu)(({ buttonId, anchor }) => __foldkitBrandViewResult((element => __foldkitBrandViewResult((Effect.gen(function* () {
399
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup(element, {
400
- buttonId,
401
- anchor,
402
- focusAfterPosition: true,
403
- })), "@foldkit/ui/menu/index.js#anonymous~15")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~16"));
404
- return __foldkitBrandViewResult((Message.CompletedAnchorMenu()), "@foldkit/ui/menu/index.js#anonymous~14");
405
- })), "@foldkit/ui/menu/index.js#anonymous~13")), "@foldkit/ui/menu/index.js#anonymous~12"));
398
+ export const AnchorMenu = Mount.define('AnchorMenu', {
399
+ args: { buttonId: S.String, anchor: AnchorConfig },
400
+ messages: [Message.CompletedAnchorMenu],
401
+ execute: ({ element, buttonId, anchor }) => __foldkitBrandViewResult((Effect.gen(function* () {
402
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup(element, {
403
+ buttonId,
404
+ anchor,
405
+ focusAfterPosition: true,
406
+ })), "@foldkit/ui/menu/index.js#anonymous~13")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~14"));
407
+ return __foldkitBrandViewResult((Message.CompletedAnchorMenu()), "@foldkit/ui/menu/index.js#anonymous~12");
408
+ })), "@foldkit/ui/menu/index.js#execute~9"),
409
+ });
406
410
  /** The backdrop-portaling Mount this Menu renders. Exposed so Scene tests can
407
411
  * call `Scene.Mount.resolve(PortalMenuBackdrop, Message.CompletedPortalMenuBackdrop())` to
408
412
  * acknowledge the mount produced by the rendered backdrop. */
409
- export const PortalMenuBackdrop = Mount.define('PortalMenuBackdrop', Message.CompletedPortalMenuBackdrop)(element => __foldkitBrandViewResult((Effect.gen(function* () {
410
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/menu/index.js#anonymous~19")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~20"));
411
- return __foldkitBrandViewResult((Message.CompletedPortalMenuBackdrop()), "@foldkit/ui/menu/index.js#anonymous~18");
412
- })), "@foldkit/ui/menu/index.js#anonymous~17"));
413
+ export const PortalMenuBackdrop = Mount.define('PortalMenuBackdrop', {
414
+ messages: [Message.CompletedPortalMenuBackdrop],
415
+ execute: ({ element }) => __foldkitBrandViewResult((Effect.gen(function* () {
416
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/menu/index.js#anonymous~16")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/menu/index.js#anonymous~17"));
417
+ return __foldkitBrandViewResult((Message.CompletedPortalMenuBackdrop()), "@foldkit/ui/menu/index.js#anonymous~15");
418
+ })), "@foldkit/ui/menu/index.js#execute~10"),
419
+ });
413
420
  /** Programmatically opens the Menu, updating the Model and returning focus and
414
421
  * modal Commands. Use this in domain-event handlers. */
415
422
  export const open = (model) => __foldkitBrandViewResult((update(model, Message.Opened({ maybeActiveItemIndex: Option.none() }))), "@foldkit/ui/menu/index.js#open");
@@ -428,7 +435,7 @@ const internalView = () =>
428
435
  __foldkitBrandViewResult((menuViewImpl), "@foldkit/ui/menu/index.js#internalView");
429
436
  const menuViewImpl = defineView((model, viewInputs, h) => {
430
437
  const { id, isOpen, animation: { transitionState }, maybeActiveItemIndex, searchQuery, maybeLastButtonPointerType, } = model;
431
- const { items, itemToConfig, isItemDisabled, itemToSearchText = (item) => __foldkitBrandViewResult((item), "@foldkit/ui/menu/index.js#anonymous~22"), isButtonDisabled, buttonContent, buttonClassName, buttonAttributes = [], itemsClassName, itemsAttributes = [], itemsScrollClassName, itemsScrollAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], itemGroupKey, groupToHeading, groupClassName, groupAttributes = [], separatorClassName, separatorAttributes = [], anchor = {}, ariaLabel, ariaLabelledBy, } = viewInputs;
438
+ const { items, itemToConfig, isItemDisabled, itemToSearchText = (item) => __foldkitBrandViewResult((item), "@foldkit/ui/menu/index.js#anonymous~19"), isButtonDisabled, buttonContent, buttonClassName, buttonAttributes = [], itemsClassName, itemsAttributes = [], itemsScrollClassName, itemsScrollAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], itemGroupKey, groupToHeading, groupClassName, groupAttributes = [], separatorClassName, separatorAttributes = [], anchor = {}, ariaLabel, ariaLabelledBy, } = viewInputs;
432
439
  const dispatchSelectedItem = (item, index) => __foldkitBrandViewResult((Message.SelectedItem({ index, item })), "@foldkit/ui/menu/index.js#dispatchSelectedItem");
433
440
  const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating';
434
441
  const isVisible = isOpen || isLeaving;
@@ -436,19 +443,19 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
436
443
  h.DataAttribute('closed', ''),
437
444
  h.DataAttribute('enter', ''),
438
445
  h.DataAttribute('transition', ''),
439
- ]), "@foldkit/ui/menu/index.js#anonymous~23")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
446
+ ]), "@foldkit/ui/menu/index.js#anonymous~20")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
440
447
  h.DataAttribute('enter', ''),
441
448
  h.DataAttribute('transition', ''),
442
- ]), "@foldkit/ui/menu/index.js#anonymous~24")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
449
+ ]), "@foldkit/ui/menu/index.js#anonymous~21")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
443
450
  h.DataAttribute('leave', ''),
444
451
  h.DataAttribute('transition', ''),
445
- ]), "@foldkit/ui/menu/index.js#anonymous~25")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
452
+ ]), "@foldkit/ui/menu/index.js#anonymous~22")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
446
453
  h.DataAttribute('closed', ''),
447
454
  h.DataAttribute('leave', ''),
448
455
  h.DataAttribute('transition', ''),
449
- ]), "@foldkit/ui/menu/index.js#anonymous~26")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/menu/index.js#anonymous~27")));
456
+ ]), "@foldkit/ui/menu/index.js#anonymous~23")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/menu/index.js#anonymous~24")));
450
457
  const isDisabled = (index) => __foldkitBrandViewResult((Predicate.isNotUndefined(isItemDisabled) &&
451
- pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((isItemDisabled(item, index)), "@foldkit/ui/menu/index.js#anonymous~28")))), "@foldkit/ui/menu/index.js#isDisabled");
458
+ pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((isItemDisabled(item, index)), "@foldkit/ui/menu/index.js#anonymous~25")))), "@foldkit/ui/menu/index.js#isDisabled");
452
459
  const firstEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabled)(0, 1);
453
460
  const lastEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabled)(items.length - 1, -1);
454
461
  const handleButtonKeyDown = (key) => {
@@ -457,9 +464,9 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
457
464
  }
458
465
  return __foldkitBrandViewResult((M.value(key).pipe(M.whenOr('Enter', ' ', 'ArrowDown', () => __foldkitBrandViewResult((Option.some(Message.Opened({
459
466
  maybeActiveItemIndex: Option.some(firstEnabledIndex),
460
- }))), "@foldkit/ui/menu/index.js#anonymous~29")), M.when('ArrowUp', () => __foldkitBrandViewResult((Option.some(Message.Opened({
467
+ }))), "@foldkit/ui/menu/index.js#anonymous~26")), M.when('ArrowUp', () => __foldkitBrandViewResult((Option.some(Message.Opened({
461
468
  maybeActiveItemIndex: Option.some(lastEnabledIndex),
462
- }))), "@foldkit/ui/menu/index.js#anonymous~30")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~31")))), "@foldkit/ui/menu/index.js#handleButtonKeyDown");
469
+ }))), "@foldkit/ui/menu/index.js#anonymous~27")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~28")))), "@foldkit/ui/menu/index.js#handleButtonKeyDown");
463
470
  };
464
471
  const handleButtonPointerDown = (pointerType, button, screenX, screenY, timeStamp) => __foldkitBrandViewResult((Option.some(Message.PressedPointerOnButton({
465
472
  pointerType,
@@ -469,7 +476,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
469
476
  timeStamp,
470
477
  }))), "@foldkit/ui/menu/index.js#handleButtonPointerDown");
471
478
  const handleButtonClick = () => {
472
- const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/menu/index.js#anonymous~32"));
479
+ const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/menu/index.js#anonymous~29"));
473
480
  if (isMouse) {
474
481
  return __foldkitBrandViewResult((Message.IgnoredMouseClick()), "@foldkit/ui/menu/index.js#handleButtonClick");
475
482
  }
@@ -481,18 +488,18 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
481
488
  }
482
489
  };
483
490
  const handleSpaceKeyUp = (key) => __foldkitBrandViewResult((OptionExt.when(key === ' ', Message.SuppressedSpaceScroll())), "@foldkit/ui/menu/index.js#handleSpaceKeyUp");
484
- const resolveActiveIndex = keyToIndex('ArrowDown', 'ArrowUp', items.length, Option.getOrElse(maybeActiveItemIndex, () => __foldkitBrandViewResult((0), "@foldkit/ui/menu/index.js#anonymous~33")), isDisabled);
491
+ const resolveActiveIndex = keyToIndex('ArrowDown', 'ArrowUp', items.length, Option.getOrElse(maybeActiveItemIndex, () => __foldkitBrandViewResult((0), "@foldkit/ui/menu/index.js#anonymous~30")), isDisabled);
485
492
  const searchForKey = (key) => {
486
493
  const nextQuery = searchQuery + key;
487
494
  const maybeTargetIndex = resolveTypeaheadMatch(items, nextQuery, maybeActiveItemIndex, isDisabled, itemToSearchText, Str.isNonEmpty(searchQuery));
488
495
  return __foldkitBrandViewResult((Option.some(Message.Searched({ key, maybeTargetIndex }))), "@foldkit/ui/menu/index.js#searchForKey");
489
496
  };
490
- const handleItemsKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(Message.Closed())), "@foldkit/ui/menu/index.js#anonymous~34")), M.when('Enter', () => __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((Message.RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~36"))), "@foldkit/ui/menu/index.js#anonymous~35")), M.when(' ', () => __foldkitBrandViewResult((Str.isNonEmpty(searchQuery)
497
+ const handleItemsKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(Message.Closed())), "@foldkit/ui/menu/index.js#anonymous~31")), M.when('Enter', () => __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((Message.RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~33"))), "@foldkit/ui/menu/index.js#anonymous~32")), M.when(' ', () => __foldkitBrandViewResult((Str.isNonEmpty(searchQuery)
491
498
  ? searchForKey(' ')
492
- : Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((Message.RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~38"))), "@foldkit/ui/menu/index.js#anonymous~37")), M.whenOr('ArrowDown', 'ArrowUp', 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((Option.some(Message.ActivatedItem({
499
+ : Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((Message.RequestedItemClick({ index })), "@foldkit/ui/menu/index.js#anonymous~35"))), "@foldkit/ui/menu/index.js#anonymous~34")), M.whenOr('ArrowDown', 'ArrowUp', 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((Option.some(Message.ActivatedItem({
493
500
  index: resolveActiveIndex(key),
494
501
  activationTrigger: 'Keyboard',
495
- }))), "@foldkit/ui/menu/index.js#anonymous~39")), M.when(isPrintableKey, () => __foldkitBrandViewResult((searchForKey(key)), "@foldkit/ui/menu/index.js#anonymous~40")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~41")))), "@foldkit/ui/menu/index.js#handleItemsKeyDown");
502
+ }))), "@foldkit/ui/menu/index.js#anonymous~36")), M.when(isPrintableKey, () => __foldkitBrandViewResult((searchForKey(key)), "@foldkit/ui/menu/index.js#anonymous~37")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/menu/index.js#anonymous~38")))), "@foldkit/ui/menu/index.js#handleItemsKeyDown");
496
503
  const handleItemsPointerUp = (screenX, screenY, pointerType, timeStamp) => __foldkitBrandViewResult((OptionExt.when(pointerType === 'mouse', Message.ReleasedPointerOnItems({ screenX, screenY, timeStamp }))), "@foldkit/ui/menu/index.js#handleItemsPointerUp");
497
504
  const resolveButtonLabel = () => {
498
505
  if (Predicate.isNotUndefined(ariaLabel)) {
@@ -558,7 +565,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
558
565
  ...itemsAttributes,
559
566
  ];
560
567
  const menuItems = Array.map(items, (item, index) => {
561
- const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => __foldkitBrandViewResult((activeIndex === index), "@foldkit/ui/menu/index.js#anonymous~43"));
568
+ const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => __foldkitBrandViewResult((activeIndex === index), "@foldkit/ui/menu/index.js#anonymous~40"));
562
569
  const isDisabledItem = isDisabled(index);
563
570
  const itemConfig = itemToConfig(item, {
564
571
  isActive: isActiveItem,
@@ -582,13 +589,13 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
582
589
  index,
583
590
  screenX,
584
591
  screenY,
585
- }))), "@foldkit/ui/menu/index.js#anonymous~44")),
592
+ }))), "@foldkit/ui/menu/index.js#anonymous~41")),
586
593
  ]),
587
- h.OnPointerLeave(pointerType => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', Message.DeactivatedItem())), "@foldkit/ui/menu/index.js#anonymous~45")),
594
+ h.OnPointerLeave(pointerType => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', Message.DeactivatedItem())), "@foldkit/ui/menu/index.js#anonymous~42")),
588
595
  ]
589
596
  : []),
590
597
  ...(itemConfig.className ? [h.Class(itemConfig.className)] : []),
591
- ], [itemConfig.content])), "@foldkit/ui/menu/index.js#anonymous~42");
598
+ ], [itemConfig.content])), "@foldkit/ui/menu/index.js#anonymous~39");
592
599
  });
593
600
  const renderGroupedItems = () => {
594
601
  if (!itemGroupKey) {
@@ -597,7 +604,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
597
604
  const segments = groupContiguous(menuItems, (_, index) => __foldkitBrandViewResult((Array.get(items, index).pipe(Option.match({
598
605
  onNone: () => __foldkitBrandViewResult((''), "@foldkit/ui/menu/index.js#onNone~3"),
599
606
  onSome: item => __foldkitBrandViewResult((itemGroupKey(item, index)), "@foldkit/ui/menu/index.js#onSome~3"),
600
- }))), "@foldkit/ui/menu/index.js#anonymous~46"));
607
+ }))), "@foldkit/ui/menu/index.js#anonymous~43"));
601
608
  return __foldkitBrandViewResult((Array.flatMap(segments, (segment, segmentIndex) => {
602
609
  const maybeHeading = Option.fromNullishOr(groupToHeading && groupToHeading(segment.key));
603
610
  const headingId = `${id}-heading-${segment.key}`;
@@ -631,7 +638,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
631
638
  ]),
632
639
  ]
633
640
  : [];
634
- return __foldkitBrandViewResult(([...separator, groupElement]), "@foldkit/ui/menu/index.js#anonymous~47");
641
+ return __foldkitBrandViewResult(([...separator, groupElement]), "@foldkit/ui/menu/index.js#anonymous~44");
635
642
  })), "@foldkit/ui/menu/index.js#renderGroupedItems");
636
643
  };
637
644
  const backdrop = h.keyed('div')(`${id}-backdrop`, [
@@ -666,7 +673,7 @@ const menuViewImpl = defineView((model, viewInputs, h) => {
666
673
  buttonContent,
667
674
  ]),
668
675
  ...(isVisible ? visibleContent : []),
669
- ])), "@foldkit/ui/menu/index.js#anonymous~21");
676
+ ])), "@foldkit/ui/menu/index.js#anonymous~18");
670
677
  });
671
678
  /** Pairs the menu's `view` and `update` (and programmatic helpers)
672
679
  * behind a single Item-typed entry point. Declaring the menu once at
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAGN,MAAM,EAEN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAE9E,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAGtC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,EACL,YAAY,EAGb,MAAM,oBAAoB,CAAA;AAgB3B,qGAAqG;AACrG,eAAO,MAAM,KAAK;;;;;;;;;;;;EAQhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,+DAA+D;AAC/D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBlB,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,OAAO,CAAC,aAAa,CAAC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,UAAU,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;IACpC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,6EAA6E;AAC7E,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAVP,YAAY;YACZ,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;iBACvB,OAAO;oBACJ,MAAM;mBACP,MAAM;gBACT,MAAM;qBACD,MAAM;GAwKxB,CAAA"}
@@ -245,30 +245,37 @@ export const update = (model, message) => {
245
245
  * Scene tests can call `Scene.Mount.resolve(AnchorPopover, CompletedAnchorPopover())`
246
246
  * to acknowledge the mount produced by the rendered panel. */
247
247
  export const AnchorPopover = Mount.define('AnchorPopover', {
248
- buttonId: S.String,
249
- anchor: AnchorConfig,
250
- focusSelector: S.optional(S.String),
251
- arrowId: S.optional(S.String),
252
- arrowPadding: S.optional(S.Number),
253
- }, Message.CompletedAnchorPopover)(({ buttonId, anchor, focusSelector, arrowId, arrowPadding }) => __foldkitBrandViewResult((element => __foldkitBrandViewResult((Effect.gen(function* () {
254
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup(element, {
255
- buttonId,
256
- anchor,
257
- interceptTab: false,
258
- focusAfterPosition: true,
259
- ...(focusSelector !== undefined && { focusSelector }),
260
- ...(arrowId !== undefined && { arrowId }),
261
- ...(arrowPadding !== undefined && { arrowPadding }),
262
- })), "@foldkit/ui/popover/index.js#anonymous~11")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~12"));
263
- return __foldkitBrandViewResult((Message.CompletedAnchorPopover()), "@foldkit/ui/popover/index.js#anonymous~10");
264
- })), "@foldkit/ui/popover/index.js#anonymous~9")), "@foldkit/ui/popover/index.js#anonymous~8"));
248
+ args: {
249
+ buttonId: S.String,
250
+ anchor: AnchorConfig,
251
+ focusSelector: S.optional(S.String),
252
+ arrowId: S.optional(S.String),
253
+ arrowPadding: S.optional(S.Number),
254
+ },
255
+ messages: [Message.CompletedAnchorPopover],
256
+ execute: ({ element, buttonId, anchor, focusSelector, arrowId, arrowPadding, }) => __foldkitBrandViewResult((Effect.gen(function* () {
257
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup(element, {
258
+ buttonId,
259
+ anchor,
260
+ interceptTab: false,
261
+ focusAfterPosition: true,
262
+ ...(focusSelector !== undefined && { focusSelector }),
263
+ ...(arrowId !== undefined && { arrowId }),
264
+ ...(arrowPadding !== undefined && { arrowPadding }),
265
+ })), "@foldkit/ui/popover/index.js#anonymous~9")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~10"));
266
+ return __foldkitBrandViewResult((Message.CompletedAnchorPopover()), "@foldkit/ui/popover/index.js#anonymous~8");
267
+ })), "@foldkit/ui/popover/index.js#execute~6"),
268
+ });
265
269
  /** The backdrop-portaling Mount this Popover renders. Exposed so Scene tests can
266
270
  * call `Scene.Mount.resolve(PortalPopoverBackdrop, CompletedPortalPopoverBackdrop())` to
267
271
  * acknowledge the mount produced by the rendered backdrop. */
268
- export const PortalPopoverBackdrop = Mount.define('PortalPopoverBackdrop', Message.CompletedPortalPopoverBackdrop)(element => __foldkitBrandViewResult((Effect.gen(function* () {
269
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/popover/index.js#anonymous~15")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~16"));
270
- return __foldkitBrandViewResult((Message.CompletedPortalPopoverBackdrop()), "@foldkit/ui/popover/index.js#anonymous~14");
271
- })), "@foldkit/ui/popover/index.js#anonymous~13"));
272
+ export const PortalPopoverBackdrop = Mount.define('PortalPopoverBackdrop', {
273
+ messages: [Message.CompletedPortalPopoverBackdrop],
274
+ execute: ({ element }) => __foldkitBrandViewResult((Effect.gen(function* () {
275
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/popover/index.js#anonymous~12")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/popover/index.js#anonymous~13"));
276
+ return __foldkitBrandViewResult((Message.CompletedPortalPopoverBackdrop()), "@foldkit/ui/popover/index.js#anonymous~11");
277
+ })), "@foldkit/ui/popover/index.js#execute~7"),
278
+ });
272
279
  /** Programmatically opens the Popover, updating the Model and returning
273
280
  * focus and modal Commands plus an `Opened` OutMessage. */
274
281
  export const open = (model) => __foldkitBrandViewResult((update(model, Message.RequestedOpen())), "@foldkit/ui/popover/index.js#open");
@@ -286,21 +293,21 @@ export const view = defineView((model, viewInputs, h) => {
286
293
  h.DataAttribute('closed', ''),
287
294
  h.DataAttribute('enter', ''),
288
295
  h.DataAttribute('transition', ''),
289
- ]), "@foldkit/ui/popover/index.js#anonymous~18")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
296
+ ]), "@foldkit/ui/popover/index.js#anonymous~15")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
290
297
  h.DataAttribute('enter', ''),
291
298
  h.DataAttribute('transition', ''),
292
- ]), "@foldkit/ui/popover/index.js#anonymous~19")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
299
+ ]), "@foldkit/ui/popover/index.js#anonymous~16")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
293
300
  h.DataAttribute('leave', ''),
294
301
  h.DataAttribute('transition', ''),
295
- ]), "@foldkit/ui/popover/index.js#anonymous~20")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
302
+ ]), "@foldkit/ui/popover/index.js#anonymous~17")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
296
303
  h.DataAttribute('closed', ''),
297
304
  h.DataAttribute('leave', ''),
298
305
  h.DataAttribute('transition', ''),
299
- ]), "@foldkit/ui/popover/index.js#anonymous~21")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/popover/index.js#anonymous~22")));
300
- const handleButtonKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr('Enter', ' ', 'ArrowDown', () => __foldkitBrandViewResult((Option.some(isOpen ? Message.RequestedClose() : Message.RequestedOpen())), "@foldkit/ui/popover/index.js#anonymous~23")), M.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, Message.RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~24")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~25")))), "@foldkit/ui/popover/index.js#handleButtonKeyDown");
306
+ ]), "@foldkit/ui/popover/index.js#anonymous~18")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/popover/index.js#anonymous~19")));
307
+ const handleButtonKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr('Enter', ' ', 'ArrowDown', () => __foldkitBrandViewResult((Option.some(isOpen ? Message.RequestedClose() : Message.RequestedOpen())), "@foldkit/ui/popover/index.js#anonymous~20")), M.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, Message.RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~21")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~22")))), "@foldkit/ui/popover/index.js#handleButtonKeyDown");
301
308
  const handleButtonPointerDown = (pointerType, button) => __foldkitBrandViewResult((Option.some(Message.PressedPointerOnButton({ pointerType, button }))), "@foldkit/ui/popover/index.js#handleButtonPointerDown");
302
309
  const handleButtonClick = () => {
303
- const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/popover/index.js#anonymous~26"));
310
+ const isMouse = Option.exists(maybeLastButtonPointerType, type => __foldkitBrandViewResult((type === 'mouse'), "@foldkit/ui/popover/index.js#anonymous~23"));
304
311
  if (isMouse) {
305
312
  return __foldkitBrandViewResult((Message.IgnoredMouseClick()), "@foldkit/ui/popover/index.js#handleButtonClick");
306
313
  }
@@ -312,7 +319,7 @@ export const view = defineView((model, viewInputs, h) => {
312
319
  }
313
320
  };
314
321
  const handleSpaceKeyUp = (key) => __foldkitBrandViewResult((OptionExt.when(key === ' ', Message.SuppressedSpaceScroll())), "@foldkit/ui/popover/index.js#handleSpaceKeyUp");
315
- const handlePanelKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(Message.RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~27")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~28")))), "@foldkit/ui/popover/index.js#handlePanelKeyDown");
322
+ const handlePanelKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(Message.RequestedClose())), "@foldkit/ui/popover/index.js#anonymous~24")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/popover/index.js#anonymous~25")))), "@foldkit/ui/popover/index.js#handlePanelKeyDown");
316
323
  const resolveButtonLabel = () => {
317
324
  if (Predicate.isNotUndefined(ariaLabel)) {
318
325
  return __foldkitBrandViewResult(([h.AriaLabel(ariaLabel)]), "@foldkit/ui/popover/index.js#resolveButtonLabel");
@@ -376,5 +383,5 @@ export const view = defineView((model, viewInputs, h) => {
376
383
  backdrop: childAttributes(backdropAttributes),
377
384
  arrow: childAttributes(arrowAttributes),
378
385
  isVisible,
379
- })), "@foldkit/ui/popover/index.js#anonymous~17");
386
+ })), "@foldkit/ui/popover/index.js#anonymous~14");
380
387
  });
@@ -23,7 +23,8 @@ export declare const Message: import("foldkit/message").MessageUnion<{
23
23
  readonly message: import("foldkit/message").MessageUnion<{
24
24
  readonly RequestedOpen: {};
25
25
  readonly RequestedClose: {};
26
- readonly CompletedShowDialog: {};
26
+ readonly SucceededShowDialog: {};
27
+ readonly FailedShowDialog: {};
27
28
  readonly CompletedCloseDialog: {};
28
29
  readonly Unmounted: {};
29
30
  readonly CompletedReleaseDialogResources: {};
@@ -66,7 +67,9 @@ export declare const update: (model: Model, message: Message) => Readonly<{
66
67
  } | {
67
68
  readonly _tag: "RequestedClose";
68
69
  } | {
69
- readonly _tag: "CompletedShowDialog";
70
+ readonly _tag: "SucceededShowDialog";
71
+ } | {
72
+ readonly _tag: "FailedShowDialog";
70
73
  } | {
71
74
  readonly _tag: "CompletedCloseDialog";
72
75
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"disabledButton.d.ts","sourceRoot":"","sources":["../../../src/test/apps/disabledButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAGrD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAMxC,eAAO,MAAM,KAAK;;;;;;;;;;;;;EAGhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;EAIlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAA;AAoBD,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,EAAE,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQjD,CAAA;AAeJ,qCAAqC;AACrC,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAQ5D,CAAA;AAED,uDAAuD;AACvD,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAyBtE,CAAA"}
1
+ {"version":3,"file":"disabledButton.d.ts","sourceRoot":"","sources":["../../../src/test/apps/disabledButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAGrD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAMxC,eAAO,MAAM,KAAK;;;;;;;;;;;;;EAGhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;EAIlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAA;AAoBD,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,EAAE,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQjD,CAAA;AAeJ,qCAAqC;AACrC,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAQ5D,CAAA;AAED,uDAAuD;AACvD,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAyBtE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/tooltip/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,MAA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AE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF;;uEAEuE;AACvE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAVP,YAAY;YACZ,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;iBACvB,OAAO;gBACR,MAAM;qBACD,MAAM;GAyExB,CAAA"}
@@ -52,14 +52,18 @@ export const WaitBeforeShowing = Command.define('WaitBeforeShowing', {
52
52
  execute: ({ delay, version }) => __foldkitBrandViewResult((Effect.sleep(delay).pipe(Effect.as(Message.CompletedWaitBeforeShowing({ version })))), "@foldkit/ui/tooltip/tooltip.js#execute"),
53
53
  });
54
54
  /** The anchor-positioning Mount this Tooltip renders on its panel. */
55
- export const AnchorTooltip = Mount.define('AnchorTooltip', { buttonId: S.String, anchor: AnchorConfig }, Message.CompletedAnchorTooltip)(({ buttonId, anchor }) => __foldkitBrandViewResult((element => __foldkitBrandViewResult((Effect.gen(function* () {
56
- yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup(element, {
57
- buttonId,
58
- anchor,
59
- interceptTab: false,
60
- })), "@foldkit/ui/tooltip/tooltip.js#anonymous~4")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/tooltip/tooltip.js#anonymous~5"));
61
- return __foldkitBrandViewResult((Message.CompletedAnchorTooltip()), "@foldkit/ui/tooltip/tooltip.js#anonymous~3");
62
- })), "@foldkit/ui/tooltip/tooltip.js#anonymous~2")), "@foldkit/ui/tooltip/tooltip.js#anonymous"));
55
+ export const AnchorTooltip = Mount.define('AnchorTooltip', {
56
+ args: { buttonId: S.String, anchor: AnchorConfig },
57
+ messages: [Message.CompletedAnchorTooltip],
58
+ execute: ({ element, buttonId, anchor }) => __foldkitBrandViewResult((Effect.gen(function* () {
59
+ yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup(element, {
60
+ buttonId,
61
+ anchor,
62
+ interceptTab: false,
63
+ })), "@foldkit/ui/tooltip/tooltip.js#anonymous~2")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/tooltip/tooltip.js#anonymous~3"));
64
+ return __foldkitBrandViewResult((Message.CompletedAnchorTooltip()), "@foldkit/ui/tooltip/tooltip.js#anonymous");
65
+ })), "@foldkit/ui/tooltip/tooltip.js#execute~2"),
66
+ });
63
67
  const computeUpdate = (model, message) => __foldkitBrandViewResult((Message.match(message, {
64
68
  EnteredTrigger: () => {
65
69
  if (model.isOpen || model.isDismissed) {
@@ -164,7 +168,7 @@ export const update = (model, message) => {
164
168
  /** Reflects an externally-sourced hover show-delay onto the Model without
165
169
  * emitting an OutMessage. Use to mirror an external config value (a user
166
170
  * preference, a restored setting) onto the tooltip. */
167
- export const reflectShowDelay = Function.dual(2, (model, showDelay) => __foldkitBrandViewResult((evo(model, { showDelay: () => __foldkitBrandViewResult((Duration.fromInputUnsafe(showDelay)), "@foldkit/ui/tooltip/tooltip.js#showDelay") })), "@foldkit/ui/tooltip/tooltip.js#anonymous~6"));
171
+ export const reflectShowDelay = Function.dual(2, (model, showDelay) => __foldkitBrandViewResult((evo(model, { showDelay: () => __foldkitBrandViewResult((Duration.fromInputUnsafe(showDelay)), "@foldkit/ui/tooltip/tooltip.js#showDelay") })), "@foldkit/ui/tooltip/tooltip.js#anonymous~4"));
168
172
  /** Renders a headless tooltip with an anchored non-interactive panel.
169
173
  * Shows on hover (after delay) or focus (from keyboard, touch, or pen;
170
174
  * mouse-click focus is excluded). Hides on leave, blur, or Escape. */
@@ -183,7 +187,7 @@ export const view = defineView((model, viewInputs, h) => {
183
187
  }
184
188
  };
185
189
  const triggerLabelAttributes = resolveTriggerLabel();
186
- const handleTriggerKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, Message.PressedEscape())), "@foldkit/ui/tooltip/tooltip.js#anonymous~8")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tooltip/tooltip.js#anonymous~9")))), "@foldkit/ui/tooltip/tooltip.js#handleTriggerKeyDown");
190
+ const handleTriggerKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, Message.PressedEscape())), "@foldkit/ui/tooltip/tooltip.js#anonymous~6")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tooltip/tooltip.js#anonymous~7")))), "@foldkit/ui/tooltip/tooltip.js#handleTriggerKeyDown");
187
191
  const handleTriggerPointerDown = (pointerType) => __foldkitBrandViewResult((Option.some(Message.PressedPointerOnTrigger({ pointerType }))), "@foldkit/ui/tooltip/tooltip.js#handleTriggerPointerDown");
188
192
  const triggerAttributes = [
189
193
  h.Id(triggerId(id)),
@@ -218,5 +222,5 @@ export const view = defineView((model, viewInputs, h) => {
218
222
  trigger: childAttributes(triggerAttributes),
219
223
  panel: childAttributes(panelAttributes),
220
224
  isVisible: isOpen,
221
- })), "@foldkit/ui/tooltip/tooltip.js#anonymous~7");
225
+ })), "@foldkit/ui/tooltip/tooltip.js#anonymous~5");
222
226
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/ui",
3
- "version": "0.154.0-canary.cc8d62ecc9cf",
3
+ "version": "0.154.0-canary.dc82c7255dbf",
4
4
  "description": "Headless, accessible UI components for Foldkit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -118,21 +118,20 @@
118
118
  ],
119
119
  "peerDependencies": {
120
120
  "effect": "4.0.0-rc.112",
121
- "foldkit": "0.154.0-canary.cc8d62ecc9cf"
121
+ "foldkit": "0.154.0-canary.dc82c7255dbf"
122
122
  },
123
123
  "dependencies": {
124
- "@floating-ui/dom": "^1.7.6"
124
+ "@floating-ui/dom": "^1.8.0"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@effect/vitest": "4.0.0-rc.112",
128
128
  "effect": "4.0.0-rc.112",
129
- "happy-dom": "^20.10.4",
129
+ "happy-dom": "^20.11.7",
130
130
  "rimraf": "^6.1.3",
131
- "typedoc": "^0.28.19",
132
131
  "typescript": "^6.0.3",
133
- "vitest": "^4.1.9",
134
- "@foldkit/vite-plugin": "0.19.0-canary.cc8d62ecc9cf",
135
- "foldkit": "0.154.0-canary.cc8d62ecc9cf"
132
+ "vitest": "^4.1.11",
133
+ "@foldkit/vite-plugin": "0.19.0-canary.dc82c7255dbf",
134
+ "foldkit": "0.154.0-canary.dc82c7255dbf"
136
135
  },
137
136
  "keywords": [
138
137
  "foldkit",
@@ -157,7 +156,6 @@
157
156
  "scripts": {
158
157
  "clean": "rimraf dist *.tsbuildinfo",
159
158
  "build": "pnpm run clean && tsc -b tsconfig.build.json && node scripts/brand-dist.mjs",
160
- "docs": "typedoc",
161
159
  "watch": "tsc -b tsconfig.build.json --watch",
162
160
  "lint": "pnpm --filter @foldkit/oxlint-plugin build && oxlint src",
163
161
  "typecheck": "tsc -p tsconfig.json --noEmit",