@yamada-ui/react 2.2.6-dev-20260729002855 → 2.2.6-dev-20260729093730

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.
@@ -69,12 +69,14 @@ const useOutsideClick = ({ ref, enabled = true, handler }) => {
69
69
  };
70
70
  const isValidEvent = (ev, ref) => {
71
71
  const target = ev.target;
72
+ const path = ev.composedPath();
72
73
  if ("button" in ev && ev.button > 0) return false;
73
74
  if (target) {
74
75
  if (!(0, require_utils_index.utils_exports.getDocument)(target).contains(target)) return false;
75
76
  }
76
- if ((0, require_utils_index.utils_exports.isArray)(ref)) return !ref.some((ref) => ref.current?.contains(target));
77
- else return !ref.current?.contains(target);
77
+ const contains = (el) => !!el && (path.includes(el) || el.contains(target));
78
+ if ((0, require_utils_index.utils_exports.isArray)(ref)) return !ref.some(({ current }) => contains(current));
79
+ else return !contains(ref.current);
78
80
  };
79
81
  //#endregion
80
82
  exports.useOutsideClick = useOutsideClick;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useCallbackRef"],"sources":["../../../../src/hooks/use-outside-click/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport { useCallback, useEffect, useRef } from \"react\"\nimport { getDocument, isArray, useCallbackRef } from \"../../utils\"\n\nexport interface UseOutsideClickProps {\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[]\n enabled?: boolean\n handler?: (ev: Event) => void\n}\n\n/**\n * `useOutsideClick` is a custom hook that detects click events outside of an element.\n *\n * @see https://yamada-ui.com/docs/hooks/use-outside-click\n */\nexport const useOutsideClick = ({\n ref,\n enabled = true,\n handler,\n}: UseOutsideClickProps) => {\n const handlerRef = useCallbackRef(handler)\n\n const state = useRef({\n ignoreEmulatedMouseEvents: false,\n isPointerDown: false,\n })\n\n const onPointerDown = useCallback(\n (ev: MouseEvent | TouchEvent) => {\n if (isValidEvent(ev, ref)) state.current.isPointerDown = true\n },\n [ref],\n )\n\n const onMouseUp = useCallback(\n (ev: MouseEvent) => {\n if (state.current.ignoreEmulatedMouseEvents) {\n state.current.ignoreEmulatedMouseEvents = false\n\n return\n }\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n const onTouchEnd = useCallback(\n (ev: TouchEvent) => {\n state.current.ignoreEmulatedMouseEvents = true\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n useEffect(() => {\n if (!enabled) return\n\n const doc = getDocument(isArray(ref) ? ref[0]?.current : ref.current)\n\n doc.addEventListener(\"mousedown\", onPointerDown, true)\n doc.addEventListener(\"mouseup\", onMouseUp, true)\n doc.addEventListener(\"touchstart\", onPointerDown, true)\n doc.addEventListener(\"touchend\", onTouchEnd, true)\n\n return () => {\n doc.removeEventListener(\"mousedown\", onPointerDown, true)\n doc.removeEventListener(\"mouseup\", onMouseUp, true)\n doc.removeEventListener(\"touchstart\", onPointerDown, true)\n doc.removeEventListener(\"touchend\", onTouchEnd, true)\n }\n }, [\n handler,\n ref,\n handlerRef,\n state,\n enabled,\n onPointerDown,\n onMouseUp,\n onTouchEnd,\n ])\n}\n\nconst isValidEvent = (\n ev: MouseEvent | TouchEvent,\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n) => {\n const target = ev.target as HTMLElement | null\n\n if (\"button\" in ev && ev.button > 0) return false\n\n if (target) if (!getDocument(target).contains(target)) return false\n\n if (isArray(ref)) return !ref.some((ref) => ref.current?.contains(target))\n else return !ref.current?.contains(target)\n}\n"],"mappings":";;;;;;;;;;;AAiBA,MAAa,mBAAmB,EAC9B,KACA,UAAU,MACV,cAC0B;CAC1B,MAAM,aAAaA,YAAAA,eAAe,OAAO;CAEzC,MAAM,SAAA,GAAA,MAAA,OAAA,CAAe;EACnB,2BAA2B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;EACA;EACA;CACF,CAAC;AACH;AAEA,MAAM,gBACJ,IACA,QACG;CACH,MAAM,SAAS,GAAG;CAElB,IAAI,YAAY,MAAM,GAAG,SAAS,GAAG,OAAO;CAE5C,IAAI,QAAY;MAAA,EAAA,GAAA,oBAAA,cAAA,YAAA,CAAa,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,OAAO;CAAA;CAE9D,KAAA,GAAA,oBAAA,cAAA,QAAA,CAAY,GAAG,GAAG,OAAO,CAAC,IAAI,MAAM,QAAQ,IAAI,SAAS,SAAS,MAAM,CAAC;MACpE,OAAO,CAAC,IAAI,SAAS,SAAS,MAAM;AAC3C"}
1
+ {"version":3,"file":"index.cjs","names":["useCallbackRef"],"sources":["../../../../src/hooks/use-outside-click/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport { useCallback, useEffect, useRef } from \"react\"\nimport { getDocument, isArray, useCallbackRef } from \"../../utils\"\n\nexport interface UseOutsideClickProps {\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[]\n enabled?: boolean\n handler?: (ev: Event) => void\n}\n\n/**\n * `useOutsideClick` is a custom hook that detects click events outside of an element.\n *\n * @see https://yamada-ui.com/docs/hooks/use-outside-click\n */\nexport const useOutsideClick = ({\n ref,\n enabled = true,\n handler,\n}: UseOutsideClickProps) => {\n const handlerRef = useCallbackRef(handler)\n\n const state = useRef({\n ignoreEmulatedMouseEvents: false,\n isPointerDown: false,\n })\n\n const onPointerDown = useCallback(\n (ev: MouseEvent | TouchEvent) => {\n if (isValidEvent(ev, ref)) state.current.isPointerDown = true\n },\n [ref],\n )\n\n const onMouseUp = useCallback(\n (ev: MouseEvent) => {\n if (state.current.ignoreEmulatedMouseEvents) {\n state.current.ignoreEmulatedMouseEvents = false\n\n return\n }\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n const onTouchEnd = useCallback(\n (ev: TouchEvent) => {\n state.current.ignoreEmulatedMouseEvents = true\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n useEffect(() => {\n if (!enabled) return\n\n const doc = getDocument(isArray(ref) ? ref[0]?.current : ref.current)\n\n doc.addEventListener(\"mousedown\", onPointerDown, true)\n doc.addEventListener(\"mouseup\", onMouseUp, true)\n doc.addEventListener(\"touchstart\", onPointerDown, true)\n doc.addEventListener(\"touchend\", onTouchEnd, true)\n\n return () => {\n doc.removeEventListener(\"mousedown\", onPointerDown, true)\n doc.removeEventListener(\"mouseup\", onMouseUp, true)\n doc.removeEventListener(\"touchstart\", onPointerDown, true)\n doc.removeEventListener(\"touchend\", onTouchEnd, true)\n }\n }, [\n handler,\n ref,\n handlerRef,\n state,\n enabled,\n onPointerDown,\n onMouseUp,\n onTouchEnd,\n ])\n}\n\nconst isValidEvent = (\n ev: MouseEvent | TouchEvent,\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n) => {\n const target = ev.target as HTMLElement | null\n const path = ev.composedPath()\n\n if (\"button\" in ev && ev.button > 0) return false\n\n if (target) if (!getDocument(target).contains(target)) return false\n\n const contains = (el: HTMLElement | null) =>\n !!el && (path.includes(el) || el.contains(target))\n\n if (isArray(ref)) return !ref.some(({ current }) => contains(current))\n else return !contains(ref.current)\n}\n"],"mappings":";;;;;;;;;;;AAiBA,MAAa,mBAAmB,EAC9B,KACA,UAAU,MACV,cAC0B;CAC1B,MAAM,aAAaA,YAAAA,eAAe,OAAO;CAEzC,MAAM,SAAA,GAAA,MAAA,OAAA,CAAe;EACnB,2BAA2B;EAC3B,eAAe;CACjB,CAAC;CAED,MAAM,iBAAA,GAAA,MAAA,YAAA,EACH,OAAgC;EAC/B,IAAI,aAAa,IAAI,GAAG,GAAG,MAAM,QAAQ,gBAAgB;CAC3D,GACA,CAAC,GAAG,CACN;CA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IAAI,QAAY;MAAA,EAAA,GAAA,oBAAA,cAAA,YAAA,CAAa,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,OAAO;CAAA;CAE9D,MAAM,YAAY,OAChB,CAAC,CAAC,OAAO,KAAK,SAAS,EAAE,KAAK,GAAG,SAAS,MAAM;CAElD,KAAA,GAAA,oBAAA,cAAA,QAAA,CAAY,GAAG,GAAG,OAAO,CAAC,IAAI,MAAM,EAAE,cAAc,SAAS,OAAO,CAAC;MAChE,OAAO,CAAC,SAAS,IAAI,OAAO;AACnC"}
@@ -68,12 +68,14 @@ const useOutsideClick = ({ ref, enabled = true, handler }) => {
68
68
  };
69
69
  const isValidEvent = (ev, ref) => {
70
70
  const target = ev.target;
71
+ const path = ev.composedPath();
71
72
  if ("button" in ev && ev.button > 0) return false;
72
73
  if (target) {
73
74
  if (!(0, utils_exports.getDocument)(target).contains(target)) return false;
74
75
  }
75
- if ((0, utils_exports.isArray)(ref)) return !ref.some((ref) => ref.current?.contains(target));
76
- else return !ref.current?.contains(target);
76
+ const contains = (el) => !!el && (path.includes(el) || el.contains(target));
77
+ if ((0, utils_exports.isArray)(ref)) return !ref.some(({ current }) => contains(current));
78
+ else return !contains(ref.current);
77
79
  };
78
80
  //#endregion
79
81
  export { useOutsideClick };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/hooks/use-outside-click/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport { useCallback, useEffect, useRef } from \"react\"\nimport { getDocument, isArray, useCallbackRef } from \"../../utils\"\n\nexport interface UseOutsideClickProps {\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[]\n enabled?: boolean\n handler?: (ev: Event) => void\n}\n\n/**\n * `useOutsideClick` is a custom hook that detects click events outside of an element.\n *\n * @see https://yamada-ui.com/docs/hooks/use-outside-click\n */\nexport const useOutsideClick = ({\n ref,\n enabled = true,\n handler,\n}: UseOutsideClickProps) => {\n const handlerRef = useCallbackRef(handler)\n\n const state = useRef({\n ignoreEmulatedMouseEvents: false,\n isPointerDown: false,\n })\n\n const onPointerDown = useCallback(\n (ev: MouseEvent | TouchEvent) => {\n if (isValidEvent(ev, ref)) state.current.isPointerDown = true\n },\n [ref],\n )\n\n const onMouseUp = useCallback(\n (ev: MouseEvent) => {\n if (state.current.ignoreEmulatedMouseEvents) {\n state.current.ignoreEmulatedMouseEvents = false\n\n return\n }\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n const onTouchEnd = useCallback(\n (ev: TouchEvent) => {\n state.current.ignoreEmulatedMouseEvents = true\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n useEffect(() => {\n if (!enabled) return\n\n const doc = getDocument(isArray(ref) ? ref[0]?.current : ref.current)\n\n doc.addEventListener(\"mousedown\", onPointerDown, true)\n doc.addEventListener(\"mouseup\", onMouseUp, true)\n doc.addEventListener(\"touchstart\", onPointerDown, true)\n doc.addEventListener(\"touchend\", onTouchEnd, true)\n\n return () => {\n doc.removeEventListener(\"mousedown\", onPointerDown, true)\n doc.removeEventListener(\"mouseup\", onMouseUp, true)\n doc.removeEventListener(\"touchstart\", onPointerDown, true)\n doc.removeEventListener(\"touchend\", onTouchEnd, true)\n }\n }, [\n handler,\n ref,\n handlerRef,\n state,\n enabled,\n onPointerDown,\n onMouseUp,\n onTouchEnd,\n ])\n}\n\nconst isValidEvent = (\n ev: MouseEvent | TouchEvent,\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n) => {\n const target = ev.target as HTMLElement | null\n\n if (\"button\" in ev && ev.button > 0) return false\n\n if (target) if (!getDocument(target).contains(target)) return false\n\n if (isArray(ref)) return !ref.some((ref) => ref.current?.contains(target))\n else return !ref.current?.contains(target)\n}\n"],"mappings":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I;EACtD;CACF,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,MAAM,gBACJ,IACA,QACG;CACH,MAAM,SAAS,GAAG;CAElB,IAAI,YAAY,MAAM,GAAG,SAAS,GAAG,OAAO;CAE5C,IAAI,QAAY;MAAA,EAAA,GAAA,cAAA,YAAA,CAAa,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,OAAO;CAAA;CAE9D,KAAA,GAAA,cAAA,QAAA,CAAY,GAAG,GAAG,OAAO,CAAC,IAAI,MAAM,QAAQ,IAAI,SAAS,SAAS,MAAM,CAAC;MACpE,OAAO,CAAC,IAAI,SAAS,SAAS,MAAM;AAC3C"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/hooks/use-outside-click/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport { useCallback, useEffect, useRef } from \"react\"\nimport { getDocument, isArray, useCallbackRef } from \"../../utils\"\n\nexport interface UseOutsideClickProps {\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[]\n enabled?: boolean\n handler?: (ev: Event) => void\n}\n\n/**\n * `useOutsideClick` is a custom hook that detects click events outside of an element.\n *\n * @see https://yamada-ui.com/docs/hooks/use-outside-click\n */\nexport const useOutsideClick = ({\n ref,\n enabled = true,\n handler,\n}: UseOutsideClickProps) => {\n const handlerRef = useCallbackRef(handler)\n\n const state = useRef({\n ignoreEmulatedMouseEvents: false,\n isPointerDown: false,\n })\n\n const onPointerDown = useCallback(\n (ev: MouseEvent | TouchEvent) => {\n if (isValidEvent(ev, ref)) state.current.isPointerDown = true\n },\n [ref],\n )\n\n const onMouseUp = useCallback(\n (ev: MouseEvent) => {\n if (state.current.ignoreEmulatedMouseEvents) {\n state.current.ignoreEmulatedMouseEvents = false\n\n return\n }\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n const onTouchEnd = useCallback(\n (ev: TouchEvent) => {\n state.current.ignoreEmulatedMouseEvents = true\n\n if (state.current.isPointerDown && handler && isValidEvent(ev, ref)) {\n state.current.isPointerDown = false\n\n handlerRef(ev)\n }\n },\n [handler, handlerRef, ref],\n )\n\n useEffect(() => {\n if (!enabled) return\n\n const doc = getDocument(isArray(ref) ? ref[0]?.current : ref.current)\n\n doc.addEventListener(\"mousedown\", onPointerDown, true)\n doc.addEventListener(\"mouseup\", onMouseUp, true)\n doc.addEventListener(\"touchstart\", onPointerDown, true)\n doc.addEventListener(\"touchend\", onTouchEnd, true)\n\n return () => {\n doc.removeEventListener(\"mousedown\", onPointerDown, true)\n doc.removeEventListener(\"mouseup\", onMouseUp, true)\n doc.removeEventListener(\"touchstart\", onPointerDown, true)\n doc.removeEventListener(\"touchend\", onTouchEnd, true)\n }\n }, [\n handler,\n ref,\n handlerRef,\n state,\n enabled,\n onPointerDown,\n onMouseUp,\n onTouchEnd,\n ])\n}\n\nconst isValidEvent = (\n ev: MouseEvent | TouchEvent,\n ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n) => {\n const target = ev.target as HTMLElement | null\n const path = ev.composedPath()\n\n if (\"button\" in ev && ev.button > 0) return false\n\n if (target) if (!getDocument(target).contains(target)) return false\n\n const contains = (el: HTMLElement | null) =>\n !!el && (path.includes(el) || el.contains(target))\n\n if (isArray(ref)) return !ref.some(({ current }) => contains(current))\n else return !contains(ref.current)\n}\n"],"mappings":";;;;;;;;;;AAiBA,MAAa,mBAAmB,EAC9B,KACA,UAAU,MACV,cAC0B;CAC1B,MAAM,aAAa,eAAe,OAAO;CAEzC,MAAM,QAAQ,OAAO;EACnB,2BAA2B;EAC3B,eAAe;CACjB,CAAC;CAED,MAAM,gBAAgB,aACnB,OAAgC;EAC/B,IAAI,aAAa,IAAI,GAAG,GAAG,MAAM,QAAQ,gBAAgB;CAC3D,GACA,CAAC,GAAG,CACN;CAEA,MAAM,YAAY,aACf,O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A;CAE9D,MAAM,YAAY,OAChB,CAAC,CAAC,OAAO,KAAK,SAAS,EAAE,KAAK,GAAG,SAAS,MAAM;CAElD,KAAA,GAAA,cAAA,QAAA,CAAY,GAAG,GAAG,OAAO,CAAC,IAAI,MAAM,EAAE,cAAc,SAAS,OAAO,CAAC;MAChE,OAAO,CAAC,SAAS,IAAI,OAAO;AACnC"}
@@ -2,7 +2,7 @@ import { ComponentSlotStyle } from "../../core/system/index.types.js";
2
2
  import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
3
3
  import "../../index.js";
4
4
  //#region src/components/color-picker/color-picker.style.d.ts
5
- declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "colorSwatch" | "root" | "field" | "eyeDropper", CSSPropObject<CSSSlotObject<"input" | "content" | "icon" | "colorSwatch" | "root" | "field" | "eyeDropper">>, {
5
+ declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "root" | "colorSwatch" | "field" | "eyeDropper", CSSPropObject<CSSSlotObject<"input" | "content" | "icon" | "root" | "colorSwatch" | "field" | "eyeDropper">>, {
6
6
  xs: {
7
7
  field: {
8
8
  fontSize: "1em";
@@ -2,7 +2,7 @@ import { ComponentSlotStyle } from "../../core/system/index.types.js";
2
2
  import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
3
3
  import "../../index.js";
4
4
  //#region src/components/color-selector/color-selector.style.d.ts
5
- declare const colorSelectorStyle: ComponentSlotStyle<"hueSlider" | "saturationSlider" | "root" | "eyeDropper" | "colorSwatchGroupLabel" | "alphaSlider" | "colorSwatchGroup" | "colorSwatchItem", {
5
+ declare const colorSelectorStyle: ComponentSlotStyle<"root" | "hueSlider" | "saturationSlider" | "eyeDropper" | "colorSwatchGroupLabel" | "alphaSlider" | "colorSwatchGroup" | "colorSwatchItem", {
6
6
  /**
7
7
  * The shape of the thumb and color swatch.
8
8
  *
@@ -23,7 +23,7 @@ declare const colorSelectorStyle: ComponentSlotStyle<"hueSlider" | "saturationSl
23
23
  md: {};
24
24
  lg: {};
25
25
  xl: {};
26
- }, CSSModifierObject<CSSSlotObject<"hueSlider" | "saturationSlider" | "root" | "eyeDropper" | "colorSwatchGroupLabel" | "alphaSlider" | "colorSwatchGroup" | "colorSwatchItem">>>;
26
+ }, CSSModifierObject<CSSSlotObject<"root" | "hueSlider" | "saturationSlider" | "eyeDropper" | "colorSwatchGroupLabel" | "alphaSlider" | "colorSwatchGroup" | "colorSwatchItem">>>;
27
27
  type ColorSelectorStyle = typeof colorSelectorStyle;
28
28
  //#endregion
29
29
  export { ColorSelectorStyle, colorSelectorStyle };
@@ -2,7 +2,7 @@ import { ComponentSlotStyle } from "../../core/system/index.types.js";
2
2
  import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
3
3
  import "../../index.js";
4
4
  //#region src/components/drawer/drawer.style.d.ts
5
- declare const drawerStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root" | "dragBar", {
5
+ declare const drawerStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "root" | "closeButton" | "dragBar", {
6
6
  /**
7
7
  * The placement of the drawer.
8
8
  *
@@ -118,7 +118,7 @@ declare const drawerStyle: ComponentSlotStyle<"body" | "footer" | "header" | "ti
118
118
  rounded: "0";
119
119
  };
120
120
  };
121
- }, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root" | "dragBar">>>;
121
+ }, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "root" | "closeButton" | "dragBar">>>;
122
122
  type DrawerStyle = typeof drawerStyle;
123
123
  //#endregion
124
124
  export { DrawerStyle, drawerStyle };
@@ -2,7 +2,7 @@ import { ComponentSlotStyle } from "../../core/system/index.types.js";
2
2
  import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
3
3
  import "../../index.js";
4
4
  //#region src/components/file-input/file-input.style.d.ts
5
- declare const fileInputStyle: ComponentSlotStyle<"tag" | "root", CSSPropObject<CSSSlotObject<"tag" | "root">>, {
5
+ declare const fileInputStyle: ComponentSlotStyle<"root" | "tag", CSSPropObject<CSSSlotObject<"root" | "tag">>, {
6
6
  xs: {
7
7
  root: {
8
8
  "&:has(~ [data-input-element])"?: {
@@ -2,7 +2,7 @@ import { ComponentSlotStyle } from "../../core/system/index.types.js";
2
2
  import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
3
3
  import "../../index.js";
4
4
  //#region src/components/modal/modal.style.d.ts
5
- declare const modalStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root", {
5
+ declare const modalStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "root" | "closeButton", {
6
6
  /**
7
7
  * The placement of the modal.
8
8
  *
@@ -156,7 +156,7 @@ declare const modalStyle: ComponentSlotStyle<"body" | "footer" | "header" | "tit
156
156
  p: "0";
157
157
  };
158
158
  };
159
- }, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root">>>;
159
+ }, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "root" | "closeButton">>>;
160
160
  type ModalStyle = typeof modalStyle;
161
161
  //#endregion
162
162
  export { ModalStyle, modalStyle };
@@ -2,7 +2,7 @@ import { ComponentSlotStyle } from "../../core/system/index.types.js";
2
2
  import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
3
3
  import "../../index.js";
4
4
  //#region src/components/notice/notice.style.d.ts
5
- declare const noticeStyle: ComponentSlotStyle<"content" | "closeButton" | "root" | "item", CSSPropObject<CSSSlotObject<"content" | "closeButton" | "root" | "item">>, CSSModifierObject<CSSSlotObject<"content" | "closeButton" | "root" | "item">>, CSSModifierObject<CSSSlotObject<"content" | "closeButton" | "root" | "item">>>;
5
+ declare const noticeStyle: ComponentSlotStyle<"content" | "root" | "closeButton" | "item", CSSPropObject<CSSSlotObject<"content" | "root" | "closeButton" | "item">>, CSSModifierObject<CSSSlotObject<"content" | "root" | "closeButton" | "item">>, CSSModifierObject<CSSSlotObject<"content" | "root" | "closeButton" | "item">>>;
6
6
  type NoticeStyle = typeof noticeStyle;
7
7
  //#endregion
8
8
  export { NoticeStyle, noticeStyle };
@@ -1,7 +1,7 @@
1
1
  import { ComponentSlotStyle } from "../../core/system/index.types.js";
2
2
  import "../../index.js";
3
3
  //#region src/components/tag/tag.style.d.ts
4
- declare const tagStyle: ComponentSlotStyle<"content" | "icon" | "closeButton" | "root" | "endIcon" | "startIcon", {
4
+ declare const tagStyle: ComponentSlotStyle<"content" | "icon" | "root" | "closeButton" | "endIcon" | "startIcon", {
5
5
  /**
6
6
  * If `true`, the tag is full rounded. Else, it'll be slightly round.
7
7
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yamada-ui/react",
3
3
  "type": "module",
4
- "version": "2.2.6-dev-20260729002855",
4
+ "version": "2.2.6-dev-20260729093730",
5
5
  "description": "React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion",
6
6
  "keywords": [
7
7
  "yamada",