@ariakit/react-core 0.4.3 → 0.4.4

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 (121) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/cjs/__chunks/{GYHP7IYG.cjs → 4XVTH6OR.cjs} +2 -2
  3. package/cjs/__chunks/{IHFGURUM.cjs → 54YZYOPA.cjs} +2 -2
  4. package/cjs/__chunks/{DCTXNU2X.cjs → COWKMNMZ.cjs} +3 -3
  5. package/cjs/__chunks/{HFNM6QV4.cjs → DAOFDKV2.cjs} +1 -1
  6. package/cjs/__chunks/{3C4RFBCG.cjs → EYZZO5IT.cjs} +1 -1
  7. package/cjs/__chunks/{3MKOUH5M.cjs → HPNCFYQJ.cjs} +4 -4
  8. package/cjs/__chunks/{A356CGND.cjs → JDCTLYQ4.cjs} +1 -1
  9. package/cjs/__chunks/{T5BWR4CB.cjs → KDTFHBKU.cjs} +2 -2
  10. package/cjs/__chunks/{NZSB7HSZ.cjs → LY4LCJM6.cjs} +2 -2
  11. package/cjs/__chunks/{7DQ2LBH2.cjs → QUHFOHHT.cjs} +35 -0
  12. package/cjs/__chunks/{AJF5DT5A.cjs → YO7LLGVA.cjs} +2 -2
  13. package/cjs/__chunks/{3XXW4Y4D.cjs → Z2VL7JHX.cjs} +2 -2
  14. package/cjs/__chunks/{CWS5RZSU.cjs → ZTAE5B6W.cjs} +9 -1
  15. package/cjs/checkbox/checkbox-check.cjs +2 -2
  16. package/cjs/collection/collection-renderer.d.cts +0 -2
  17. package/cjs/collection/collection-renderer.d.ts +0 -2
  18. package/cjs/combobox/combobox-cancel.cjs +1 -1
  19. package/cjs/combobox/combobox-disclosure.cjs +1 -1
  20. package/cjs/combobox/combobox-item-check.cjs +2 -2
  21. package/cjs/combobox/combobox-item.cjs +2 -2
  22. package/cjs/combobox/combobox-popover.cjs +23 -5
  23. package/cjs/combobox/combobox.cjs +14 -11
  24. package/cjs/combobox/combobox.d.cts +20 -0
  25. package/cjs/combobox/combobox.d.ts +20 -0
  26. package/cjs/composite/composite-input.cjs +91 -6
  27. package/cjs/composite/composite-input.d.cts +2 -0
  28. package/cjs/composite/composite-input.d.ts +2 -0
  29. package/cjs/composite/composite-item.cjs +2 -2
  30. package/cjs/composite/composite-overflow-disclosure.cjs +2 -2
  31. package/cjs/composite/composite-overflow.cjs +3 -3
  32. package/cjs/composite/composite-renderer.d.cts +0 -2
  33. package/cjs/composite/composite-renderer.d.ts +0 -2
  34. package/cjs/dialog/dialog-dismiss.cjs +2 -2
  35. package/cjs/dialog/dialog.cjs +2 -2
  36. package/cjs/form/form-radio.cjs +3 -3
  37. package/cjs/hovercard/hovercard-disclosure.cjs +1 -1
  38. package/cjs/hovercard/hovercard-dismiss.cjs +4 -4
  39. package/cjs/hovercard/hovercard.cjs +4 -4
  40. package/cjs/menu/menu-button-arrow.cjs +2 -2
  41. package/cjs/menu/menu-dismiss.cjs +4 -4
  42. package/cjs/menu/menu-item-check.cjs +2 -2
  43. package/cjs/menu/menu-item-checkbox.cjs +3 -3
  44. package/cjs/menu/menu-item-radio.cjs +5 -5
  45. package/cjs/menu/menu-item.cjs +3 -3
  46. package/cjs/menu/menu.cjs +5 -5
  47. package/cjs/popover/popover-disclosure-arrow.cjs +2 -2
  48. package/cjs/popover/popover-dismiss.cjs +3 -3
  49. package/cjs/popover/popover.cjs +3 -3
  50. package/cjs/radio/radio.cjs +3 -3
  51. package/cjs/select/select-arrow.cjs +3 -3
  52. package/cjs/select/select-item-check.cjs +2 -2
  53. package/cjs/select/select-item.cjs +2 -2
  54. package/cjs/select/select-popover.cjs +4 -4
  55. package/cjs/select/select.cjs +3 -3
  56. package/cjs/tab/tab.cjs +4 -4
  57. package/cjs/toolbar/toolbar-container.cjs +3 -3
  58. package/cjs/toolbar/toolbar-input.cjs +3 -7
  59. package/cjs/toolbar/toolbar-input.d.cts +3 -2
  60. package/cjs/toolbar/toolbar-input.d.ts +3 -2
  61. package/cjs/toolbar/toolbar-item.cjs +3 -3
  62. package/cjs/tooltip/tooltip.cjs +5 -5
  63. package/esm/__chunks/{LABIXQLW.js → 44PDY2W5.js} +1 -1
  64. package/esm/__chunks/{FYNSL2D5.js → 5H3YXAUC.js} +1 -1
  65. package/esm/__chunks/{JCOBPKEI.js → BY6P32UK.js} +1 -1
  66. package/esm/__chunks/{C5HA76JU.js → DSUHLHLE.js} +1 -1
  67. package/esm/__chunks/{NN4HLGKS.js → F2RFUFO2.js} +1 -1
  68. package/esm/__chunks/{2VWKZYYT.js → H5N72W37.js} +1 -1
  69. package/esm/__chunks/{NQ4PTILT.js → IOUGWXY5.js} +9 -1
  70. package/esm/__chunks/{X3V2DT2U.js → LTYEFENI.js} +1 -1
  71. package/esm/__chunks/{HW63KLP5.js → NFPDVAAW.js} +1 -1
  72. package/esm/__chunks/{XK6CE2M5.js → NHVUMSP7.js} +1 -1
  73. package/esm/__chunks/{RAKW656I.js → Q4PZFBSW.js} +1 -1
  74. package/esm/__chunks/{ONUY4D7O.js → R33ISPJY.js} +36 -1
  75. package/esm/__chunks/{6VDNHSLX.js → XEJ23EM6.js} +2 -2
  76. package/esm/checkbox/checkbox-check.js +1 -1
  77. package/esm/collection/collection-renderer.d.ts +0 -2
  78. package/esm/combobox/combobox-cancel.js +1 -1
  79. package/esm/combobox/combobox-disclosure.js +1 -1
  80. package/esm/combobox/combobox-item-check.js +1 -1
  81. package/esm/combobox/combobox-item.js +1 -1
  82. package/esm/combobox/combobox-popover.js +22 -4
  83. package/esm/combobox/combobox.d.ts +20 -0
  84. package/esm/combobox/combobox.js +14 -11
  85. package/esm/composite/composite-input.d.ts +2 -0
  86. package/esm/composite/composite-input.js +92 -7
  87. package/esm/composite/composite-item.js +1 -1
  88. package/esm/composite/composite-overflow-disclosure.js +1 -1
  89. package/esm/composite/composite-overflow.js +2 -2
  90. package/esm/composite/composite-renderer.d.ts +0 -2
  91. package/esm/dialog/dialog-dismiss.js +1 -1
  92. package/esm/dialog/dialog.js +1 -1
  93. package/esm/form/form-radio.js +2 -2
  94. package/esm/hovercard/hovercard-disclosure.js +1 -1
  95. package/esm/hovercard/hovercard-dismiss.js +3 -3
  96. package/esm/hovercard/hovercard.js +3 -3
  97. package/esm/menu/menu-button-arrow.js +1 -1
  98. package/esm/menu/menu-dismiss.js +3 -3
  99. package/esm/menu/menu-item-check.js +1 -1
  100. package/esm/menu/menu-item-checkbox.js +2 -2
  101. package/esm/menu/menu-item-radio.js +3 -3
  102. package/esm/menu/menu-item.js +2 -2
  103. package/esm/menu/menu.js +3 -3
  104. package/esm/popover/popover-disclosure-arrow.js +1 -1
  105. package/esm/popover/popover-dismiss.js +2 -2
  106. package/esm/popover/popover.js +2 -2
  107. package/esm/radio/radio.js +2 -2
  108. package/esm/select/select-arrow.js +2 -2
  109. package/esm/select/select-item-check.js +1 -1
  110. package/esm/select/select-item.js +1 -1
  111. package/esm/select/select-popover.js +2 -2
  112. package/esm/select/select.js +2 -2
  113. package/esm/tab/tab.js +1 -1
  114. package/esm/toolbar/toolbar-container.js +2 -2
  115. package/esm/toolbar/toolbar-input.d.ts +3 -2
  116. package/esm/toolbar/toolbar-input.js +2 -6
  117. package/esm/toolbar/toolbar-item.js +2 -2
  118. package/esm/tooltip/tooltip.js +3 -3
  119. package/package.json +2 -2
  120. package/cjs/__chunks/WGZQRLXV.cjs +0 -84
  121. package/esm/__chunks/RPGNBKKU.js +0 -84
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariakit/react-core",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Ariakit React core",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "core"
31
31
  ],
32
32
  "dependencies": {
33
- "@ariakit/core": "0.4.3",
33
+ "@ariakit/core": "0.4.4",
34
34
  "@floating-ui/dom": "^1.0.0",
35
35
  "use-sync-external-store": "^1.2.0"
36
36
  },
@@ -1,84 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
-
4
- var _6ZZYUFPWcjs = require('./6ZZYUFPW.cjs');
5
-
6
-
7
-
8
-
9
-
10
- var _NGD3IQDBcjs = require('./NGD3IQDB.cjs');
11
-
12
-
13
- var _TW3SFX4Ccjs = require('./TW3SFX4C.cjs');
14
-
15
-
16
-
17
-
18
- var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
19
-
20
- // src/composite/composite-input.ts
21
-
22
-
23
-
24
-
25
- var _dom = require('@ariakit/core/utils/dom');
26
- var _misc = require('@ariakit/core/utils/misc');
27
- var TagName = "input";
28
- function getValueLength(element) {
29
- if (_dom.isTextField.call(void 0, element)) {
30
- return element.value.length;
31
- } else if (element.isContentEditable) {
32
- const range = _dom.getDocument.call(void 0, element).createRange();
33
- range.selectNodeContents(element);
34
- return range.toString().length;
35
- }
36
- return 0;
37
- }
38
- var useCompositeInput = _NGD3IQDBcjs.createHook.call(void 0,
39
- function useCompositeInput2(_a) {
40
- var _b = _a, { store } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, ["store"]);
41
- const onKeyDownCaptureProp = props.onKeyDownCapture;
42
- const onKeyDownCapture = _TW3SFX4Ccjs.useEvent.call(void 0, (event) => {
43
- onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
44
- if (event.defaultPrevented)
45
- return;
46
- const element = event.currentTarget;
47
- if (!element.isContentEditable && !_dom.isTextField.call(void 0, element))
48
- return;
49
- const selection = _dom.getTextboxSelection.call(void 0, element);
50
- if (event.key === "ArrowRight" || event.key === "ArrowDown") {
51
- if (selection.end !== getValueLength(element)) {
52
- event.stopPropagation();
53
- }
54
- } else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
55
- if (selection.start !== 0) {
56
- event.stopPropagation();
57
- }
58
- }
59
- });
60
- const onFocusProp = props.onFocus;
61
- const onFocus = _TW3SFX4Ccjs.useEvent.call(void 0, (event) => {
62
- onFocusProp == null ? void 0 : onFocusProp(event);
63
- if (event.defaultPrevented)
64
- return;
65
- _6ZZYUFPWcjs.selectTextField.call(void 0, event.currentTarget);
66
- });
67
- props = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
68
- onKeyDownCapture,
69
- onFocus
70
- });
71
- return _misc.removeUndefinedValues.call(void 0, props);
72
- }
73
- );
74
- var CompositeInput = _NGD3IQDBcjs.memo.call(void 0,
75
- _NGD3IQDBcjs.forwardRef.call(void 0, function CompositeInput2(props) {
76
- const htmlProps = useCompositeInput(props);
77
- return _NGD3IQDBcjs.createElement.call(void 0, TagName, htmlProps);
78
- })
79
- );
80
-
81
-
82
-
83
-
84
- exports.useCompositeInput = useCompositeInput; exports.CompositeInput = CompositeInput;
@@ -1,84 +0,0 @@
1
- "use client";
2
- import {
3
- selectTextField
4
- } from "./3IEDWLST.js";
5
- import {
6
- createElement,
7
- createHook,
8
- forwardRef,
9
- memo
10
- } from "./GUCZNEAD.js";
11
- import {
12
- useEvent
13
- } from "./WOWUAP42.js";
14
- import {
15
- __objRest,
16
- __spreadProps,
17
- __spreadValues
18
- } from "./4R3V3JGP.js";
19
-
20
- // src/composite/composite-input.ts
21
- import {
22
- getDocument,
23
- getTextboxSelection,
24
- isTextField
25
- } from "@ariakit/core/utils/dom";
26
- import { removeUndefinedValues } from "@ariakit/core/utils/misc";
27
- var TagName = "input";
28
- function getValueLength(element) {
29
- if (isTextField(element)) {
30
- return element.value.length;
31
- } else if (element.isContentEditable) {
32
- const range = getDocument(element).createRange();
33
- range.selectNodeContents(element);
34
- return range.toString().length;
35
- }
36
- return 0;
37
- }
38
- var useCompositeInput = createHook(
39
- function useCompositeInput2(_a) {
40
- var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
41
- const onKeyDownCaptureProp = props.onKeyDownCapture;
42
- const onKeyDownCapture = useEvent((event) => {
43
- onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
44
- if (event.defaultPrevented)
45
- return;
46
- const element = event.currentTarget;
47
- if (!element.isContentEditable && !isTextField(element))
48
- return;
49
- const selection = getTextboxSelection(element);
50
- if (event.key === "ArrowRight" || event.key === "ArrowDown") {
51
- if (selection.end !== getValueLength(element)) {
52
- event.stopPropagation();
53
- }
54
- } else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
55
- if (selection.start !== 0) {
56
- event.stopPropagation();
57
- }
58
- }
59
- });
60
- const onFocusProp = props.onFocus;
61
- const onFocus = useEvent((event) => {
62
- onFocusProp == null ? void 0 : onFocusProp(event);
63
- if (event.defaultPrevented)
64
- return;
65
- selectTextField(event.currentTarget);
66
- });
67
- props = __spreadProps(__spreadValues({}, props), {
68
- onKeyDownCapture,
69
- onFocus
70
- });
71
- return removeUndefinedValues(props);
72
- }
73
- );
74
- var CompositeInput = memo(
75
- forwardRef(function CompositeInput2(props) {
76
- const htmlProps = useCompositeInput(props);
77
- return createElement(TagName, htmlProps);
78
- })
79
- );
80
-
81
- export {
82
- useCompositeInput,
83
- CompositeInput
84
- };