@sprawlify/primitives 0.0.21 → 0.0.22

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 (105) hide show
  1. package/dist/date-utils.d.mts +1 -1
  2. package/dist/dom-query.d.cts +1 -1
  3. package/dist/dom-query.d.mts +1 -1
  4. package/dist/{index-DikGG00a.d.mts → index-BlM1bSkX.d.mts} +1 -0
  5. package/dist/{index-BTwu-8ey.d.mts → index-DYzqCFaj.d.mts} +5 -5
  6. package/dist/machines/accordion/index.d.cts +1 -1
  7. package/dist/machines/accordion/index.d.mts +1 -1
  8. package/dist/machines/angle-slider/index.d.cts +1 -1
  9. package/dist/machines/angle-slider/index.d.mts +1 -1
  10. package/dist/machines/bottom-sheet/index.d.cts +1 -1
  11. package/dist/machines/bottom-sheet/index.d.mts +1 -1
  12. package/dist/machines/carousel/index.d.cts +1 -1
  13. package/dist/machines/carousel/index.d.mts +1 -1
  14. package/dist/machines/clipboard/index.d.cts +1 -1
  15. package/dist/machines/clipboard/index.d.mts +1 -1
  16. package/dist/machines/color-picker/index.cjs +1 -1
  17. package/dist/machines/color-picker/index.d.cts +1 -1
  18. package/dist/machines/color-picker/index.d.mts +1 -1
  19. package/dist/machines/color-picker/index.mjs +1 -1
  20. package/dist/machines/combobox/index.cjs +1 -1
  21. package/dist/machines/combobox/index.d.cts +2 -2
  22. package/dist/machines/combobox/index.d.mts +2 -2
  23. package/dist/machines/combobox/index.mjs +1 -1
  24. package/dist/machines/date-picker/index.cjs +1 -1
  25. package/dist/machines/date-picker/index.d.cts +2 -2
  26. package/dist/machines/date-picker/index.d.mts +3 -3
  27. package/dist/machines/date-picker/index.mjs +1 -1
  28. package/dist/machines/dialog/index.d.cts +1 -1
  29. package/dist/machines/dialog/index.d.mts +1 -1
  30. package/dist/machines/editable/index.d.cts +1 -1
  31. package/dist/machines/editable/index.d.mts +1 -1
  32. package/dist/machines/file-upload/index.d.cts +1 -1
  33. package/dist/machines/file-upload/index.d.mts +1 -1
  34. package/dist/machines/floating-panel/index.d.cts +1 -1
  35. package/dist/machines/floating-panel/index.d.mts +1 -1
  36. package/dist/machines/hover-card/index.cjs +1 -1
  37. package/dist/machines/hover-card/index.d.cts +2 -2
  38. package/dist/machines/hover-card/index.d.mts +2 -2
  39. package/dist/machines/hover-card/index.mjs +1 -1
  40. package/dist/machines/listbox/index.d.cts +1 -1
  41. package/dist/machines/listbox/index.d.mts +1 -1
  42. package/dist/machines/marquee/index.d.cts +3 -3
  43. package/dist/machines/marquee/index.d.mts +3 -3
  44. package/dist/machines/menu/index.cjs +1 -1
  45. package/dist/machines/menu/index.d.cts +2 -2
  46. package/dist/machines/menu/index.d.mts +2 -2
  47. package/dist/machines/menu/index.mjs +1 -1
  48. package/dist/machines/navigation-menu/index.d.cts +1 -1
  49. package/dist/machines/navigation-menu/index.d.mts +1 -1
  50. package/dist/machines/number-input/index.d.cts +1 -1
  51. package/dist/machines/number-input/index.d.mts +1 -1
  52. package/dist/machines/password-input/index.d.cts +1 -1
  53. package/dist/machines/password-input/index.d.mts +1 -1
  54. package/dist/machines/pin-input/index.d.cts +1 -1
  55. package/dist/machines/pin-input/index.d.mts +1 -1
  56. package/dist/machines/popover/index.cjs +1 -1
  57. package/dist/machines/popover/index.d.cts +2 -2
  58. package/dist/machines/popover/index.d.mts +2 -2
  59. package/dist/machines/popover/index.mjs +1 -1
  60. package/dist/machines/progress/index.d.cts +1 -1
  61. package/dist/machines/progress/index.d.mts +1 -1
  62. package/dist/machines/radio-group/index.d.cts +1 -1
  63. package/dist/machines/radio-group/index.d.mts +1 -1
  64. package/dist/machines/scroll-area/index.d.cts +1 -1
  65. package/dist/machines/scroll-area/index.d.mts +1 -1
  66. package/dist/machines/select/index.cjs +1 -1
  67. package/dist/machines/select/index.d.cts +2 -2
  68. package/dist/machines/select/index.d.mts +2 -2
  69. package/dist/machines/select/index.mjs +1 -1
  70. package/dist/machines/signature-pad/index.d.cts +1 -1
  71. package/dist/machines/signature-pad/index.d.mts +1 -1
  72. package/dist/machines/slider/index.d.cts +1 -1
  73. package/dist/machines/slider/index.d.mts +1 -1
  74. package/dist/machines/splitter/index.d.cts +1 -1
  75. package/dist/machines/splitter/index.d.mts +1 -1
  76. package/dist/machines/steps/index.d.cts +1 -1
  77. package/dist/machines/steps/index.d.mts +1 -1
  78. package/dist/machines/switch/index.d.cts +1 -1
  79. package/dist/machines/switch/index.d.mts +1 -1
  80. package/dist/machines/tabs/index.d.cts +1 -1
  81. package/dist/machines/tabs/index.d.mts +1 -1
  82. package/dist/machines/tags-input/index.d.cts +1 -1
  83. package/dist/machines/tags-input/index.d.mts +1 -1
  84. package/dist/machines/timer/index.d.cts +1 -1
  85. package/dist/machines/timer/index.d.mts +1 -1
  86. package/dist/machines/toast/index.d.cts +1 -1
  87. package/dist/machines/toast/index.d.mts +1 -1
  88. package/dist/machines/tooltip/index.cjs +1 -1
  89. package/dist/machines/tooltip/index.d.cts +2 -2
  90. package/dist/machines/tooltip/index.d.mts +2 -2
  91. package/dist/machines/tooltip/index.mjs +1 -1
  92. package/dist/machines/tour/index.cjs +1 -1
  93. package/dist/machines/tour/index.d.cts +2 -2
  94. package/dist/machines/tour/index.d.mts +2 -2
  95. package/dist/machines/tour/index.mjs +1 -1
  96. package/dist/machines/tree-view/index.d.cts +1 -1
  97. package/dist/machines/tree-view/index.d.mts +1 -1
  98. package/dist/{popper-CWip5FHB.cjs → popper-Bv3pzKqX.cjs} +2 -2
  99. package/dist/{popper-4MZcEna4.mjs → popper-PO8HYerg.mjs} +2 -2
  100. package/dist/popper.cjs +1 -1
  101. package/dist/popper.d.cts +1 -1
  102. package/dist/popper.d.mts +1 -1
  103. package/dist/popper.mjs +1 -1
  104. package/dist/{types-PjLoIczn.d.cts → types-TUsgVjZA.d.cts} +1 -0
  105. package/package.json +1 -1
@@ -6,7 +6,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
6
6
  import { n as TypeaheadState } from "../../typeahead-BWyD_KIb.cjs";
7
7
 
8
8
  //#region src/machines/tree-view/tree-view.anatomy.d.ts
9
- declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "label" | "itemText" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput" | "tree">;
9
+ declare const anatomy: AnatomyInstance<"root" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "item" | "itemIndicator" | "itemText" | "label" | "nodeCheckbox" | "nodeRenameInput" | "tree">;
10
10
  //#endregion
11
11
  //#region src/machines/tree-view/tree-view.collection.d.ts
12
12
  declare const collection: {
@@ -6,7 +6,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
6
6
  import { n as TypeaheadState } from "../../typeahead-BX-BWYjD.mjs";
7
7
 
8
8
  //#region src/machines/tree-view/tree-view.anatomy.d.ts
9
- declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "label" | "itemText" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput" | "tree">;
9
+ declare const anatomy: AnatomyInstance<"root" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "item" | "itemIndicator" | "itemText" | "label" | "nodeCheckbox" | "nodeRenameInput" | "tree">;
10
10
  //#endregion
11
11
  //#region src/machines/tree-view/tree-view.collection.d.ts
12
12
  declare const collection: {
@@ -28,7 +28,7 @@ function getDOMRect(anchorRect) {
28
28
  }
29
29
  function getAnchorElement(anchorElement, getAnchorRect) {
30
30
  return {
31
- contextElement: require_dom_query.isHTMLElement(anchorElement) ? anchorElement : void 0,
31
+ contextElement: require_dom_query.isHTMLElement(anchorElement) ? anchorElement : anchorElement?.contextElement,
32
32
  getBoundingClientRect: () => {
33
33
  const anchor = anchorElement;
34
34
  const anchorRect = getAnchorRect?.(anchor);
@@ -224,7 +224,7 @@ function getAutoUpdateOptions(opts) {
224
224
  return opts;
225
225
  }
226
226
  function getPlacementImpl(referenceOrVirtual, floating, opts = {}) {
227
- const reference = getAnchorElement(referenceOrVirtual, opts.getAnchorRect);
227
+ const reference = getAnchorElement(opts.getAnchorElement?.() ?? referenceOrVirtual, opts.getAnchorRect);
228
228
  if (!floating || !reference) return;
229
229
  const options = Object.assign({}, defaultOptions, opts);
230
230
  const arrowEl = floating.querySelector("[data-part=arrow]");
@@ -27,7 +27,7 @@ function getDOMRect(anchorRect) {
27
27
  }
28
28
  function getAnchorElement(anchorElement, getAnchorRect) {
29
29
  return {
30
- contextElement: isHTMLElement(anchorElement) ? anchorElement : void 0,
30
+ contextElement: isHTMLElement(anchorElement) ? anchorElement : anchorElement?.contextElement,
31
31
  getBoundingClientRect: () => {
32
32
  const anchor = anchorElement;
33
33
  const anchorRect = getAnchorRect?.(anchor);
@@ -223,7 +223,7 @@ function getAutoUpdateOptions(opts) {
223
223
  return opts;
224
224
  }
225
225
  function getPlacementImpl(referenceOrVirtual, floating, opts = {}) {
226
- const reference = getAnchorElement(referenceOrVirtual, opts.getAnchorRect);
226
+ const reference = getAnchorElement(opts.getAnchorElement?.() ?? referenceOrVirtual, opts.getAnchorRect);
227
227
  if (!floating || !reference) return;
228
228
  const options = Object.assign({}, defaultOptions, opts);
229
229
  const arrowEl = floating.querySelector("[data-part=arrow]");
package/dist/popper.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  require('./dom-query-CWZdWUGp.cjs');
2
2
  require('./utils-_6frwjgJ.cjs');
3
- const require_popper = require('./popper-CWip5FHB.cjs');
3
+ const require_popper = require('./popper-Bv3pzKqX.cjs');
4
4
 
5
5
  exports.getPlacement = require_popper.getPlacement;
6
6
  exports.getPlacementSide = require_popper.getPlacementSide;
package/dist/popper.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as MaybeElement, c as Placement, d as PositioningOptions, i as ComputePositionReturn, l as PlacementAlign, n as AutoUpdateOptions, o as MaybeFn, r as Boundary, s as MaybeRectElement, t as AnchorRect, u as PlacementSide } from "./types-PjLoIczn.cjs";
1
+ import { a as MaybeElement, c as Placement, d as PositioningOptions, i as ComputePositionReturn, l as PlacementAlign, n as AutoUpdateOptions, o as MaybeFn, r as Boundary, s as MaybeRectElement, t as AnchorRect, u as PlacementSide } from "./types-TUsgVjZA.cjs";
2
2
  import { Placement as Placement$1 } from "@floating-ui/dom";
3
3
 
4
4
  //#region src/shared/popper/get-placement.d.ts
package/dist/popper.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as getPlacement, c as Boundary, d as PlacementAlign, f as PlacementSide, i as getPlacementStyles, l as ComputePositionReturn, n as isValidPlacement, o as AnchorRect, p as PositioningOptions, r as GetPlacementStylesOptions, s as AutoUpdateOptions, t as getPlacementSide, u as Placement } from "./index-DikGG00a.mjs";
1
+ import { a as getPlacement, c as Boundary, d as PlacementAlign, f as PlacementSide, i as getPlacementStyles, l as ComputePositionReturn, n as isValidPlacement, o as AnchorRect, p as PositioningOptions, r as GetPlacementStylesOptions, s as AutoUpdateOptions, t as getPlacementSide, u as Placement } from "./index-BlM1bSkX.mjs";
2
2
  export { AnchorRect, AutoUpdateOptions, Boundary, ComputePositionReturn, GetPlacementStylesOptions, Placement, PlacementAlign, PlacementSide, PositioningOptions, getPlacement, getPlacementSide, getPlacementStyles, isValidPlacement };
package/dist/popper.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./dom-query-Bwyyt0Vp.mjs";
2
2
  import "./utils-hFKGi-oS.mjs";
3
- import { i as isValidPlacement, n as getPlacement, r as getPlacementSide, t as getPlacementStyles } from "./popper-4MZcEna4.mjs";
3
+ import { i as isValidPlacement, n as getPlacement, r as getPlacementSide, t as getPlacementStyles } from "./popper-PO8HYerg.mjs";
4
4
 
5
5
  export { getPlacement, getPlacementSide, getPlacementStyles, isValidPlacement };
@@ -35,6 +35,7 @@ interface PositioningOptions {
35
35
  onPositioned?: ((data: {
36
36
  placed: boolean;
37
37
  }) => void) | undefined;
38
+ getAnchorElement?: (() => HTMLElement | VirtualElement | null) | undefined;
38
39
  getAnchorRect?: ((element: HTMLElement | VirtualElement | null) => AnchorRect | null) | undefined;
39
40
  updatePosition?: ((data: {
40
41
  updatePosition: () => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprawlify/primitives",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "description": "A set of primitive components for building user interfaces.",
6
6
  "author": "sprawlify <npm@sprawlify.com>",