@jsenv/navi 0.29.299 → 0.29.300

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.
@@ -61569,6 +61569,7 @@ const css$B = /* css */`.navi_picker {
61569
61569
  --popover-background-color: var(--picker-popup-background-color, var(--navi-popup-background-color));
61570
61570
  --popover-outline-width: var(--picker-outline-width);
61571
61571
  --popover-outline-color: var(--picker-outline-color);
61572
+ --popover-box-shadow: var(--picker-popup-box-shadow, var(--navi-popup-box-shadow));
61572
61573
  --popover-max-height: var(--picker-popover-max-height);
61573
61574
  min-width: var(--picker-popover-min-width, var(--anchor-width, 0px));
61574
61575
  cursor: default;
@@ -61605,6 +61606,7 @@ const css$B = /* css */`.navi_picker {
61605
61606
  --dialog-background-color: var(--picker-popup-background-color, var(--navi-popup-background-color));
61606
61607
  --dialog-outline-width: var(--picker-outline-width);
61607
61608
  --dialog-outline-color: var(--picker-outline-color);
61609
+ --dialog-box-shadow: var(--picker-popup-box-shadow, var(--navi-popup-box-shadow));
61608
61610
  --dialog-min-width: var(--picker-dialog-min-width);
61609
61611
  --dialog-min-height: var(--picker-dialog-min-height);
61610
61612
  --dialog-max-width: var(--picker-dialog-max-width);
@@ -61789,7 +61791,10 @@ const PickerCustom = props => {
61789
61791
  // hands the popup that controller, and a controlled Dialog/Popover reads
61790
61792
  // no onOpen/onClose of its own.
61791
61793
  onOpen,
61792
- onClose
61794
+ onClose,
61795
+ // What opens the popup — the press, or an interaction navi detects
61796
+ // ("longpress", "contextmenu"…, or a list of them). See the JSDoc.
61797
+ openOn = "press"
61793
61798
  } = props;
61794
61799
  // Resolve the id the same way useControlProps does (own id > Field's id > generated id)
61795
61800
  // before computing popupId below, so two Pickers without an explicit id never collide.
@@ -61825,6 +61830,7 @@ const PickerCustom = props => {
61825
61830
  delete pickerProps.onConfirm;
61826
61831
  delete pickerProps.onOpen;
61827
61832
  delete pickerProps.onClose;
61833
+ delete pickerProps.openOn;
61828
61834
  // Read below for the popup alone; on the trigger it would land on the DOM as
61829
61835
  // an unknown attribute holding a ref object.
61830
61836
  delete pickerProps.anchor;
@@ -62222,7 +62228,29 @@ const PickerCustom = props => {
62222
62228
  // could then never form. So the picker steps back and opens on the click,
62223
62229
  // which the browser only delivers if the press stayed a press (a gesture
62224
62230
  // swallows the click it leaves behind).
62225
- const interactionsDispute = interactionsDisputeThePress(props.interactions);
62231
+ // Opening on something else than the press: the hold, the right click.
62232
+ // Declared on the picker itself, as the caller would declare their own,
62233
+ // so it is read and arbitrated like any other gesture — a swipe on the
62234
+ // same card takes the press a hold would have taken — and gated like one:
62235
+ // a read-only picker refuses it where the finger is. The press is then
62236
+ // nobody's: a tap on the card opens nothing (see the two reactions
62237
+ // below), and the keyboard keeps its own ways in (the shortcuts above).
62238
+ const openOnList = Array.isArray(openOn) ? openOn : [openOn];
62239
+ const opensOnPress = openOnList.includes("press");
62240
+ let interactions = props.interactions;
62241
+ if (!opensOnPress) {
62242
+ interactions = {
62243
+ ...interactions
62244
+ };
62245
+ for (const type of openOnList) {
62246
+ interactions[type] = e => {
62247
+ requestOpen(e);
62248
+ };
62249
+ }
62250
+ pickerProps.interactions = interactions;
62251
+ pickerProps["data-open-on"] = openOnList.join(" ");
62252
+ }
62253
+ const interactionsDispute = interactionsDisputeThePress(interactions);
62226
62254
  Object.assign(pickerProps, {
62227
62255
  eventReactionDefinitions: {
62228
62256
  mouseDown: e => {
@@ -62248,7 +62276,7 @@ const PickerCustom = props => {
62248
62276
  // because that is where such a box says what it travels by — and
62249
62277
  // asked at every press, since what the picker sits in is not the
62250
62278
  // picker's to know at mount.
62251
- if (interactionsDispute || isPressDisputedByDrag(e.target)) {
62279
+ if (!opensOnPress || interactionsDispute || isPressDisputedByDrag(e.target)) {
62252
62280
  return null;
62253
62281
  }
62254
62282
  return {
@@ -62265,6 +62293,11 @@ const PickerCustom = props => {
62265
62293
  if (isWithinPickerContent(e.target)) {
62266
62294
  return null;
62267
62295
  }
62296
+ if (!opensOnPress) {
62297
+ // Neither the tap, nor the click a hold leaves behind: the press
62298
+ // is not what opens this picker.
62299
+ return null;
62300
+ }
62268
62301
  // When a label is clicked it transfers focus to the select
62269
62302
  // in that case we want to open it (otherwise we have already opened on mousedown interaction)
62270
62303
  // And when a gesture disputes the press (see the two disputes
@@ -62345,7 +62378,12 @@ const PickerContentInsidePopup = props => {
62345
62378
  // itself, and this one does not. Popover ignores it, same as Dialog ignores
62346
62379
  // marginWithAnchor.
62347
62380
  dockedOnSmallTouchScreen,
62381
+ // Same again: the dialog takes the trigger's box as a floor (and, with
62382
+ // dialogMaxWidth="var(--anchor-width)", as a ceiling) — what keeps a card
62383
+ // its own width once lifted. Dialog's own `sizeFromAnchor`.
62384
+ dialogSizeFromAnchor,
62348
62385
  animation,
62386
+ animationDuration,
62349
62387
  // mode="callout": what the callout says about what it holds, and paints
62350
62388
  // in its border and icon — "none" for a plain tooltip (see the callout
62351
62389
  // defaults in PickerCustomResolver). And whether it wears a cross: without
@@ -62406,6 +62444,7 @@ const PickerContentInsidePopup = props => {
62406
62444
  mode: mode,
62407
62445
  layer: popupLayer,
62408
62446
  animation: animation,
62447
+ animationDuration: animationDuration,
62409
62448
  positionArea: isPopover ? positionArea ?? (popoverMode === "nearby" ? "bottom-start" : "inset(top-left)") : positionArea,
62410
62449
  marginWithAnchor: isPopover ? popoverSpacing : undefined,
62411
62450
  marginWithContainer: marginWithContainer === undefined && isPopover ? popoverSpacing : marginWithContainer,
@@ -62420,6 +62459,7 @@ const PickerContentInsidePopup = props => {
62420
62459
  expandX: isPopover ? undefined : dialogExpandX,
62421
62460
  expandY: isPopover ? undefined : dialogExpandY,
62422
62461
  dockedOnSmallTouchScreen: isPopover ? undefined : dockedOnSmallTouchScreen,
62462
+ sizeFromAnchor: isPopover ? undefined : dialogSizeFromAnchor,
62423
62463
  children: jsx(PopupModeContext.Provider, {
62424
62464
  value: mode,
62425
62465
  children: children
@@ -70379,6 +70419,11 @@ const css$t = /* css */`@layer navi {
70379
70419
  }
70380
70420
  }
70381
70421
 
70422
+ &[data-open-on~="longpress"] {
70423
+ -webkit-touch-callout: none;
70424
+ user-select: none;
70425
+ }
70426
+
70382
70427
  &[navi-ui-custom] {
70383
70428
  & .navi_picker_input {
70384
70429
  top: calc(-1 * (var(--picker-border-width) + var(--x-picker-press-padding-top)));
@@ -71192,6 +71237,7 @@ const PickerStyleCSSVars = {
71192
71237
  "dialogMaxHeight": ["--picker-dialog-max-height", "maxHeight"],
71193
71238
  "popupBackgroundColor": "--picker-popup-background-color",
71194
71239
  "popupBorderRadius": ["--picker-popup-border-radius", "borderRadius"],
71240
+ "popupBoxShadow": ["--picker-popup-box-shadow", "boxShadow"],
71195
71241
  "dialogBorderWidth": ["--picker-dialog-border-width", "borderWidth"],
71196
71242
  "slotSpacing": ["--picker-slot-spacing", "margin"],
71197
71243
  "pressPadding": ["--picker-press-padding", "padding"],