@ariakit/react-core 0.4.3 → 0.4.5
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/CHANGELOG.md +58 -0
- package/cjs/__chunks/{7DQ2LBH2.cjs → 3HMQOCLF.cjs} +23 -5
- package/cjs/__chunks/{AJF5DT5A.cjs → AY5J25V7.cjs} +2 -2
- package/cjs/__chunks/{HFNM6QV4.cjs → DAOFDKV2.cjs} +1 -1
- package/cjs/__chunks/{GYHP7IYG.cjs → DFXPO2ED.cjs} +2 -2
- package/cjs/__chunks/{3C4RFBCG.cjs → EYZZO5IT.cjs} +1 -1
- package/cjs/__chunks/{3MKOUH5M.cjs → GZ2NNSLV.cjs} +4 -4
- package/cjs/__chunks/ISJGSS4S.cjs +16 -0
- package/cjs/__chunks/{A356CGND.cjs → JDCTLYQ4.cjs} +1 -1
- package/cjs/__chunks/{T5BWR4CB.cjs → KDTFHBKU.cjs} +2 -2
- package/cjs/__chunks/{NZSB7HSZ.cjs → LY4LCJM6.cjs} +2 -2
- package/cjs/__chunks/{DCTXNU2X.cjs → N43E53E6.cjs} +3 -3
- package/cjs/__chunks/{IHFGURUM.cjs → NRPEUNJB.cjs} +2 -2
- package/cjs/__chunks/PVLZGFP6.cjs +34 -0
- package/cjs/__chunks/{CWS5RZSU.cjs → QJDA4LG6.cjs} +28 -17
- package/cjs/__chunks/{NDVZ37O3.cjs → RG6U7KAS.cjs} +22 -4
- package/cjs/__chunks/YWAHOWYE.cjs +25 -0
- package/cjs/__chunks/{3XXW4Y4D.cjs → Z2VL7JHX.cjs} +2 -2
- package/cjs/checkbox/checkbox-check.cjs +2 -2
- package/cjs/collection/collection-renderer.d.cts +0 -2
- package/cjs/collection/collection-renderer.d.ts +0 -2
- package/cjs/combobox/combobox-cancel.cjs +4 -4
- package/cjs/combobox/combobox-disclosure.cjs +4 -4
- package/cjs/combobox/combobox-item-check.cjs +2 -2
- package/cjs/combobox/combobox-item.cjs +19 -9
- package/cjs/combobox/combobox-item.d.cts +22 -12
- package/cjs/combobox/combobox-item.d.ts +22 -12
- package/cjs/combobox/combobox-popover.cjs +41 -16
- package/cjs/combobox/combobox-provider.cjs +3 -2
- package/cjs/combobox/combobox-store.cjs +6 -2
- package/cjs/combobox/combobox-store.d.cts +12 -4
- package/cjs/combobox/combobox-store.d.ts +12 -4
- package/cjs/combobox/combobox-value.cjs +32 -0
- package/cjs/combobox/combobox-value.d.cts +41 -0
- package/cjs/combobox/combobox-value.d.ts +41 -0
- package/cjs/combobox/combobox.cjs +79 -32
- package/cjs/combobox/combobox.d.cts +20 -0
- package/cjs/combobox/combobox.d.ts +20 -0
- package/cjs/composite/composite-input.cjs +91 -6
- package/cjs/composite/composite-input.d.cts +2 -0
- package/cjs/composite/composite-input.d.ts +2 -0
- package/cjs/composite/composite-item.cjs +3 -3
- package/cjs/composite/composite-overflow-disclosure.cjs +3 -3
- package/cjs/composite/composite-overflow.cjs +12 -12
- package/cjs/composite/composite-renderer.d.cts +0 -2
- package/cjs/composite/composite-renderer.d.ts +0 -2
- package/cjs/dialog/dialog-backdrop.cjs +3 -3
- package/cjs/dialog/dialog-dismiss.cjs +2 -2
- package/cjs/dialog/dialog.cjs +11 -11
- package/cjs/dialog/dialog.d.cts +4 -0
- package/cjs/dialog/dialog.d.ts +4 -0
- package/cjs/dialog/utils/disable-tree.cjs +3 -3
- package/cjs/dialog/utils/use-prevent-body-scroll.cjs +3 -3
- package/cjs/form/form-checkbox.cjs +1 -1
- package/cjs/form/form-push.cjs +1 -1
- package/cjs/form/form-radio.cjs +4 -4
- package/cjs/hovercard/hovercard-disclosure.cjs +1 -1
- package/cjs/hovercard/hovercard-dismiss.cjs +4 -4
- package/cjs/hovercard/hovercard.cjs +13 -13
- package/cjs/menu/menu-button-arrow.cjs +2 -2
- package/cjs/menu/menu-dismiss.cjs +4 -4
- package/cjs/menu/menu-item-check.cjs +2 -2
- package/cjs/menu/menu-item-checkbox.cjs +4 -4
- package/cjs/menu/menu-item-radio.cjs +7 -7
- package/cjs/menu/menu-item.cjs +4 -4
- package/cjs/menu/menu.cjs +14 -14
- package/cjs/popover/popover-disclosure-arrow.cjs +2 -2
- package/cjs/popover/popover-dismiss.cjs +3 -3
- package/cjs/popover/popover.cjs +12 -12
- package/cjs/radio/radio.cjs +4 -4
- package/cjs/select/select-arrow.cjs +3 -3
- package/cjs/select/select-item-check.cjs +2 -2
- package/cjs/select/select-item.cjs +4 -4
- package/cjs/select/select-popover.cjs +13 -13
- package/cjs/select/select-value.d.cts +8 -7
- package/cjs/select/select-value.d.ts +8 -7
- package/cjs/select/select.cjs +4 -4
- package/cjs/tab/tab-panel.cjs +2 -2
- package/cjs/tab/tab.cjs +7 -7
- package/cjs/tag/tag-context.cjs +25 -0
- package/cjs/tag/tag-context.d.cts +21 -0
- package/cjs/tag/tag-context.d.ts +21 -0
- package/cjs/tag/tag-input.cjs +191 -0
- package/cjs/tag/tag-input.d.cts +122 -0
- package/cjs/tag/tag-input.d.ts +122 -0
- package/cjs/tag/tag-list-label.cjs +56 -0
- package/cjs/tag/tag-list-label.d.cts +55 -0
- package/cjs/tag/tag-list-label.d.ts +55 -0
- package/cjs/tag/tag-list.cjs +141 -0
- package/cjs/tag/tag-list.d.cts +58 -0
- package/cjs/tag/tag-list.d.ts +58 -0
- package/cjs/tag/tag-provider.cjs +26 -0
- package/cjs/tag/tag-provider.d.cts +29 -0
- package/cjs/tag/tag-provider.d.ts +29 -0
- package/cjs/tag/tag-remove.cjs +119 -0
- package/cjs/tag/tag-remove.d.cts +67 -0
- package/cjs/tag/tag-remove.d.ts +67 -0
- package/cjs/tag/tag-store.cjs +15 -0
- package/cjs/tag/tag-store.d.cts +49 -0
- package/cjs/tag/tag-store.d.ts +49 -0
- package/cjs/tag/tag-value.cjs +29 -0
- package/cjs/tag/tag-value.d.cts +41 -0
- package/cjs/tag/tag-value.d.ts +41 -0
- package/cjs/tag/tag-values.cjs +29 -0
- package/cjs/tag/tag-values.d.cts +52 -0
- package/cjs/tag/tag-values.d.ts +52 -0
- package/cjs/tag/tag.cjs +130 -0
- package/cjs/tag/tag.d.cts +74 -0
- package/cjs/tag/tag.d.ts +74 -0
- package/cjs/tag/utils.cjs +8 -0
- package/cjs/tag/utils.d.cts +1 -0
- package/cjs/tag/utils.d.ts +1 -0
- package/cjs/toolbar/toolbar-container.cjs +4 -4
- package/cjs/toolbar/toolbar-input.cjs +4 -8
- package/cjs/toolbar/toolbar-input.d.cts +3 -2
- package/cjs/toolbar/toolbar-input.d.ts +3 -2
- package/cjs/toolbar/toolbar-item.cjs +4 -4
- package/cjs/tooltip/tooltip.cjs +14 -14
- package/combobox/combobox-value/package.json +8 -0
- package/esm/__chunks/{LABIXQLW.js → 44PDY2W5.js} +1 -1
- package/esm/__chunks/{FYNSL2D5.js → 5H3YXAUC.js} +1 -1
- package/esm/__chunks/{6VDNHSLX.js → 65LF6MEO.js} +2 -2
- package/esm/__chunks/{X3V2DT2U.js → 6YVAEELE.js} +1 -1
- package/esm/__chunks/{JCOBPKEI.js → BY6P32UK.js} +1 -1
- package/esm/__chunks/{ZFEEEZVE.js → DLLQM6DZ.js} +22 -4
- package/esm/__chunks/{NN4HLGKS.js → F2RFUFO2.js} +1 -1
- package/esm/__chunks/{NQ4PTILT.js → FGHVVLPU.js} +29 -18
- package/esm/__chunks/{2VWKZYYT.js → H5N72W37.js} +1 -1
- package/esm/__chunks/L7IM35RU.js +16 -0
- package/esm/__chunks/{HW63KLP5.js → M354SEUF.js} +1 -1
- package/esm/__chunks/{RAKW656I.js → Q4PZFBSW.js} +1 -1
- package/esm/__chunks/QNNHZL3W.js +25 -0
- package/esm/__chunks/{C5HA76JU.js → QZJOXZKA.js} +1 -1
- package/esm/__chunks/{XK6CE2M5.js → UKDZLPKH.js} +1 -1
- package/esm/__chunks/{ONUY4D7O.js → VGORKDMQ.js} +26 -8
- package/esm/__chunks/WYDDZRWN.js +34 -0
- package/esm/checkbox/checkbox-check.js +1 -1
- package/esm/collection/collection-renderer.d.ts +0 -2
- package/esm/combobox/combobox-cancel.js +4 -4
- package/esm/combobox/combobox-disclosure.js +4 -4
- package/esm/combobox/combobox-item-check.js +1 -1
- package/esm/combobox/combobox-item.d.ts +22 -12
- package/esm/combobox/combobox-item.js +19 -9
- package/esm/combobox/combobox-popover.js +40 -15
- package/esm/combobox/combobox-provider.js +2 -1
- package/esm/combobox/combobox-store.d.ts +12 -4
- package/esm/combobox/combobox-store.js +5 -1
- package/esm/combobox/combobox-value.d.ts +41 -0
- package/esm/combobox/combobox-value.js +32 -0
- package/esm/combobox/combobox.d.ts +20 -0
- package/esm/combobox/combobox.js +80 -33
- package/esm/composite/composite-input.d.ts +2 -0
- package/esm/composite/composite-input.js +92 -7
- package/esm/composite/composite-item.js +2 -2
- package/esm/composite/composite-overflow-disclosure.js +2 -2
- package/esm/composite/composite-overflow.js +11 -11
- package/esm/composite/composite-renderer.d.ts +0 -2
- package/esm/dialog/dialog-backdrop.js +2 -2
- package/esm/dialog/dialog-dismiss.js +1 -1
- package/esm/dialog/dialog.d.ts +4 -0
- package/esm/dialog/dialog.js +10 -10
- package/esm/dialog/utils/disable-tree.js +2 -2
- package/esm/dialog/utils/use-prevent-body-scroll.js +2 -2
- package/esm/form/form-checkbox.js +1 -1
- package/esm/form/form-push.js +1 -1
- package/esm/form/form-radio.js +3 -3
- package/esm/hovercard/hovercard-disclosure.js +1 -1
- package/esm/hovercard/hovercard-dismiss.js +3 -3
- package/esm/hovercard/hovercard.js +12 -12
- package/esm/menu/menu-button-arrow.js +1 -1
- package/esm/menu/menu-dismiss.js +3 -3
- package/esm/menu/menu-item-check.js +1 -1
- package/esm/menu/menu-item-checkbox.js +3 -3
- package/esm/menu/menu-item-radio.js +5 -5
- package/esm/menu/menu-item.js +3 -3
- package/esm/menu/menu.js +12 -12
- package/esm/popover/popover-disclosure-arrow.js +1 -1
- package/esm/popover/popover-dismiss.js +2 -2
- package/esm/popover/popover.js +11 -11
- package/esm/radio/radio.js +3 -3
- package/esm/select/select-arrow.js +2 -2
- package/esm/select/select-item-check.js +1 -1
- package/esm/select/select-item.js +4 -4
- package/esm/select/select-popover.js +11 -11
- package/esm/select/select-value.d.ts +8 -7
- package/esm/select/select.js +3 -3
- package/esm/tab/tab-panel.js +3 -3
- package/esm/tab/tab.js +5 -5
- package/esm/tag/tag-context.d.ts +21 -0
- package/esm/tag/tag-context.js +25 -0
- package/esm/tag/tag-input.d.ts +122 -0
- package/esm/tag/tag-input.js +191 -0
- package/esm/tag/tag-list-label.d.ts +55 -0
- package/esm/tag/tag-list-label.js +56 -0
- package/esm/tag/tag-list.d.ts +58 -0
- package/esm/tag/tag-list.js +141 -0
- package/esm/tag/tag-provider.d.ts +29 -0
- package/esm/tag/tag-provider.js +26 -0
- package/esm/tag/tag-remove.d.ts +67 -0
- package/esm/tag/tag-remove.js +119 -0
- package/esm/tag/tag-store.d.ts +49 -0
- package/esm/tag/tag-store.js +15 -0
- package/esm/tag/tag-value.d.ts +41 -0
- package/esm/tag/tag-value.js +29 -0
- package/esm/tag/tag-values.d.ts +52 -0
- package/esm/tag/tag-values.js +29 -0
- package/esm/tag/tag.d.ts +74 -0
- package/esm/tag/tag.js +130 -0
- package/esm/tag/utils.d.ts +1 -0
- package/esm/tag/utils.js +8 -0
- package/esm/toolbar/toolbar-container.js +3 -3
- package/esm/toolbar/toolbar-input.d.ts +3 -2
- package/esm/toolbar/toolbar-input.js +3 -7
- package/esm/toolbar/toolbar-item.js +3 -3
- package/esm/tooltip/tooltip.js +12 -12
- package/package.json +86 -2
- package/tag/tag/package.json +8 -0
- package/tag/tag-context/package.json +8 -0
- package/tag/tag-input/package.json +8 -0
- package/tag/tag-list/package.json +8 -0
- package/tag/tag-list-label/package.json +8 -0
- package/tag/tag-provider/package.json +8 -0
- package/tag/tag-remove/package.json +8 -0
- package/tag/tag-store/package.json +8 -0
- package/tag/tag-value/package.json +8 -0
- package/tag/tag-values/package.json +8 -0
- package/tag/utils/package.json +8 -0
- package/cjs/__chunks/WGZQRLXV.cjs +0 -84
- package/esm/__chunks/RPGNBKKU.js +0 -84
- package/cjs/__chunks/{37BRXQN7.cjs → BX2QEIBH.cjs} +3 -3
- package/cjs/__chunks/{PVYTX5U5.cjs → SL55T4ZB.cjs} +2 -2
- package/cjs/__chunks/{TSEXNK3K.cjs → VR6GCLOV.cjs} +2 -2
- package/esm/__chunks/{PTPUIM7N.js → 3TEK3C5Q.js} +3 -3
- package/esm/__chunks/{U2L67A6K.js → BC72XE6E.js} +3 -3
- package/esm/__chunks/{GOXKZAQI.js → CMFBAHKI.js} +3 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ElementType, KeyboardEvent } from "react";
|
|
2
|
+
import type { BooleanOrCallback } from "@ariakit/core/utils/types";
|
|
3
|
+
import type { CompositeItemOptions } from "../composite/composite-item.js";
|
|
4
|
+
import type { Props } from "../utils/types.js";
|
|
5
|
+
import type { TagStore } from "./tag-store.js";
|
|
6
|
+
declare const TagName = "div";
|
|
7
|
+
type TagName = typeof TagName;
|
|
8
|
+
type HTMLType = HTMLElementTagNameMap[TagName];
|
|
9
|
+
/**
|
|
10
|
+
* Returns props to create a `Tag` component.
|
|
11
|
+
* @see https://ariakit.org/components/tag
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* const props = useTag();
|
|
15
|
+
* <Role.div {...props} />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const useTag: import("../utils/types.js").Hook<"div", TagOptions<"div">>;
|
|
19
|
+
/**
|
|
20
|
+
* Renders a tag element inside a
|
|
21
|
+
* [`TagList`](https://ariakit.org/reference/tag-list) wrapper.
|
|
22
|
+
*
|
|
23
|
+
* The user can remove the tag by pressing `Backspace` or `Delete` keys when the
|
|
24
|
+
* tag is focused. The
|
|
25
|
+
* [`removeOnKeyPress`](https://ariakit.org/reference/tag#removeonkeypress) prop
|
|
26
|
+
* can be used to disable this behavior.
|
|
27
|
+
*
|
|
28
|
+
* When a printable key is pressed, the focus is automatically moved to the
|
|
29
|
+
* input element.
|
|
30
|
+
* @see https://ariakit.org/components/tag
|
|
31
|
+
* @example
|
|
32
|
+
* ```jsx {7-10}
|
|
33
|
+
* <TagProvider>
|
|
34
|
+
* <TagListLabel>Invitees</TagListLabel>
|
|
35
|
+
* <TagList>
|
|
36
|
+
* <TagValues>
|
|
37
|
+
* {(values) =>
|
|
38
|
+
* values.map((value) => (
|
|
39
|
+
* <Tag key={value} value={value}>
|
|
40
|
+
* {value}
|
|
41
|
+
* <TagRemove />
|
|
42
|
+
* </Tag>
|
|
43
|
+
* ))
|
|
44
|
+
* }
|
|
45
|
+
* </TagValues>
|
|
46
|
+
* <TagInput />
|
|
47
|
+
* </TagList>
|
|
48
|
+
* </TagProvider>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const Tag: (props: TagProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
52
|
+
export interface TagOptions<T extends ElementType = TagName> extends CompositeItemOptions<T> {
|
|
53
|
+
/**
|
|
54
|
+
* Object returned by the
|
|
55
|
+
* [`useTagStore`](https://ariakit.org/reference/use-tag-store) hook. If not
|
|
56
|
+
* provided, the closest [`TagList`](https://ariakit.org/reference/tag-list)
|
|
57
|
+
* component's context will be used.
|
|
58
|
+
*/
|
|
59
|
+
store?: TagStore;
|
|
60
|
+
/**
|
|
61
|
+
* The unique value of the tag. This is automatically rendered as the tag's
|
|
62
|
+
* content if no children are provided.
|
|
63
|
+
*/
|
|
64
|
+
value: string;
|
|
65
|
+
/**
|
|
66
|
+
* Defines the behavior of the `Backspace` and `Delete` keys when the tag is
|
|
67
|
+
* focused. If `true`, the tag is removed. If it's a function, it's invoked
|
|
68
|
+
* with the key event and should return a boolean.
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
removeOnKeyPress?: BooleanOrCallback<KeyboardEvent<HTMLType>>;
|
|
72
|
+
}
|
|
73
|
+
export type TagProps<T extends ElementType = TagName> = Props<T, TagOptions<T>>;
|
|
74
|
+
export {};
|
package/cjs/tag/tag.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ElementType, KeyboardEvent } from "react";
|
|
2
|
+
import type { BooleanOrCallback } from "@ariakit/core/utils/types";
|
|
3
|
+
import type { CompositeItemOptions } from "../composite/composite-item.js";
|
|
4
|
+
import type { Props } from "../utils/types.js";
|
|
5
|
+
import type { TagStore } from "./tag-store.js";
|
|
6
|
+
declare const TagName = "div";
|
|
7
|
+
type TagName = typeof TagName;
|
|
8
|
+
type HTMLType = HTMLElementTagNameMap[TagName];
|
|
9
|
+
/**
|
|
10
|
+
* Returns props to create a `Tag` component.
|
|
11
|
+
* @see https://ariakit.org/components/tag
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* const props = useTag();
|
|
15
|
+
* <Role.div {...props} />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const useTag: import("../utils/types.js").Hook<"div", TagOptions<"div">>;
|
|
19
|
+
/**
|
|
20
|
+
* Renders a tag element inside a
|
|
21
|
+
* [`TagList`](https://ariakit.org/reference/tag-list) wrapper.
|
|
22
|
+
*
|
|
23
|
+
* The user can remove the tag by pressing `Backspace` or `Delete` keys when the
|
|
24
|
+
* tag is focused. The
|
|
25
|
+
* [`removeOnKeyPress`](https://ariakit.org/reference/tag#removeonkeypress) prop
|
|
26
|
+
* can be used to disable this behavior.
|
|
27
|
+
*
|
|
28
|
+
* When a printable key is pressed, the focus is automatically moved to the
|
|
29
|
+
* input element.
|
|
30
|
+
* @see https://ariakit.org/components/tag
|
|
31
|
+
* @example
|
|
32
|
+
* ```jsx {7-10}
|
|
33
|
+
* <TagProvider>
|
|
34
|
+
* <TagListLabel>Invitees</TagListLabel>
|
|
35
|
+
* <TagList>
|
|
36
|
+
* <TagValues>
|
|
37
|
+
* {(values) =>
|
|
38
|
+
* values.map((value) => (
|
|
39
|
+
* <Tag key={value} value={value}>
|
|
40
|
+
* {value}
|
|
41
|
+
* <TagRemove />
|
|
42
|
+
* </Tag>
|
|
43
|
+
* ))
|
|
44
|
+
* }
|
|
45
|
+
* </TagValues>
|
|
46
|
+
* <TagInput />
|
|
47
|
+
* </TagList>
|
|
48
|
+
* </TagProvider>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const Tag: (props: TagProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
52
|
+
export interface TagOptions<T extends ElementType = TagName> extends CompositeItemOptions<T> {
|
|
53
|
+
/**
|
|
54
|
+
* Object returned by the
|
|
55
|
+
* [`useTagStore`](https://ariakit.org/reference/use-tag-store) hook. If not
|
|
56
|
+
* provided, the closest [`TagList`](https://ariakit.org/reference/tag-list)
|
|
57
|
+
* component's context will be used.
|
|
58
|
+
*/
|
|
59
|
+
store?: TagStore;
|
|
60
|
+
/**
|
|
61
|
+
* The unique value of the tag. This is automatically rendered as the tag's
|
|
62
|
+
* content if no children are provided.
|
|
63
|
+
*/
|
|
64
|
+
value: string;
|
|
65
|
+
/**
|
|
66
|
+
* Defines the behavior of the `Backspace` and `Delete` keys when the tag is
|
|
67
|
+
* focused. If `true`, the tag is removed. If it's a function, it's invoked
|
|
68
|
+
* with the key event and should return a boolean.
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
removeOnKeyPress?: BooleanOrCallback<KeyboardEvent<HTMLType>>;
|
|
72
|
+
}
|
|
73
|
+
export type TagProps<T extends ElementType = TagName> = Props<T, TagOptions<T>>;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTouchDevice(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTouchDevice(): boolean;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
var _MJP4XPFZcjs = require('../__chunks/MJP4XPFZ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/U4NXCMZ3.cjs');
|
|
7
|
+
var _AY5J25V7cjs = require('../__chunks/AY5J25V7.cjs');
|
|
8
|
+
require('../__chunks/3HMQOCLF.cjs');
|
|
10
9
|
require('../__chunks/HD5AHCRI.cjs');
|
|
10
|
+
require('../__chunks/U4NXCMZ3.cjs');
|
|
11
11
|
require('../__chunks/6ZZYUFPW.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -38,7 +38,7 @@ var useToolbarContainer = _NGD3IQDBcjs.createHook.call(void 0,
|
|
|
38
38
|
const context = _MVDQWSSVcjs.useToolbarContext.call(void 0, );
|
|
39
39
|
store = store || context;
|
|
40
40
|
props = _MJP4XPFZcjs.useCompositeContainer.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
41
|
-
props =
|
|
41
|
+
props = _AY5J25V7cjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
42
42
|
return props;
|
|
43
43
|
}
|
|
44
44
|
);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _AJF5DT5Acjs = require('../__chunks/AJF5DT5A.cjs');
|
|
8
|
-
require('../__chunks/7DQ2LBH2.cjs');
|
|
9
|
-
require('../__chunks/U4NXCMZ3.cjs');
|
|
4
|
+
var _AY5J25V7cjs = require('../__chunks/AY5J25V7.cjs');
|
|
5
|
+
require('../__chunks/3HMQOCLF.cjs');
|
|
10
6
|
require('../__chunks/HD5AHCRI.cjs');
|
|
7
|
+
require('../__chunks/U4NXCMZ3.cjs');
|
|
11
8
|
require('../__chunks/6ZZYUFPW.cjs');
|
|
12
9
|
|
|
13
10
|
|
|
@@ -37,8 +34,7 @@ var useToolbarInput = _NGD3IQDBcjs.createHook.call(void 0,
|
|
|
37
34
|
var _b = _a, { store } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, ["store"]);
|
|
38
35
|
const context = _MVDQWSSVcjs.useToolbarContext.call(void 0, );
|
|
39
36
|
store = store || context;
|
|
40
|
-
props =
|
|
41
|
-
props = _AJF5DT5Acjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
37
|
+
props = _AY5J25V7cjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
42
38
|
return props;
|
|
43
39
|
}
|
|
44
40
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ElementType } from "react";
|
|
2
|
-
import type { CompositeInputOptions } from "../composite/composite-input.js";
|
|
3
2
|
import type { Props } from "../utils/types.js";
|
|
4
3
|
import type { ToolbarItemOptions } from "./toolbar-item.js";
|
|
5
4
|
declare const TagName = "input";
|
|
@@ -7,6 +6,7 @@ type TagName = typeof TagName;
|
|
|
7
6
|
/**
|
|
8
7
|
* Returns props to create a `ToolbarInput` component.
|
|
9
8
|
* @see https://ariakit.org/components/toolbar
|
|
9
|
+
* @deprecated Use `useToolbarItem` instead.
|
|
10
10
|
* @example
|
|
11
11
|
* ```jsx
|
|
12
12
|
* const store = useToolbarStore();
|
|
@@ -21,6 +21,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
|
|
|
21
21
|
* Renders a text input as a toolbar item, maintaining arrow key navigation on
|
|
22
22
|
* the toolbar.
|
|
23
23
|
* @see https://ariakit.org/components/toolbar
|
|
24
|
+
* @deprecated Use `<ToolbarItem render={<input />}>` instead.
|
|
24
25
|
* @example
|
|
25
26
|
* ```jsx {2}
|
|
26
27
|
* <Toolbar>
|
|
@@ -29,7 +30,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
|
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
32
|
export declare const ToolbarInput: (props: ToolbarInputProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
32
|
-
export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T
|
|
33
|
+
export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T> {
|
|
33
34
|
}
|
|
34
35
|
export type ToolbarInputProps<T extends ElementType = TagName> = Props<T, ToolbarInputOptions<T>>;
|
|
35
36
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ElementType } from "react";
|
|
2
|
-
import type { CompositeInputOptions } from "../composite/composite-input.js";
|
|
3
2
|
import type { Props } from "../utils/types.js";
|
|
4
3
|
import type { ToolbarItemOptions } from "./toolbar-item.js";
|
|
5
4
|
declare const TagName = "input";
|
|
@@ -7,6 +6,7 @@ type TagName = typeof TagName;
|
|
|
7
6
|
/**
|
|
8
7
|
* Returns props to create a `ToolbarInput` component.
|
|
9
8
|
* @see https://ariakit.org/components/toolbar
|
|
9
|
+
* @deprecated Use `useToolbarItem` instead.
|
|
10
10
|
* @example
|
|
11
11
|
* ```jsx
|
|
12
12
|
* const store = useToolbarStore();
|
|
@@ -21,6 +21,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
|
|
|
21
21
|
* Renders a text input as a toolbar item, maintaining arrow key navigation on
|
|
22
22
|
* the toolbar.
|
|
23
23
|
* @see https://ariakit.org/components/toolbar
|
|
24
|
+
* @deprecated Use `<ToolbarItem render={<input />}>` instead.
|
|
24
25
|
* @example
|
|
25
26
|
* ```jsx {2}
|
|
26
27
|
* <Toolbar>
|
|
@@ -29,7 +30,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
|
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
32
|
export declare const ToolbarInput: (props: ToolbarInputProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
32
|
-
export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T
|
|
33
|
+
export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T> {
|
|
33
34
|
}
|
|
34
35
|
export type ToolbarInputProps<T extends ElementType = TagName> = Props<T, ToolbarInputOptions<T>>;
|
|
35
36
|
export {};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/U4NXCMZ3.cjs');
|
|
5
|
+
var _AY5J25V7cjs = require('../__chunks/AY5J25V7.cjs');
|
|
6
|
+
require('../__chunks/3HMQOCLF.cjs');
|
|
8
7
|
require('../__chunks/HD5AHCRI.cjs');
|
|
8
|
+
require('../__chunks/U4NXCMZ3.cjs');
|
|
9
9
|
require('../__chunks/6ZZYUFPW.cjs');
|
|
10
10
|
require('../__chunks/MVDQWSSV.cjs');
|
|
11
11
|
require('../__chunks/VPI3EKVY.cjs');
|
|
@@ -20,4 +20,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
exports.ToolbarItem =
|
|
23
|
+
exports.ToolbarItem = _AY5J25V7cjs.ToolbarItem; exports.useToolbarItem = _AY5J25V7cjs.useToolbarItem;
|
package/cjs/tooltip/tooltip.cjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _GZ2NNSLVcjs = require('../__chunks/GZ2NNSLV.cjs');
|
|
5
5
|
require('../__chunks/KXQOQQ5B.cjs');
|
|
6
|
-
require('../__chunks/
|
|
6
|
+
require('../__chunks/N43E53E6.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
11
|
-
require('../__chunks/JF225FQ5.cjs');
|
|
12
|
-
require('../__chunks/37BRXQN7.cjs');
|
|
13
|
-
require('../__chunks/MU7F4QWJ.cjs');
|
|
14
|
-
require('../__chunks/PVYTX5U5.cjs');
|
|
15
|
-
require('../__chunks/DLIQLPX4.cjs');
|
|
9
|
+
var _QJDA4LG6cjs = require('../__chunks/QJDA4LG6.cjs');
|
|
10
|
+
require('../__chunks/VR6GCLOV.cjs');
|
|
16
11
|
require('../__chunks/UUJ5Q6IA.cjs');
|
|
17
12
|
require('../__chunks/4H7FYXWQ.cjs');
|
|
13
|
+
require('../__chunks/JF225FQ5.cjs');
|
|
18
14
|
require('../__chunks/JKERATCG.cjs');
|
|
15
|
+
require('../__chunks/BX2QEIBH.cjs');
|
|
16
|
+
require('../__chunks/MU7F4QWJ.cjs');
|
|
17
|
+
require('../__chunks/6IUEXB4L.cjs');
|
|
19
18
|
require('../__chunks/7YLCVXZ7.cjs');
|
|
20
19
|
require('../__chunks/CXZMA435.cjs');
|
|
21
20
|
require('../__chunks/7TN63K2T.cjs');
|
|
21
|
+
require('../__chunks/SL55T4ZB.cjs');
|
|
22
22
|
require('../__chunks/3ND7K6FF.cjs');
|
|
23
|
-
require('../__chunks/
|
|
23
|
+
require('../__chunks/DLIQLPX4.cjs');
|
|
24
24
|
require('../__chunks/AFPGTIIH.cjs');
|
|
25
25
|
require('../__chunks/J3OG6T3B.cjs');
|
|
26
|
+
require('../__chunks/2BIO7R5N.cjs');
|
|
26
27
|
require('../__chunks/PE3KUHN6.cjs');
|
|
27
28
|
require('../__chunks/AXNMZ6L6.cjs');
|
|
28
29
|
require('../__chunks/CVD2AZE2.cjs');
|
|
29
|
-
require('../__chunks/2BIO7R5N.cjs');
|
|
30
|
-
require('../__chunks/R6M66EKZ.cjs');
|
|
31
30
|
require('../__chunks/7CYY7U2A.cjs');
|
|
31
|
+
require('../__chunks/R6M66EKZ.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -95,7 +95,7 @@ var useTooltip = _NGD3IQDBcjs.createHook.call(void 0,
|
|
|
95
95
|
(state) => state.type === "description" ? "tooltip" : "none"
|
|
96
96
|
);
|
|
97
97
|
props = _AV6KTKLEcjs.__spreadValues.call(void 0, { role }, props);
|
|
98
|
-
props =
|
|
98
|
+
props = _GZ2NNSLVcjs.useHovercard.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
99
99
|
store,
|
|
100
100
|
portal,
|
|
101
101
|
gutter,
|
|
@@ -124,7 +124,7 @@ var useTooltip = _NGD3IQDBcjs.createHook.call(void 0,
|
|
|
124
124
|
return props;
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
|
-
var Tooltip =
|
|
127
|
+
var Tooltip = _QJDA4LG6cjs.createDialogComponent.call(void 0,
|
|
128
128
|
_NGD3IQDBcjs.forwardRef.call(void 0, function Tooltip2(props) {
|
|
129
129
|
const htmlProps = useTooltip(props);
|
|
130
130
|
return _NGD3IQDBcjs.createElement.call(void 0, TagName, htmlProps);
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./YMV43K4F.js";
|
|
7
7
|
import {
|
|
8
8
|
usePopover
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./6YVAEELE.js";
|
|
10
10
|
import {
|
|
11
11
|
createDialogComponent
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./FGHVVLPU.js";
|
|
13
13
|
import {
|
|
14
14
|
HovercardScopedContextProvider,
|
|
15
15
|
useHovercardProviderContext
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useTagContext
|
|
4
|
+
} from "./WYDDZRWN.js";
|
|
2
5
|
import {
|
|
3
6
|
useCompositeStoreProps
|
|
4
7
|
} from "./ZR5N62ZV.js";
|
|
@@ -9,21 +12,36 @@ import {
|
|
|
9
12
|
useStore,
|
|
10
13
|
useStoreProps
|
|
11
14
|
} from "./PWUXK5IM.js";
|
|
15
|
+
import {
|
|
16
|
+
useUpdateEffect
|
|
17
|
+
} from "./WOWUAP42.js";
|
|
18
|
+
import {
|
|
19
|
+
__spreadProps,
|
|
20
|
+
__spreadValues
|
|
21
|
+
} from "./4R3V3JGP.js";
|
|
12
22
|
|
|
13
23
|
// src/combobox/combobox-store.ts
|
|
14
24
|
import * as Core from "@ariakit/core/combobox/combobox-store";
|
|
15
25
|
function useComboboxStoreProps(store, update, props) {
|
|
26
|
+
useUpdateEffect(update, [props.tag]);
|
|
16
27
|
useStoreProps(store, props, "value", "setValue");
|
|
17
28
|
useStoreProps(store, props, "selectedValue", "setSelectedValue");
|
|
18
29
|
useStoreProps(store, props, "resetValueOnHide");
|
|
19
30
|
useStoreProps(store, props, "resetValueOnSelect");
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
return Object.assign(
|
|
32
|
+
useCompositeStoreProps(
|
|
33
|
+
usePopoverStoreProps(store, update, props),
|
|
34
|
+
update,
|
|
35
|
+
props
|
|
36
|
+
),
|
|
37
|
+
{ tag: props.tag }
|
|
24
38
|
);
|
|
25
39
|
}
|
|
26
40
|
function useComboboxStore(props = {}) {
|
|
41
|
+
const tag = useTagContext();
|
|
42
|
+
props = __spreadProps(__spreadValues({}, props), {
|
|
43
|
+
tag: props.tag !== void 0 ? props.tag : tag
|
|
44
|
+
});
|
|
27
45
|
const [store, update] = useStore(Core.createComboboxStore, props);
|
|
28
46
|
return useComboboxStoreProps(store, update, props);
|
|
29
47
|
}
|
|
@@ -44,7 +44,7 @@ var usePopoverDisclosureArrow = createHook(function usePopoverDisclosureArrow2(_
|
|
|
44
44
|
stroke: "currentColor",
|
|
45
45
|
strokeLinecap: "round",
|
|
46
46
|
strokeLinejoin: "round",
|
|
47
|
-
strokeWidth:
|
|
47
|
+
strokeWidth: 1.5,
|
|
48
48
|
viewBox: "0 0 16 16",
|
|
49
49
|
height: "1em",
|
|
50
50
|
width: "1em",
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
DialogBackdrop
|
|
4
|
-
} from "./
|
|
5
|
-
import {
|
|
6
|
-
prependHiddenDismiss
|
|
7
|
-
} from "./6GXEOXGT.js";
|
|
8
|
-
import {
|
|
9
|
-
disableTree,
|
|
10
|
-
disableTreeOutside
|
|
11
|
-
} from "./PTPUIM7N.js";
|
|
12
|
-
import {
|
|
13
|
-
usePreventBodyScroll
|
|
14
|
-
} from "./U2L67A6K.js";
|
|
4
|
+
} from "./CMFBAHKI.js";
|
|
15
5
|
import {
|
|
16
6
|
useNestedDialogs
|
|
17
7
|
} from "./HSFE2URL.js";
|
|
18
8
|
import {
|
|
19
9
|
useHideOnInteractOutside
|
|
20
10
|
} from "./H2NVVTJB.js";
|
|
11
|
+
import {
|
|
12
|
+
prependHiddenDismiss
|
|
13
|
+
} from "./6GXEOXGT.js";
|
|
21
14
|
import {
|
|
22
15
|
isElementMarked,
|
|
23
16
|
markTreeOutside
|
|
24
17
|
} from "./YNKDLCEK.js";
|
|
25
18
|
import {
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
disableTree,
|
|
20
|
+
disableTreeOutside
|
|
21
|
+
} from "./3TEK3C5Q.js";
|
|
28
22
|
import {
|
|
29
23
|
supportsInert
|
|
30
24
|
} from "./677M2CI3.js";
|
|
25
|
+
import {
|
|
26
|
+
createWalkTreeSnapshot
|
|
27
|
+
} from "./5QL6BP6J.js";
|
|
28
|
+
import {
|
|
29
|
+
usePreventBodyScroll
|
|
30
|
+
} from "./BC72XE6E.js";
|
|
31
31
|
import {
|
|
32
32
|
useFocusableContainer
|
|
33
33
|
} from "./UHSH3H5I.js";
|
|
@@ -136,7 +136,8 @@ var useDialog = createHook(function useDialog2(_a) {
|
|
|
136
136
|
autoFocusOnHide = true,
|
|
137
137
|
initialFocus,
|
|
138
138
|
finalFocus,
|
|
139
|
-
unmountOnHide
|
|
139
|
+
unmountOnHide,
|
|
140
|
+
unstable_treeSnapshotKey
|
|
140
141
|
} = _b, props = __objRest(_b, [
|
|
141
142
|
"store",
|
|
142
143
|
"open",
|
|
@@ -153,7 +154,8 @@ var useDialog = createHook(function useDialog2(_a) {
|
|
|
153
154
|
"autoFocusOnHide",
|
|
154
155
|
"initialFocus",
|
|
155
156
|
"finalFocus",
|
|
156
|
-
"unmountOnHide"
|
|
157
|
+
"unmountOnHide",
|
|
158
|
+
"unstable_treeSnapshotKey"
|
|
157
159
|
]);
|
|
158
160
|
const context = useDialogProviderContext();
|
|
159
161
|
const ref = useRef(null);
|
|
@@ -269,7 +271,7 @@ var useDialog = createHook(function useDialog2(_a) {
|
|
|
269
271
|
return;
|
|
270
272
|
const dialog = ref.current;
|
|
271
273
|
return createWalkTreeSnapshot(id, [dialog]);
|
|
272
|
-
}, [id, canTakeTreeSnapshot]);
|
|
274
|
+
}, [id, canTakeTreeSnapshot, unstable_treeSnapshotKey]);
|
|
273
275
|
const getPersistentElementsProp = useEvent(getPersistentElements);
|
|
274
276
|
useSafeLayoutEffect(() => {
|
|
275
277
|
if (!id)
|
|
@@ -297,7 +299,8 @@ var useDialog = createHook(function useDialog2(_a) {
|
|
|
297
299
|
canTakeTreeSnapshot,
|
|
298
300
|
getPersistentElementsProp,
|
|
299
301
|
nestedDialogs,
|
|
300
|
-
modal
|
|
302
|
+
modal,
|
|
303
|
+
unstable_treeSnapshotKey
|
|
301
304
|
]);
|
|
302
305
|
const mayAutoFocusOnShow = !!autoFocusOnShow;
|
|
303
306
|
const autoFocusOnShowProp = useBooleanEvent(autoFocusOnShow);
|
|
@@ -390,6 +393,7 @@ var useDialog = createHook(function useDialog2(_a) {
|
|
|
390
393
|
},
|
|
391
394
|
[store, finalFocus, autoFocusOnHideProp]
|
|
392
395
|
);
|
|
396
|
+
const focusedOnHideRef = useRef(false);
|
|
393
397
|
useSafeLayoutEffect(() => {
|
|
394
398
|
if (open)
|
|
395
399
|
return;
|
|
@@ -398,6 +402,7 @@ var useDialog = createHook(function useDialog2(_a) {
|
|
|
398
402
|
if (!mayAutoFocusOnHide)
|
|
399
403
|
return;
|
|
400
404
|
const dialog = ref.current;
|
|
405
|
+
focusedOnHideRef.current = true;
|
|
401
406
|
focusOnHide(dialog);
|
|
402
407
|
}, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]);
|
|
403
408
|
useEffect(() => {
|
|
@@ -406,7 +411,13 @@ var useDialog = createHook(function useDialog2(_a) {
|
|
|
406
411
|
if (!mayAutoFocusOnHide)
|
|
407
412
|
return;
|
|
408
413
|
const dialog = ref.current;
|
|
409
|
-
return () =>
|
|
414
|
+
return () => {
|
|
415
|
+
if (focusedOnHideRef.current) {
|
|
416
|
+
focusedOnHideRef.current = false;
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
focusOnHide(dialog);
|
|
420
|
+
};
|
|
410
421
|
}, [hasOpened, mayAutoFocusOnHide, focusOnHide]);
|
|
411
422
|
const hideOnEscapeProp = useBooleanEvent(hideOnEscape);
|
|
412
423
|
useEffect(() => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/tag/utils.ts
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { isTouchDevice } from "@ariakit/core/utils/platform";
|
|
6
|
+
function useTouchDevice() {
|
|
7
|
+
const [touchDevice, setTouchDevice] = useState(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setTouchDevice(isTouchDevice());
|
|
10
|
+
}, []);
|
|
11
|
+
return touchDevice;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
useTouchDevice
|
|
16
|
+
};
|