lizaui 9.0.11 → 9.0.12

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 (73) hide show
  1. package/dist/button/index.es.js +1 -1
  2. package/dist/calendar/index.es.js +1 -1
  3. package/dist/checkbox/index.es.js +1 -1
  4. package/dist/chunks/{button-B0fpJrMg.js → button-CA3Y2GZ1.js} +2 -2
  5. package/dist/chunks/{button-B0fpJrMg.js.map → button-CA3Y2GZ1.js.map} +1 -1
  6. package/dist/chunks/{checkbox-C1Sssumg.js → checkbox-qzZKMLRN.js} +2 -2
  7. package/dist/chunks/{checkbox-C1Sssumg.js.map → checkbox-qzZKMLRN.js.map} +1 -1
  8. package/dist/chunks/{floating-ui.dom-DsMDyTcd.js → floating-ui.dom-N5ROFCJy.js} +1 -10
  9. package/dist/chunks/{floating-ui.dom-DsMDyTcd.js.map → floating-ui.dom-N5ROFCJy.js.map} +1 -1
  10. package/dist/chunks/{floating-ui.dom-Bd-QJw02.js → floating-ui.dom-NqZWWqNg.js} +4 -13
  11. package/dist/chunks/{floating-ui.dom-Bd-QJw02.js.map → floating-ui.dom-NqZWWqNg.js.map} +1 -1
  12. package/dist/chunks/index-CuySPbdY.js +559 -0
  13. package/dist/chunks/index-CuySPbdY.js.map +1 -0
  14. package/dist/chunks/index-DBDBh58Q.js +575 -0
  15. package/dist/chunks/index-DBDBh58Q.js.map +1 -0
  16. package/dist/chunks/index-DNSql2gU.js +662 -0
  17. package/dist/chunks/index-DNSql2gU.js.map +1 -0
  18. package/dist/chunks/{index-B4RTH1-D.js → index-DiC9dI6_.js} +4 -4
  19. package/dist/chunks/{index-B4RTH1-D.js.map → index-DiC9dI6_.js.map} +1 -1
  20. package/dist/chunks/index-DlZi5TkN.js +646 -0
  21. package/dist/chunks/index-DlZi5TkN.js.map +1 -0
  22. package/dist/chunks/{scroll-area-C0NhSIO2.js → scroll-area-BboZbU1u.js} +27 -27
  23. package/dist/chunks/{scroll-area-C0NhSIO2.js.map → scroll-area-BboZbU1u.js.map} +1 -1
  24. package/dist/chunks/{scroll-area-JgKF61tc.js → scroll-area-DKkgpH-S.js} +3 -3
  25. package/dist/chunks/{scroll-area-JgKF61tc.js.map → scroll-area-DKkgpH-S.js.map} +1 -1
  26. package/dist/chunks/{select-DGnc8VJi.js → select-MSYUKpRI.js} +83 -439
  27. package/dist/chunks/select-MSYUKpRI.js.map +1 -0
  28. package/dist/chunks/{select-Dpyj5dUk.js → select-s-z596Y4.js} +10 -366
  29. package/dist/chunks/select-s-z596Y4.js.map +1 -0
  30. package/dist/chunks/{textarea-D2_KC-J4.js → textarea-By2Vv44z.js} +36 -587
  31. package/dist/chunks/textarea-By2Vv44z.js.map +1 -0
  32. package/dist/chunks/{textarea-_HQpXiCX.js → textarea-ClJsk9Gp.js} +35 -586
  33. package/dist/chunks/textarea-ClJsk9Gp.js.map +1 -0
  34. package/dist/chunks/tooltip-BP--5Wj2.js +525 -0
  35. package/dist/chunks/tooltip-BP--5Wj2.js.map +1 -0
  36. package/dist/chunks/tooltip-KggPQa5m.js +541 -0
  37. package/dist/chunks/tooltip-KggPQa5m.js.map +1 -0
  38. package/dist/components/tooltip/tooltip-nice.d.ts +11 -0
  39. package/dist/components/tooltip/tooltip-nice.d.ts.map +1 -0
  40. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  41. package/dist/components/ui/tooltip.d.ts +8 -0
  42. package/dist/components/ui/tooltip.d.ts.map +1 -0
  43. package/dist/divider/index.es.js +1 -1
  44. package/dist/modal/index.es.js +1 -1
  45. package/dist/pagination/index.cjs.js +2 -2
  46. package/dist/pagination/index.es.js +3 -3
  47. package/dist/phone-input/index.cjs.js +2 -2
  48. package/dist/phone-input/index.es.js +3 -3
  49. package/dist/select-input/index.cjs.js +1 -1
  50. package/dist/select-input/index.es.js +2 -2
  51. package/dist/table/index.cjs.js +1 -1
  52. package/dist/table/index.es.js +2 -2
  53. package/dist/time-input/index.cjs.js +1 -1
  54. package/dist/time-input/index.es.js +2 -2
  55. package/dist/tooltip/index.cjs.js +1 -1
  56. package/dist/tooltip/index.es.js +1 -1
  57. package/dist/ui/index.cjs.js +292 -290
  58. package/dist/ui/index.cjs.js.map +1 -1
  59. package/dist/ui/index.es.js +182 -180
  60. package/dist/ui/index.es.js.map +1 -1
  61. package/package.json +10 -9
  62. package/dist/chunks/floating-ui.react-dom-CjlUwp8V.js +0 -294
  63. package/dist/chunks/floating-ui.react-dom-CjlUwp8V.js.map +0 -1
  64. package/dist/chunks/floating-ui.react-dom-D5BI9L2i.js +0 -310
  65. package/dist/chunks/floating-ui.react-dom-D5BI9L2i.js.map +0 -1
  66. package/dist/chunks/select-DGnc8VJi.js.map +0 -1
  67. package/dist/chunks/select-Dpyj5dUk.js.map +0 -1
  68. package/dist/chunks/textarea-D2_KC-J4.js.map +0 -1
  69. package/dist/chunks/textarea-_HQpXiCX.js.map +0 -1
  70. package/dist/chunks/tooltip-GGFk8ALK.js +0 -1402
  71. package/dist/chunks/tooltip-GGFk8ALK.js.map +0 -1
  72. package/dist/chunks/tooltip-JwIbppjO.js +0 -1387
  73. package/dist/chunks/tooltip-JwIbppjO.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { useId as useId$2, useState, useEffect, createContext, forwardRef, createElement, useContext, useRef, useLayoutEffect, useImperativeHandle, useCallback, useMemo } from "react";
3
+ import { useId as useId$1, useState, useEffect, createContext, forwardRef, createElement, useContext, useRef, useLayoutEffect, useImperativeHandle, useCallback, useMemo } from "react";
4
4
  import { c as colorVariants } from "./variants-CrIs_I54.js";
5
5
  import { t as tv } from "./tv-B0li4IsO.js";
6
6
  import { c as cva } from "./index-CEKmKomA.js";
@@ -11,10 +11,9 @@ import { v as validatePatternInput } from "./pattern-CWRl6jXR.js";
11
11
  import "./assertion-LpGn6Vzq.js";
12
12
  import { L as LabelError } from "./label-error-BTCuInp7.js";
13
13
  import { motion, AnimatePresence } from "framer-motion";
14
- import { c as createSlot, u as useComposedRefs } from "./index-B4RTH1-D.js";
15
- import * as ReactDOM from "react-dom";
16
- import ReactDOM__default from "react-dom";
17
- import { B as Button } from "./button-B0fpJrMg.js";
14
+ import { f as useCallbackRef$1, P as Primitive, c as createContextScope, d as Presence, b as composeEventHandlers, e as Portal$1, D as DismissableLayer, h as createContext2, a as useControllableState, u as useId$2 } from "./index-CuySPbdY.js";
15
+ import { u as useComposedRefs, a as createSlot } from "./index-DiC9dI6_.js";
16
+ import { B as Button } from "./button-CA3Y2GZ1.js";
18
17
  const badge = tv({
19
18
  slots: {
20
19
  base: ["relative", "inline-flex", "shrink-0"],
@@ -531,41 +530,6 @@ const Input = React.forwardRef((props2, ref) => {
531
530
  ] });
532
531
  });
533
532
  Input.displayName = "Input";
534
- var NODES = [
535
- "a",
536
- "button",
537
- "div",
538
- "form",
539
- "h2",
540
- "h3",
541
- "img",
542
- "input",
543
- "label",
544
- "li",
545
- "nav",
546
- "ol",
547
- "p",
548
- "select",
549
- "span",
550
- "svg",
551
- "ul"
552
- ];
553
- var Primitive = NODES.reduce((primitive, node) => {
554
- const Slot2 = createSlot(`Primitive.${node}`);
555
- const Node2 = React.forwardRef((props2, forwardedRef) => {
556
- const { asChild, ...primitiveProps } = props2;
557
- const Comp = asChild ? Slot2 : node;
558
- if (typeof window !== "undefined") {
559
- window[Symbol.for("radix-ui")] = true;
560
- }
561
- return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
562
- });
563
- Node2.displayName = `Primitive.${node}`;
564
- return { ...primitive, [node]: Node2 };
565
- }, {});
566
- function dispatchDiscreteCustomEvent(target, event) {
567
- if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
568
- }
569
533
  const SwitchClassProps = cva(["flex items-center cursor-pointer relative rounded-full p-0.5 px-1 relative overflow-hidden"], {
570
534
  variants: {
571
535
  color: {
@@ -606,7 +570,7 @@ const Switch = ({
606
570
  onChange,
607
571
  ...props2
608
572
  }) => {
609
- const switchId = useId$2();
573
+ const switchId = useId$1();
610
574
  const resolvedId = id || switchId;
611
575
  const [valueCheck, setValueCheck] = useState(false);
612
576
  useEffect(() => {
@@ -705,382 +669,18 @@ const Switch = ({
705
669
  ] });
706
670
  };
707
671
  Switch.displayName = "Switch";
708
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
709
- return function handleEvent(event) {
710
- originalEventHandler?.(event);
711
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
712
- return ourEventHandler?.(event);
713
- }
714
- };
715
- }
716
- function createContext2(rootComponentName, defaultContext) {
717
- const Context = React.createContext(defaultContext);
718
- const Provider = (props2) => {
719
- const { children, ...context } = props2;
720
- const value = React.useMemo(() => context, Object.values(context));
721
- return /* @__PURE__ */ jsx(Context.Provider, { value, children });
722
- };
723
- Provider.displayName = rootComponentName + "Provider";
724
- function useContext2(consumerName) {
725
- const context = React.useContext(Context);
726
- if (context) return context;
727
- if (defaultContext !== void 0) return defaultContext;
728
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
729
- }
730
- return [Provider, useContext2];
731
- }
732
- function createContextScope(scopeName, createContextScopeDeps = []) {
733
- let defaultContexts = [];
734
- function createContext3(rootComponentName, defaultContext) {
735
- const BaseContext = React.createContext(defaultContext);
736
- const index = defaultContexts.length;
737
- defaultContexts = [...defaultContexts, defaultContext];
738
- const Provider = (props2) => {
739
- const { scope, children, ...context } = props2;
740
- const Context = scope?.[scopeName]?.[index] || BaseContext;
741
- const value = React.useMemo(() => context, Object.values(context));
742
- return /* @__PURE__ */ jsx(Context.Provider, { value, children });
743
- };
744
- Provider.displayName = rootComponentName + "Provider";
745
- function useContext2(consumerName, scope) {
746
- const Context = scope?.[scopeName]?.[index] || BaseContext;
747
- const context = React.useContext(Context);
748
- if (context) return context;
749
- if (defaultContext !== void 0) return defaultContext;
750
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
751
- }
752
- return [Provider, useContext2];
753
- }
754
- const createScope = () => {
755
- const scopeContexts = defaultContexts.map((defaultContext) => {
756
- return React.createContext(defaultContext);
757
- });
758
- return function useScope(scope) {
759
- const contexts = scope?.[scopeName] || scopeContexts;
760
- return React.useMemo(
761
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
762
- [scope, contexts]
763
- );
764
- };
765
- };
766
- createScope.scopeName = scopeName;
767
- return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
768
- }
769
- function composeContextScopes(...scopes) {
770
- const baseScope = scopes[0];
771
- if (scopes.length === 1) return baseScope;
772
- const createScope = () => {
773
- const scopeHooks = scopes.map((createScope2) => ({
774
- useScope: createScope2(),
775
- scopeName: createScope2.scopeName
776
- }));
777
- return function useComposedScopes(overrideScopes) {
778
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
779
- const scopeProps = useScope(overrideScopes);
780
- const currentScope = scopeProps[`__scope${scopeName}`];
781
- return { ...nextScopes2, ...currentScope };
782
- }, {});
783
- return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
784
- };
785
- };
786
- createScope.scopeName = baseScope.scopeName;
787
- return createScope;
788
- }
789
- var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
790
- };
791
- var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
792
- function useControllableState({
793
- prop,
794
- defaultProp,
795
- onChange = () => {
796
- },
797
- caller
798
- }) {
799
- const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
800
- defaultProp,
801
- onChange
802
- });
803
- const isControlled = prop !== void 0;
804
- const value = isControlled ? prop : uncontrolledProp;
805
- {
806
- const isControlledRef = React.useRef(prop !== void 0);
807
- React.useEffect(() => {
808
- const wasControlled = isControlledRef.current;
809
- if (wasControlled !== isControlled) {
810
- const from = wasControlled ? "controlled" : "uncontrolled";
811
- const to = isControlled ? "controlled" : "uncontrolled";
812
- }
813
- isControlledRef.current = isControlled;
814
- }, [isControlled, caller]);
815
- }
816
- const setValue = React.useCallback(
817
- (nextValue) => {
818
- if (isControlled) {
819
- const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
820
- if (value2 !== prop) {
821
- onChangeRef.current?.(value2);
822
- }
823
- } else {
824
- setUncontrolledProp(nextValue);
825
- }
826
- },
827
- [isControlled, prop, setUncontrolledProp, onChangeRef]
828
- );
829
- return [value, setValue];
830
- }
831
- function useUncontrolledState({
832
- defaultProp,
833
- onChange
834
- }) {
835
- const [value, setValue] = React.useState(defaultProp);
836
- const prevValueRef = React.useRef(value);
837
- const onChangeRef = React.useRef(onChange);
838
- useInsertionEffect(() => {
839
- onChangeRef.current = onChange;
840
- }, [onChange]);
841
- React.useEffect(() => {
842
- if (prevValueRef.current !== value) {
843
- onChangeRef.current?.(value);
844
- prevValueRef.current = value;
845
- }
846
- }, [value, prevValueRef]);
847
- return [value, setValue, onChangeRef];
848
- }
849
- function isFunction(value) {
850
- return typeof value === "function";
851
- }
852
- function useCallbackRef$1(callback) {
853
- const callbackRef = React.useRef(callback);
854
- React.useEffect(() => {
855
- callbackRef.current = callback;
856
- });
857
- return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
858
- }
859
- function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
860
- const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
861
- React.useEffect(() => {
862
- const handleKeyDown = (event) => {
863
- if (event.key === "Escape") {
864
- onEscapeKeyDown(event);
865
- }
866
- };
867
- ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
868
- return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
869
- }, [onEscapeKeyDown, ownerDocument]);
870
- }
871
- var DISMISSABLE_LAYER_NAME = "DismissableLayer";
872
- var CONTEXT_UPDATE = "dismissableLayer.update";
873
- var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
874
- var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
875
- var originalBodyPointerEvents;
876
- var DismissableLayerContext = React.createContext({
877
- layers: /* @__PURE__ */ new Set(),
878
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
879
- branches: /* @__PURE__ */ new Set()
880
- });
881
- var DismissableLayer = React.forwardRef(
882
- (props2, forwardedRef) => {
883
- const {
884
- disableOutsidePointerEvents = false,
885
- onEscapeKeyDown,
886
- onPointerDownOutside,
887
- onFocusOutside,
888
- onInteractOutside,
889
- onDismiss,
890
- ...layerProps
891
- } = props2;
892
- const context = React.useContext(DismissableLayerContext);
893
- const [node, setNode] = React.useState(null);
894
- const ownerDocument = node?.ownerDocument ?? globalThis?.document;
895
- const [, force] = React.useState({});
896
- const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
897
- const layers = Array.from(context.layers);
898
- const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
899
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
900
- const index = node ? layers.indexOf(node) : -1;
901
- const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
902
- const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
903
- const pointerDownOutside = usePointerDownOutside((event) => {
904
- const target = event.target;
905
- const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
906
- if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
907
- onPointerDownOutside?.(event);
908
- onInteractOutside?.(event);
909
- if (!event.defaultPrevented) onDismiss?.();
910
- }, ownerDocument);
911
- const focusOutside = useFocusOutside((event) => {
912
- const target = event.target;
913
- const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
914
- if (isFocusInBranch) return;
915
- onFocusOutside?.(event);
916
- onInteractOutside?.(event);
917
- if (!event.defaultPrevented) onDismiss?.();
918
- }, ownerDocument);
919
- useEscapeKeydown((event) => {
920
- const isHighestLayer = index === context.layers.size - 1;
921
- if (!isHighestLayer) return;
922
- onEscapeKeyDown?.(event);
923
- if (!event.defaultPrevented && onDismiss) {
924
- event.preventDefault();
925
- onDismiss();
926
- }
927
- }, ownerDocument);
928
- React.useEffect(() => {
929
- if (!node) return;
930
- if (disableOutsidePointerEvents) {
931
- if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
932
- originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
933
- ownerDocument.body.style.pointerEvents = "none";
934
- }
935
- context.layersWithOutsidePointerEventsDisabled.add(node);
936
- }
937
- context.layers.add(node);
938
- dispatchUpdate();
939
- return () => {
940
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
941
- ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
942
- }
943
- };
944
- }, [node, ownerDocument, disableOutsidePointerEvents, context]);
945
- React.useEffect(() => {
946
- return () => {
947
- if (!node) return;
948
- context.layers.delete(node);
949
- context.layersWithOutsidePointerEventsDisabled.delete(node);
950
- dispatchUpdate();
951
- };
952
- }, [node, context]);
953
- React.useEffect(() => {
954
- const handleUpdate = () => force({});
955
- document.addEventListener(CONTEXT_UPDATE, handleUpdate);
956
- return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
957
- }, []);
958
- return /* @__PURE__ */ jsx(
959
- Primitive.div,
960
- {
961
- ...layerProps,
962
- ref: composedRefs,
963
- style: {
964
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
965
- ...props2.style
966
- },
967
- onFocusCapture: composeEventHandlers(props2.onFocusCapture, focusOutside.onFocusCapture),
968
- onBlurCapture: composeEventHandlers(props2.onBlurCapture, focusOutside.onBlurCapture),
969
- onPointerDownCapture: composeEventHandlers(
970
- props2.onPointerDownCapture,
971
- pointerDownOutside.onPointerDownCapture
972
- )
973
- }
974
- );
975
- }
976
- );
977
- DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
978
- var BRANCH_NAME = "DismissableLayerBranch";
979
- var DismissableLayerBranch = React.forwardRef((props2, forwardedRef) => {
980
- const context = React.useContext(DismissableLayerContext);
981
- const ref = React.useRef(null);
982
- const composedRefs = useComposedRefs(forwardedRef, ref);
983
- React.useEffect(() => {
984
- const node = ref.current;
985
- if (node) {
986
- context.branches.add(node);
987
- return () => {
988
- context.branches.delete(node);
989
- };
990
- }
991
- }, [context.branches]);
992
- return /* @__PURE__ */ jsx(Primitive.div, { ...props2, ref: composedRefs });
993
- });
994
- DismissableLayerBranch.displayName = BRANCH_NAME;
995
- function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
996
- const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
997
- const isPointerInsideReactTreeRef = React.useRef(false);
998
- const handleClickRef = React.useRef(() => {
999
- });
1000
- React.useEffect(() => {
1001
- const handlePointerDown2 = (event) => {
1002
- if (event.target && !isPointerInsideReactTreeRef.current) {
1003
- let handleAndDispatchPointerDownOutsideEvent2 = function() {
1004
- handleAndDispatchCustomEvent(
1005
- POINTER_DOWN_OUTSIDE,
1006
- handlePointerDownOutside,
1007
- eventDetail,
1008
- { discrete: true }
1009
- );
1010
- };
1011
- const eventDetail = { originalEvent: event };
1012
- if (event.pointerType === "touch") {
1013
- ownerDocument.removeEventListener("click", handleClickRef.current);
1014
- handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
1015
- ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
1016
- } else {
1017
- handleAndDispatchPointerDownOutsideEvent2();
1018
- }
1019
- } else {
1020
- ownerDocument.removeEventListener("click", handleClickRef.current);
1021
- }
1022
- isPointerInsideReactTreeRef.current = false;
1023
- };
1024
- const timerId = window.setTimeout(() => {
1025
- ownerDocument.addEventListener("pointerdown", handlePointerDown2);
1026
- }, 0);
1027
- return () => {
1028
- window.clearTimeout(timerId);
1029
- ownerDocument.removeEventListener("pointerdown", handlePointerDown2);
1030
- ownerDocument.removeEventListener("click", handleClickRef.current);
1031
- };
1032
- }, [ownerDocument, handlePointerDownOutside]);
1033
- return {
1034
- // ensures we check React component tree (not just DOM tree)
1035
- onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
1036
- };
1037
- }
1038
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
1039
- const handleFocusOutside = useCallbackRef$1(onFocusOutside);
1040
- const isFocusInsideReactTreeRef = React.useRef(false);
1041
- React.useEffect(() => {
1042
- const handleFocus = (event) => {
1043
- if (event.target && !isFocusInsideReactTreeRef.current) {
1044
- const eventDetail = { originalEvent: event };
1045
- handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
1046
- discrete: false
1047
- });
1048
- }
1049
- };
1050
- ownerDocument.addEventListener("focusin", handleFocus);
1051
- return () => ownerDocument.removeEventListener("focusin", handleFocus);
1052
- }, [ownerDocument, handleFocusOutside]);
1053
- return {
1054
- onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
1055
- onBlurCapture: () => isFocusInsideReactTreeRef.current = false
1056
- };
1057
- }
1058
- function dispatchUpdate() {
1059
- const event = new CustomEvent(CONTEXT_UPDATE);
1060
- document.dispatchEvent(event);
1061
- }
1062
- function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
1063
- const target = detail.originalEvent.target;
1064
- const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
1065
- if (handler) target.addEventListener(name, handler, { once: true });
1066
- if (discrete) {
1067
- dispatchDiscreteCustomEvent(target, event);
1068
- } else {
1069
- target.dispatchEvent(event);
1070
- }
1071
- }
1072
- var count$1 = 0;
672
+ var count = 0;
1073
673
  function useFocusGuards() {
1074
674
  React.useEffect(() => {
1075
675
  const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
1076
676
  document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
1077
677
  document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
1078
- count$1++;
678
+ count++;
1079
679
  return () => {
1080
- if (count$1 === 1) {
680
+ if (count === 1) {
1081
681
  document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
1082
682
  }
1083
- count$1--;
683
+ count--;
1084
684
  };
1085
685
  }, []);
1086
686
  }
@@ -1293,146 +893,6 @@ function arrayRemove(array, item) {
1293
893
  function removeLinks(items) {
1294
894
  return items.filter((item) => item.tagName !== "A");
1295
895
  }
1296
- var useReactId = React[" useId ".trim().toString()] || (() => void 0);
1297
- var count = 0;
1298
- function useId$1(deterministicId) {
1299
- const [id, setId] = React.useState(useReactId());
1300
- useLayoutEffect2(() => {
1301
- setId((reactId) => reactId ?? String(count++));
1302
- }, [deterministicId]);
1303
- return deterministicId || (id ? `radix-${id}` : "");
1304
- }
1305
- var PORTAL_NAME$1 = "Portal";
1306
- var Portal$1 = React.forwardRef((props2, forwardedRef) => {
1307
- const { container: containerProp, ...portalProps } = props2;
1308
- const [mounted, setMounted] = React.useState(false);
1309
- useLayoutEffect2(() => setMounted(true), []);
1310
- const container = containerProp || mounted && globalThis?.document?.body;
1311
- return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
1312
- });
1313
- Portal$1.displayName = PORTAL_NAME$1;
1314
- function useStateMachine(initialState, machine) {
1315
- return React.useReducer((state, event) => {
1316
- const nextState = machine[state][event];
1317
- return nextState ?? state;
1318
- }, initialState);
1319
- }
1320
- var Presence = (props2) => {
1321
- const { present, children } = props2;
1322
- const presence = usePresence(present);
1323
- const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
1324
- const ref = useComposedRefs(presence.ref, getElementRef(child));
1325
- const forceMount = typeof children === "function";
1326
- return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
1327
- };
1328
- Presence.displayName = "Presence";
1329
- function usePresence(present) {
1330
- const [node, setNode] = React.useState();
1331
- const stylesRef = React.useRef(null);
1332
- const prevPresentRef = React.useRef(present);
1333
- const prevAnimationNameRef = React.useRef("none");
1334
- const initialState = present ? "mounted" : "unmounted";
1335
- const [state, send] = useStateMachine(initialState, {
1336
- mounted: {
1337
- UNMOUNT: "unmounted",
1338
- ANIMATION_OUT: "unmountSuspended"
1339
- },
1340
- unmountSuspended: {
1341
- MOUNT: "mounted",
1342
- ANIMATION_END: "unmounted"
1343
- },
1344
- unmounted: {
1345
- MOUNT: "mounted"
1346
- }
1347
- });
1348
- React.useEffect(() => {
1349
- const currentAnimationName = getAnimationName(stylesRef.current);
1350
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
1351
- }, [state]);
1352
- useLayoutEffect2(() => {
1353
- const styles = stylesRef.current;
1354
- const wasPresent = prevPresentRef.current;
1355
- const hasPresentChanged = wasPresent !== present;
1356
- if (hasPresentChanged) {
1357
- const prevAnimationName = prevAnimationNameRef.current;
1358
- const currentAnimationName = getAnimationName(styles);
1359
- if (present) {
1360
- send("MOUNT");
1361
- } else if (currentAnimationName === "none" || styles?.display === "none") {
1362
- send("UNMOUNT");
1363
- } else {
1364
- const isAnimating = prevAnimationName !== currentAnimationName;
1365
- if (wasPresent && isAnimating) {
1366
- send("ANIMATION_OUT");
1367
- } else {
1368
- send("UNMOUNT");
1369
- }
1370
- }
1371
- prevPresentRef.current = present;
1372
- }
1373
- }, [present, send]);
1374
- useLayoutEffect2(() => {
1375
- if (node) {
1376
- let timeoutId;
1377
- const ownerWindow = node.ownerDocument.defaultView ?? window;
1378
- const handleAnimationEnd = (event) => {
1379
- const currentAnimationName = getAnimationName(stylesRef.current);
1380
- const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
1381
- if (event.target === node && isCurrentAnimation) {
1382
- send("ANIMATION_END");
1383
- if (!prevPresentRef.current) {
1384
- const currentFillMode = node.style.animationFillMode;
1385
- node.style.animationFillMode = "forwards";
1386
- timeoutId = ownerWindow.setTimeout(() => {
1387
- if (node.style.animationFillMode === "forwards") {
1388
- node.style.animationFillMode = currentFillMode;
1389
- }
1390
- });
1391
- }
1392
- }
1393
- };
1394
- const handleAnimationStart = (event) => {
1395
- if (event.target === node) {
1396
- prevAnimationNameRef.current = getAnimationName(stylesRef.current);
1397
- }
1398
- };
1399
- node.addEventListener("animationstart", handleAnimationStart);
1400
- node.addEventListener("animationcancel", handleAnimationEnd);
1401
- node.addEventListener("animationend", handleAnimationEnd);
1402
- return () => {
1403
- ownerWindow.clearTimeout(timeoutId);
1404
- node.removeEventListener("animationstart", handleAnimationStart);
1405
- node.removeEventListener("animationcancel", handleAnimationEnd);
1406
- node.removeEventListener("animationend", handleAnimationEnd);
1407
- };
1408
- } else {
1409
- send("ANIMATION_END");
1410
- }
1411
- }, [node, send]);
1412
- return {
1413
- isPresent: ["mounted", "unmountSuspended"].includes(state),
1414
- ref: React.useCallback((node2) => {
1415
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
1416
- setNode(node2);
1417
- }, [])
1418
- };
1419
- }
1420
- function getAnimationName(styles) {
1421
- return styles?.animationName || "none";
1422
- }
1423
- function getElementRef(element) {
1424
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
1425
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1426
- if (mayWarn) {
1427
- return element.ref;
1428
- }
1429
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
1430
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1431
- if (mayWarn) {
1432
- return element.props.ref;
1433
- }
1434
- return element.props.ref || element.ref;
1435
- }
1436
896
  var getDefaultParent = function(originalTarget) {
1437
897
  if (typeof document === "undefined") {
1438
898
  return null;
@@ -4335,9 +3795,9 @@ var Dialog$1 = (props2) => {
4335
3795
  scope: __scopeDialog,
4336
3796
  triggerRef,
4337
3797
  contentRef,
4338
- contentId: useId$1(),
4339
- titleId: useId$1(),
4340
- descriptionId: useId$1(),
3798
+ contentId: useId$2(),
3799
+ titleId: useId$2(),
3800
+ descriptionId: useId$2(),
4341
3801
  open,
4342
3802
  onOpenChange: setOpen,
4343
3803
  onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
@@ -4983,49 +4443,38 @@ const Textarea = React.forwardRef(
4983
4443
  );
4984
4444
  Textarea.displayName = "Textarea";
4985
4445
  export {
4986
- DialogClose as A,
4987
4446
  Badge as B,
4988
4447
  Content as C,
4989
- DismissableLayer as D,
4990
- DialogFooter as E,
4448
+ Dialog as D,
4991
4449
  FocusScope as F,
4992
- DialogOverlay as G,
4993
- DialogPortal as H,
4994
4450
  Input as I,
4995
- DialogTrigger as J,
4996
- Textarea as K,
4997
4451
  Lt as L,
4998
4452
  Overlay as O,
4999
- Primitive as P,
4453
+ PanelGroup as P,
5000
4454
  ReactRemoveScroll as R,
5001
4455
  Switch as S,
5002
4456
  Trigger as T,
5003
4457
  WarningProvider as W,
5004
- Presence as a,
5005
- composeEventHandlers as b,
5006
- createContextScope as c,
5007
- useLayoutEffect2 as d,
5008
- useControllableState as e,
5009
- useId$1 as f,
5010
- Portal$1 as g,
4458
+ Panel as a,
4459
+ PanelResizeHandle as b,
4460
+ Root as c,
4461
+ Portal as d,
4462
+ DialogHeader as e,
4463
+ DialogTitle as f,
4464
+ DialogDescription as g,
5011
4465
  hideOthers as h,
5012
- useFocusGuards as i,
5013
- dispatchDiscreteCustomEvent as j,
5014
- PanelGroup as k,
5015
- Panel as l,
5016
- PanelResizeHandle as m,
5017
- Root as n,
5018
- Portal as o,
5019
- Dialog as p,
5020
- DialogHeader as q,
5021
- DialogTitle as r,
5022
- DialogDescription as s,
5023
- DialogContent as t,
5024
- useCallbackRef$1 as u,
5025
- jt as v,
5026
- Close as w,
5027
- Title as x,
5028
- Description as y,
5029
- createDialogScope as z
4466
+ DialogContent as i,
4467
+ jt as j,
4468
+ Close as k,
4469
+ Title as l,
4470
+ Description as m,
4471
+ createDialogScope as n,
4472
+ DialogClose as o,
4473
+ DialogFooter as p,
4474
+ DialogOverlay as q,
4475
+ DialogPortal as r,
4476
+ DialogTrigger as s,
4477
+ Textarea as t,
4478
+ useFocusGuards as u
5030
4479
  };
5031
- //# sourceMappingURL=textarea-_HQpXiCX.js.map
4480
+ //# sourceMappingURL=textarea-ClJsk9Gp.js.map