@yamada-ui/autocomplete 1.6.5-dev-20241119122307 → 1.6.5-dev-20241119150031

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/dist/autocomplete-context.d.mts +0 -1
  2. package/dist/autocomplete-context.d.ts +0 -1
  3. package/dist/autocomplete-context.js.map +1 -1
  4. package/dist/autocomplete-context.mjs +1 -1
  5. package/dist/autocomplete-create.js.map +1 -1
  6. package/dist/autocomplete-create.mjs +4 -4
  7. package/dist/autocomplete-empty.js.map +1 -1
  8. package/dist/autocomplete-empty.mjs +4 -4
  9. package/dist/autocomplete-icon.js.map +1 -1
  10. package/dist/autocomplete-icon.mjs +2 -2
  11. package/dist/autocomplete-list.js +22 -15
  12. package/dist/autocomplete-list.js.map +1 -1
  13. package/dist/autocomplete-list.mjs +3 -3
  14. package/dist/autocomplete-option-group.js.map +1 -1
  15. package/dist/autocomplete-option-group.mjs +3 -3
  16. package/dist/autocomplete-option.js.map +1 -1
  17. package/dist/autocomplete-option.mjs +4 -4
  18. package/dist/autocomplete.js +66 -76
  19. package/dist/autocomplete.js.map +1 -1
  20. package/dist/autocomplete.mjs +12 -12
  21. package/dist/{chunk-7YDPBPBY.mjs → chunk-2CVB4NO5.mjs} +7 -7
  22. package/dist/{chunk-LCC3VNZV.mjs → chunk-2LP57WVB.mjs} +2 -2
  23. package/dist/{chunk-PTPJFYGI.mjs → chunk-4GVV3HBE.mjs} +29 -13
  24. package/dist/chunk-4GVV3HBE.mjs.map +1 -0
  25. package/dist/{chunk-6OTUOEYS.mjs → chunk-7QCZ5NGS.mjs} +2 -2
  26. package/dist/{chunk-PU6HFINM.mjs → chunk-ABCTEZN5.mjs} +3 -3
  27. package/dist/{chunk-J3GHHVSC.mjs → chunk-IFH3PPSD.mjs} +7 -7
  28. package/dist/{chunk-REPBXBG3.mjs → chunk-LIBFONYN.mjs} +7 -10
  29. package/dist/chunk-LIBFONYN.mjs.map +1 -0
  30. package/dist/{chunk-7GVG5MVF.mjs → chunk-PWV7X7G6.mjs} +4 -4
  31. package/dist/{chunk-ZFWB5LCD.mjs → chunk-RK5E5J5E.mjs} +4 -4
  32. package/dist/{chunk-ZNO5RUVT.mjs → chunk-TP5VZFO3.mjs} +1 -1
  33. package/dist/chunk-TP5VZFO3.mjs.map +1 -0
  34. package/dist/{chunk-CMFJUJJW.mjs → chunk-UX5QECNB.mjs} +2 -2
  35. package/dist/{chunk-6QAH2ARG.mjs → chunk-YPKDYYEV.mjs} +4 -4
  36. package/dist/{chunk-YWUT56L3.mjs → chunk-ZR77IT3O.mjs} +49 -67
  37. package/dist/chunk-ZR77IT3O.mjs.map +1 -0
  38. package/dist/index.js +66 -76
  39. package/dist/index.js.map +1 -1
  40. package/dist/index.mjs +13 -13
  41. package/dist/multi-autocomplete.js +66 -76
  42. package/dist/multi-autocomplete.js.map +1 -1
  43. package/dist/multi-autocomplete.mjs +12 -12
  44. package/dist/use-autocomplete-list.d.mts +2 -1
  45. package/dist/use-autocomplete-list.d.ts +2 -1
  46. package/dist/use-autocomplete-list.js +19 -9
  47. package/dist/use-autocomplete-list.js.map +1 -1
  48. package/dist/use-autocomplete-list.mjs +2 -2
  49. package/dist/use-autocomplete-option-group.js.map +1 -1
  50. package/dist/use-autocomplete-option-group.mjs +2 -2
  51. package/dist/use-autocomplete-option.js.map +1 -1
  52. package/dist/use-autocomplete-option.mjs +2 -2
  53. package/dist/use-autocomplete.d.mts +0 -2
  54. package/dist/use-autocomplete.d.ts +0 -2
  55. package/dist/use-autocomplete.js +44 -61
  56. package/dist/use-autocomplete.js.map +1 -1
  57. package/dist/use-autocomplete.mjs +7 -7
  58. package/package.json +4 -4
  59. package/dist/chunk-PTPJFYGI.mjs.map +0 -1
  60. package/dist/chunk-REPBXBG3.mjs.map +0 -1
  61. package/dist/chunk-YWUT56L3.mjs.map +0 -1
  62. package/dist/chunk-ZNO5RUVT.mjs.map +0 -1
  63. /package/dist/{chunk-7YDPBPBY.mjs.map → chunk-2CVB4NO5.mjs.map} +0 -0
  64. /package/dist/{chunk-LCC3VNZV.mjs.map → chunk-2LP57WVB.mjs.map} +0 -0
  65. /package/dist/{chunk-6OTUOEYS.mjs.map → chunk-7QCZ5NGS.mjs.map} +0 -0
  66. /package/dist/{chunk-PU6HFINM.mjs.map → chunk-ABCTEZN5.mjs.map} +0 -0
  67. /package/dist/{chunk-J3GHHVSC.mjs.map → chunk-IFH3PPSD.mjs.map} +0 -0
  68. /package/dist/{chunk-7GVG5MVF.mjs.map → chunk-PWV7X7G6.mjs.map} +0 -0
  69. /package/dist/{chunk-ZFWB5LCD.mjs.map → chunk-RK5E5J5E.mjs.map} +0 -0
  70. /package/dist/{chunk-CMFJUJJW.mjs.map → chunk-UX5QECNB.mjs.map} +0 -0
  71. /package/dist/{chunk-6QAH2ARG.mjs.map → chunk-YPKDYYEV.mjs.map} +0 -0
@@ -2,15 +2,21 @@
2
2
  import {
3
3
  useAutocompleteContext,
4
4
  useAutocompleteDescendantsContext
5
- } from "./chunk-ZNO5RUVT.mjs";
5
+ } from "./chunk-TP5VZFO3.mjs";
6
6
 
7
7
  // src/use-autocomplete-list.ts
8
- import { ariaAttr, isArray, mergeRefs, useUpdateEffect } from "@yamada-ui/utils";
9
- import { useCallback, useEffect, useId, useRef } from "react";
8
+ import {
9
+ ariaAttr,
10
+ handlerAll,
11
+ isArray,
12
+ mergeRefs,
13
+ useUpdateEffect
14
+ } from "@yamada-ui/utils";
15
+ import { useCallback, useEffect, useRef } from "react";
10
16
  var useAutocompleteList = () => {
11
- const { focusedIndex, isOpen, listRef, rebirthOptions, value } = useAutocompleteContext();
17
+ const { focusedIndex, isOpen, rebirthOptions, value } = useAutocompleteContext();
12
18
  const descendants = useAutocompleteDescendantsContext();
13
- const uuid = useId();
19
+ const listRef = useRef(null);
14
20
  const beforeFocusedIndex = useRef(-1);
15
21
  const selectedValue = descendants.value(focusedIndex);
16
22
  const isMulti = isArray(value);
@@ -46,25 +52,35 @@ var useAutocompleteList = () => {
46
52
  useUpdateEffect(() => {
47
53
  if (!isOpen) beforeFocusedIndex.current = -1;
48
54
  }, [isOpen]);
55
+ const getContainerProps = useCallback(
56
+ (props = {}, ref = null) => ({
57
+ ref,
58
+ "aria-multiselectable": ariaAttr(isMulti),
59
+ role: "listbox",
60
+ ...props,
61
+ onAnimationComplete: handlerAll(
62
+ props.onAnimationComplete,
63
+ onAnimationComplete
64
+ )
65
+ }),
66
+ [isMulti, onAnimationComplete]
67
+ );
49
68
  const getListProps = useCallback(
50
- ({ id, ...props } = {}, ref = null) => ({
51
- id: id != null ? id : uuid,
69
+ (props = {}, ref = null) => ({
52
70
  ref: mergeRefs(listRef, ref),
53
- "aria-multiselectable": ariaAttr(isMulti),
54
71
  position: "relative",
55
- role: "listbox",
56
72
  tabIndex: -1,
57
73
  ...props
58
74
  }),
59
- [listRef, uuid, isMulti]
75
+ [listRef]
60
76
  );
61
77
  return {
62
- getListProps,
63
- onAnimationComplete
78
+ getContainerProps,
79
+ getListProps
64
80
  };
65
81
  };
66
82
 
67
83
  export {
68
84
  useAutocompleteList
69
85
  };
70
- //# sourceMappingURL=chunk-PTPJFYGI.mjs.map
86
+ //# sourceMappingURL=chunk-4GVV3HBE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-autocomplete-list.ts"],"sourcesContent":["import type { PropGetter } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport {\n ariaAttr,\n handlerAll,\n isArray,\n mergeRefs,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useRef } from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\n\nexport const useAutocompleteList = () => {\n const { focusedIndex, isOpen, rebirthOptions, value } =\n useAutocompleteContext()\n const descendants = useAutocompleteDescendantsContext()\n const listRef = useRef<HTMLDivElement>(null)\n const beforeFocusedIndex = useRef<number>(-1)\n const selectedValue = descendants.value(focusedIndex)\n const isMulti = isArray(value)\n\n const onAnimationComplete = useCallback(() => {\n if (!isOpen) rebirthOptions(false)\n }, [isOpen, rebirthOptions])\n\n useEffect(() => {\n if (!listRef.current || !selectedValue) return\n\n if (beforeFocusedIndex.current === selectedValue.index) return\n\n const parent = listRef.current\n const child = selectedValue.node\n\n const parentHeight = parent.clientHeight\n const viewTop = parent.scrollTop\n const viewBottom = viewTop + parentHeight\n\n const childHeight = child.clientHeight\n const childTop = child.offsetTop\n const childBottom = childTop + childHeight\n\n const isInView = viewTop <= childTop && childBottom <= viewBottom\n\n const isScrollBottom = beforeFocusedIndex.current < selectedValue.index\n\n if (!isInView) {\n if (childBottom <= parentHeight) {\n listRef.current.scrollTo({ top: 0 })\n } else {\n if (!isScrollBottom) {\n listRef.current.scrollTo({ top: childTop + 1 })\n } else {\n listRef.current.scrollTo({ top: childBottom - parentHeight })\n }\n }\n }\n\n beforeFocusedIndex.current = selectedValue.index\n }, [listRef, selectedValue])\n\n useUpdateEffect(() => {\n if (!isOpen) beforeFocusedIndex.current = -1\n }, [isOpen])\n\n const getContainerProps: PropGetter<MotionProps, MotionProps> = useCallback(\n (props = {}, ref = null) => ({\n ref,\n \"aria-multiselectable\": ariaAttr(isMulti),\n role: \"listbox\",\n ...props,\n onAnimationComplete: handlerAll(\n props.onAnimationComplete,\n onAnimationComplete,\n ),\n }),\n [isMulti, onAnimationComplete],\n )\n\n const getListProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ref: mergeRefs(listRef, ref),\n position: \"relative\",\n tabIndex: -1,\n ...props,\n }),\n [listRef],\n )\n\n return {\n getContainerProps,\n getListProps,\n }\n}\n"],"mappings":";;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,WAAW,cAAc;AAMxC,IAAM,sBAAsB,MAAM;AACvC,QAAM,EAAE,cAAc,QAAQ,gBAAgB,MAAM,IAClD,uBAAuB;AACzB,QAAM,cAAc,kCAAkC;AACtD,QAAM,UAAU,OA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N,GAAG;AAAA,MACH,qBAAqB;AAAA,QACnB,MAAM;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,SAAS,mBAAmB;AAAA,EAC/B;AAEA,QAAM,eAA2B;AAAA,IAC/B,CAAC,QAAQ,CAAC,GAAG,MAAM,UAAU;AAAA,MAC3B,KAAK,UAAU,SAAS,GAAG;AAAA,MAC3B,UAAU;AAAA,MACV,UAAU;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  useAutocompleteContext
4
- } from "./chunk-ZNO5RUVT.mjs";
4
+ } from "./chunk-TP5VZFO3.mjs";
5
5
 
6
6
  // src/autocomplete-icon.tsx
7
7
  import { forwardRef, ui } from "@yamada-ui/core";
@@ -105,4 +105,4 @@ export {
105
105
  AutocompleteClearIcon,
106
106
  AutocompleteItemIcon
107
107
  };
108
- //# sourceMappingURL=chunk-6OTUOEYS.mjs.map
108
+ //# sourceMappingURL=chunk-7QCZ5NGS.mjs.map
@@ -1,10 +1,10 @@
1
1
  "use client"
2
2
  import {
3
3
  useAutocompleteOptionGroup
4
- } from "./chunk-CMFJUJJW.mjs";
4
+ } from "./chunk-UX5QECNB.mjs";
5
5
  import {
6
6
  useAutocompleteContext
7
- } from "./chunk-ZNO5RUVT.mjs";
7
+ } from "./chunk-TP5VZFO3.mjs";
8
8
 
9
9
  // src/autocomplete-option-group.tsx
10
10
  import { forwardRef, ui } from "@yamada-ui/core";
@@ -67,4 +67,4 @@ AutocompleteOptionGroup.__ui__ = "AutocompleteOptionGroup";
67
67
  export {
68
68
  AutocompleteOptionGroup
69
69
  };
70
- //# sourceMappingURL=chunk-PU6HFINM.mjs.map
70
+ //# sourceMappingURL=chunk-ABCTEZN5.mjs.map
@@ -2,25 +2,25 @@
2
2
  import {
3
3
  useAutocomplete,
4
4
  useAutocompleteInput
5
- } from "./chunk-YWUT56L3.mjs";
5
+ } from "./chunk-ZR77IT3O.mjs";
6
6
  import {
7
7
  AutocompleteCreate
8
- } from "./chunk-ZFWB5LCD.mjs";
8
+ } from "./chunk-RK5E5J5E.mjs";
9
9
  import {
10
10
  AutocompleteEmpty
11
- } from "./chunk-6QAH2ARG.mjs";
11
+ } from "./chunk-YPKDYYEV.mjs";
12
12
  import {
13
13
  AutocompleteList
14
- } from "./chunk-REPBXBG3.mjs";
14
+ } from "./chunk-LIBFONYN.mjs";
15
15
  import {
16
16
  AutocompleteClearIcon,
17
17
  AutocompleteIcon
18
- } from "./chunk-6OTUOEYS.mjs";
18
+ } from "./chunk-7QCZ5NGS.mjs";
19
19
  import {
20
20
  AutocompleteDescendantsContextProvider,
21
21
  AutocompleteProvider,
22
22
  useAutocompleteContext
23
- } from "./chunk-ZNO5RUVT.mjs";
23
+ } from "./chunk-TP5VZFO3.mjs";
24
24
 
25
25
  // src/multi-autocomplete.tsx
26
26
  import {
@@ -259,4 +259,4 @@ MultiAutocompleteField.__ui__ = "MultiAutocompleteField";
259
259
  export {
260
260
  MultiAutocomplete
261
261
  };
262
- //# sourceMappingURL=chunk-J3GHHVSC.mjs.map
262
+ //# sourceMappingURL=chunk-IFH3PPSD.mjs.map
@@ -1,15 +1,15 @@
1
1
  "use client"
2
2
  import {
3
3
  useAutocompleteList
4
- } from "./chunk-PTPJFYGI.mjs";
4
+ } from "./chunk-4GVV3HBE.mjs";
5
5
  import {
6
6
  useAutocompleteContext
7
- } from "./chunk-ZNO5RUVT.mjs";
7
+ } from "./chunk-TP5VZFO3.mjs";
8
8
 
9
9
  // src/autocomplete-list.tsx
10
10
  import { forwardRef, ui } from "@yamada-ui/core";
11
11
  import { PopoverContent } from "@yamada-ui/popover";
12
- import { cx, handlerAll } from "@yamada-ui/utils";
12
+ import { cx } from "@yamada-ui/utils";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
14
  var AutocompleteList = forwardRef(
15
15
  ({
@@ -28,7 +28,7 @@ var AutocompleteList = forwardRef(
28
28
  }, ref) => {
29
29
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
30
30
  const { styles } = useAutocompleteContext();
31
- const { getListProps, onAnimationComplete } = useAutocompleteList();
31
+ const { getContainerProps, getListProps } = useAutocompleteList();
32
32
  width != null ? width : width = w;
33
33
  width != null ? width : width = (_c = (_a = styles.list) == null ? void 0 : _a.width) != null ? _c : (_b = styles.list) == null ? void 0 : _b.w;
34
34
  minWidth != null ? minWidth : minWidth = minW;
@@ -38,16 +38,13 @@ var AutocompleteList = forwardRef(
38
38
  return /* @__PURE__ */ jsxs(
39
39
  PopoverContent,
40
40
  {
41
+ as: "div",
41
42
  className: "ui-autocomplete__popover",
42
43
  maxWidth,
43
44
  minWidth,
44
45
  width,
45
46
  __css: { ...styles.content, maxWidth, minWidth, width },
46
- ...contentProps,
47
- onAnimationComplete: handlerAll(
48
- contentProps == null ? void 0 : contentProps.onAnimationComplete,
49
- onAnimationComplete
50
- ),
47
+ ...getContainerProps(contentProps),
51
48
  children: [
52
49
  header ? /* @__PURE__ */ jsx(
53
50
  ui.header,
@@ -85,4 +82,4 @@ AutocompleteList.__ui__ = "AutocompleteList";
85
82
  export {
86
83
  AutocompleteList
87
84
  };
88
- //# sourceMappingURL=chunk-REPBXBG3.mjs.map
85
+ //# sourceMappingURL=chunk-LIBFONYN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/autocomplete-list.tsx"],"sourcesContent":["import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { MotionPropsWithoutChildren } from \"@yamada-ui/motion\"\nimport type { ReactNode } from \"react\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { PopoverContent } from \"@yamada-ui/popover\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { useAutocompleteList } from \"./use-autocomplete-list\"\n\nexport interface AutocompleteListProps extends HTMLUIProps {\n footer?: ReactNode\n header?: ReactNode\n contentProps?: MotionPropsWithoutChildren\n}\n\nexport const AutocompleteList = forwardRef<AutocompleteListProps, \"div\">(\n (\n {\n className,\n children,\n footer,\n header,\n maxW,\n maxWidth,\n minW,\n minWidth,\n w,\n width,\n contentProps,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useAutocompleteContext()\n const { getContainerProps, getListProps } = useAutocompleteList()\n\n width ??= w\n width ??= (styles.list?.width ?? styles.list?.w) as CSSUIProps[\"width\"]\n minWidth ??= minW\n minWidth ??= (styles.list?.minWidth ??\n styles.list?.minW) as CSSUIProps[\"minWidth\"]\n maxWidth ??= maxW\n maxWidth ??= (styles.list?.maxWidth ??\n styles.list?.maxW) as CSSUIProps[\"maxWidth\"]\n\n return (\n <PopoverContent\n as=\"div\"\n className=\"ui-autocomplete__popover\"\n maxWidth={maxWidth}\n minWidth={minWidth}\n width={width}\n __css={{ ...styles.content, maxWidth, minWidth, width }}\n {...getContainerProps(contentProps)}\n >\n {header ? (\n <ui.header\n className=\"ui-autocomplete__header\"\n __css={{ ...styles.header }}\n >\n {header}\n </ui.header>\n ) : null}\n\n <ui.div\n className={cx(\"ui-autocomplete__list\", className)}\n __css={{ ...styles.list }}\n {...getListProps(rest, ref)}\n >\n {children}\n </ui.div>\n\n {footer ? (\n <ui.footer\n className=\"ui-autocomplete__footer\"\n __css={{ ...styles.footer }}\n >\n {footer}\n </ui.footer>\n ) : null}\n </PopoverContent>\n )\n },\n)\n\nAutocompleteList.displayName = \"AutocompleteList\"\nAutocompleteList.__ui__ = \"AutocompleteList\"\n"],"mappings":";;;;;;;;;AAGA,SAAS,YAAY,UAAU;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,UAAU;AAyCb,SAUI,KAVJ;AA/BC,IAAM,mBAAmB;AAAA,EAC9B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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mjs";
4
+ } from "./chunk-2LP57WVB.mjs";
5
5
  import {
6
6
  AutocompleteItemIcon
7
- } from "./chunk-6OTUOEYS.mjs";
7
+ } from "./chunk-7QCZ5NGS.mjs";
8
8
  import {
9
9
  useAutocompleteContext
10
- } from "./chunk-ZNO5RUVT.mjs";
10
+ } from "./chunk-TP5VZFO3.mjs";
11
11
 
12
12
  // src/autocomplete-option.tsx
13
13
  import { forwardRef, ui } from "@yamada-ui/core";
@@ -60,4 +60,4 @@ AutocompleteCheckIcon.__ui__ = "AutocompleteCheckIcon";
60
60
  export {
61
61
  AutocompleteOption
62
62
  };
63
- //# sourceMappingURL=chunk-7GVG5MVF.mjs.map
63
+ //# sourceMappingURL=chunk-PWV7X7G6.mjs.map
@@ -1,13 +1,13 @@
1
1
  "use client"
2
2
  import {
3
3
  useAutocompleteCreate
4
- } from "./chunk-LCC3VNZV.mjs";
4
+ } from "./chunk-2LP57WVB.mjs";
5
5
  import {
6
6
  AutocompleteItemIcon
7
- } from "./chunk-6OTUOEYS.mjs";
7
+ } from "./chunk-7QCZ5NGS.mjs";
8
8
  import {
9
9
  useAutocompleteContext
10
- } from "./chunk-ZNO5RUVT.mjs";
10
+ } from "./chunk-TP5VZFO3.mjs";
11
11
 
12
12
  // src/autocomplete-create.tsx
13
13
  import { forwardRef, ui } from "@yamada-ui/core";
@@ -60,4 +60,4 @@ AutocompletePlusIcon.__ui__ = "AutocompletePlusIcon";
60
60
  export {
61
61
  AutocompleteCreate
62
62
  };
63
- //# sourceMappingURL=chunk-ZFWB5LCD.mjs.map
63
+ //# sourceMappingURL=chunk-RK5E5J5E.mjs.map
@@ -22,4 +22,4 @@ export {
22
22
  AutocompleteProvider,
23
23
  useAutocompleteContext
24
24
  };
25
- //# sourceMappingURL=chunk-ZNO5RUVT.mjs.map
25
+ //# sourceMappingURL=chunk-TP5VZFO3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/autocomplete-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dispatch, DOMAttributes, RefObject, SetStateAction } from \"react\"\nimport type { UseAutocompleteProps } from \"./use-autocomplete\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { createContext } from \"@yamada-ui/utils\"\n\nexport const {\n DescendantsContextProvider: AutocompleteDescendantsContextProvider,\n useDescendant: useAutocompleteDescendant,\n useDescendants: useAutocompleteDescendants,\n useDescendantsContext: useAutocompleteDescendantsContext,\n} = createDescendant()\n\ninterface AutocompleteContext\n extends Omit<\n UseAutocompleteProps,\n \"defaultValue\" | \"onChange\" | \"onCreate\" | \"value\"\n > {\n focusedIndex: number\n inputRef: RefObject<HTMLInputElement>\n inputValue: string\n isAllSelected: boolean\n isEmpty: boolean\n isHit: boolean\n isOpen: boolean\n label: string | string[] | undefined\n pickOptions: (value: string) => void\n rebirthOptions: (runFocus?: boolean) => void\n setFocusedIndex: Dispatch<SetStateAction<number>>\n styles: { [key: string]: CSSUIObject | undefined }\n value: string | string[]\n formControlProps: { [key: string]: any }\n inputProps: DOMAttributes<HTMLInputElement>\n onChange: (newValue: string, runRebirth?: boolean) => void\n onClose: () => void\n onCreate: () => void\n onFocusFirst: () => void\n onFocusLast: () => void\n onFocusNext: (index?: number) => void\n onFocusPrev: (index?: number) => void\n onOpen: () => void\n}\n\nexport const [AutocompleteProvider, useAutocompleteContext] =\n createContext<AutocompleteContext>({\n name: \"AutocompleteContext\",\n errorMessage: `useAutocompleteContext returned is 'undefined'. Seems you forgot to wrap the components in \"<Autocomplete />\" or \"<MultiAutocomplete />\"`,\n })\n"],"mappings":";;;AAGA,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAEvB,IAAM;AAAA,EACX,4BAA4B;AAAA,EAC5B,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,uBAAuB;AACzB,IAAI,iBAAiB;AAgCd,IAAM,CAAC,sBAAsB,sBAAsB,IACxD,cAAmC;AAAA,EACjC,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  useAutocompleteContext,
4
4
  useAutocompleteDescendantsContext
5
- } from "./chunk-ZNO5RUVT.mjs";
5
+ } from "./chunk-TP5VZFO3.mjs";
6
6
 
7
7
  // src/use-autocomplete-option-group.ts
8
8
  import { layoutStyleProperties } from "@yamada-ui/core";
@@ -89,4 +89,4 @@ var useAutocompleteOptionGroup = ({
89
89
  export {
90
90
  useAutocompleteOptionGroup
91
91
  };
92
- //# sourceMappingURL=chunk-CMFJUJJW.mjs.map
92
+ //# sourceMappingURL=chunk-UX5QECNB.mjs.map
@@ -1,13 +1,13 @@
1
1
  "use client"
2
2
  import {
3
3
  useAutocompleteEmpty
4
- } from "./chunk-LCC3VNZV.mjs";
4
+ } from "./chunk-2LP57WVB.mjs";
5
5
  import {
6
6
  AutocompleteItemIcon
7
- } from "./chunk-6OTUOEYS.mjs";
7
+ } from "./chunk-7QCZ5NGS.mjs";
8
8
  import {
9
9
  useAutocompleteContext
10
- } from "./chunk-ZNO5RUVT.mjs";
10
+ } from "./chunk-TP5VZFO3.mjs";
11
11
 
12
12
  // src/autocomplete-empty.tsx
13
13
  import { forwardRef, ui } from "@yamada-ui/core";
@@ -61,4 +61,4 @@ AutocompleteMinusIcon.__ui__ = "AutocompleteMinusIcon";
61
61
  export {
62
62
  AutocompleteEmpty
63
63
  };
64
- //# sourceMappingURL=chunk-6QAH2ARG.mjs.map
64
+ //# sourceMappingURL=chunk-YPKDYYEV.mjs.map