@inkeep/cxkit-react 0.5.37 → 0.5.38
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/dist/_virtual/index.cjs +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.development.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/components/embedded-search-and-chat.impl.cjs +1 -1
- package/dist/components/embedded-search.cjs +1 -1
- package/dist/components/embedded-search.js +29 -28
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-context/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-context/dist/index.js +68 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.4_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19.0._ucun7uecgispdhq4vhr26lovum/node_modules/@radix-ui/react-dialog/dist/index.cjs +5 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.4_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19.0._ucun7uecgispdhq4vhr26lovum/node_modules/@radix-ui/react-dialog/dist/index.js +253 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types__v2z2flytqizqloot5tnzsv72ca/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types__v2z2flytqizqloot5tnzsv72ca/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@_jnpeo7zp526zce4fsmzkscleui/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@_jnpeo7zp526zce4fsmzkscleui/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-id/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-id/dist/index.js +13 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19.0._k6mvjumazun2buzo2dcp22wl2y/node_modules/@radix-ui/react-portal/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19.0._k6mvjumazun2buzo2dcp22wl2y/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.2_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19._ceqn6mtlqa4vrghvmtsw5zpqya/node_modules/@radix-ui/react-presence/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.2_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19._ceqn6mtlqa4vrghvmtsw5zpqya/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19_zjcik7jr4zh3druglzeqejtmrq/node_modules/@radix-ui/react-primitive/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19_zjcik7jr4zh3druglzeqejtmrq/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.2_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19_xmwzi2lpk7e4iscy4hlhgpd4fu/node_modules/@radix-ui/react-primitive/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.2_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19_xmwzi2lpk7e4iscy4hlhgpd4fu/node_modules/@radix-ui/react-primitive/dist/index.js +31 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.js +47 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.2_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.2_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.js +43 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.4/node_modules/aria-hidden/dist/es2015/index.cjs +1 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.4/node_modules/aria-hidden/dist/es2015/index.js +52 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.cjs +1 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +7 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +38 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js +72 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +26 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/Combination.js +12 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +4 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +113 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/UI.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/UI.js +32 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +17 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +65 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/medium.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/medium.js +6 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js +8 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.0.10_react@19.0.0/node_modules/react-style-singleton/dist/es2015/component.cjs +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.0.10_react@19.0.0/node_modules/react-style-singleton/dist/es2015/component.js +12 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.0.10_react@19.0.0/node_modules/react-style-singleton/dist/es2015/hook.cjs +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.0.10_react@19.0.0/node_modules/react-style-singleton/dist/es2015/hook.js +16 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.0.10_react@19.0.0/node_modules/react-style-singleton/dist/es2015/singleton.cjs +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.0.10_react@19.0.0/node_modules/react-style-singleton/dist/es2015/singleton.js +31 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.cjs +1 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +28 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.0.10_react@19.0.0/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.0.10_react@19.0.0/node_modules/use-callback-ref/dist/es2015/assignRef.js +7 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.0.10_react@19.0.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.0.10_react@19.0.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +27 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.0.10_react@19.0.0/node_modules/use-callback-ref/dist/es2015/useRef.cjs +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.0.10_react@19.0.0/node_modules/use-callback-ref/dist/es2015/useRef.js +26 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.0.10_react@19.0.0/node_modules/use-sidecar/dist/es2015/exports.cjs +1 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.0.10_react@19.0.0/node_modules/use-sidecar/dist/es2015/exports.js +19 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.0.10_react@19.0.0/node_modules/use-sidecar/dist/es2015/medium.cjs +1 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.0.10_react@19.0.0/node_modules/use-sidecar/dist/es2015/medium.js +68 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.cjs +1 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js +8 -0
- package/dist/packages/primitives/src/atoms/cmdk/command-score.cjs +1 -0
- package/dist/packages/primitives/src/atoms/cmdk/command-score.js +46 -0
- package/dist/packages/primitives/src/atoms/cmdk/index.cjs +1 -0
- package/dist/packages/primitives/src/atoms/cmdk/index.js +519 -0
- package/dist/packages/primitives/src/atoms/shadow/context.cjs +1 -0
- package/dist/packages/primitives/src/atoms/shadow/context.js +8 -0
- package/dist/packages/primitives/src/constants/search.cjs +1 -0
- package/dist/packages/primitives/src/constants/search.js +5 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),a=require("../utils.cjs");function p(f){const{defaultView:u="search",aiChatSettings:i,baseSettings:g,searchSettings:o,shouldAutoFocusInput:l=!0,onToggleView:h,ref:S
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),a=require("../utils.cjs");function p(f){const{defaultView:u="search",aiChatSettings:i,baseSettings:g,searchSettings:o,shouldAutoFocusInput:l=!0,onToggleView:h,ref:R,...S}=f,s=t.useRef(null),m=a.composeRefs(s,i?.chatFunctionsRef),r=t.useRef(null),d=a.composeRefs(r,o?.searchFunctionsRef),w={...i,chatFunctionsRef:m},I={...o,searchFunctionsRef:d},[n,c]=t.useState(u),b=e=>{e.autoSubmit&&e.query&&s.current?.submitMessage(e.query),h?.(e),c(e.view)};return t.useImperativeHandle(R,()=>({setView:c})),t.useEffect(()=>{n==="chat"?s.current?.focusInput():r.current?.focusInput()},[n]),{config:{baseSettings:g,aiChatSettings:w,searchSettings:I},defaultView:u,view:n,setView:c,onToggleView:b,shouldAutoFocusInput:l,...S}}exports.useWidgetImpl=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),i=require("react"),o=require("./widget-toggle.cjs"),b=require("./modal.cjs"),h=require("../packages/primitives/src/atoms/cmdk/index.cjs");function x(s){const{baseSettings:r,searchSettings:t}=s;return e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:r,searchSettings:t},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(u,{...s})})})}function m(s){const{children:r,onToggleView:t,isHidden:n,shouldAutoFocusInput:c=!t}=s;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:n,shouldAutoFocusInput:c,children:r})}function u(s){return e.jsx(m,{...s,children:e.jsx(S,{...s})})}function S(s){const{searchSettings:{view:r}}=d.useInkeepConfig(),{onToggleView:t,shouldShowAskAICard:n=!!t&&r!=="dual-pane"}=s,c=d.useModal(),a=d.useWidget(),l=c&&!a?b.ModalContent:i.Fragment;return e.jsx(l,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-show-ask-ai-card":d.dataAttr(n),"data-composite":d.dataAttr(!!t||c?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(j,{...s}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(I,{askAILabel:s.askAILabel,onToggleView:s.onToggleView,shouldShowAskAICard:n}),e.jsx(E,{})]}),e.jsx(A,{})]})})})}function j(s){const{onToggleView:r,askAILabel:t,searchLabel:n}=s,c=h.useCommandState(a=>a.search);return e.jsxs(d.EmbeddedSearch.InputGroup,{children:[e.jsx(d.EmbeddedSearch.InputIcon,{}),e.jsx(d.EmbeddedSearch.Input,{}),e.jsx(d.EmbeddedSearch.Loading,{}),r&&e.jsx(o.WidgetToggle,{onToggleView:r,query:c,askAILabel:t,searchLabel:n,view:"search"}),e.jsx(d.Modal.Close,{})]})}function I(s){const{askAILabel:r,onToggleView:t,shouldShowAskAICard:n}=s,c=h.useCommandState(l=>l.search),{handleToggle:a}=o.useToggleView({onToggleView:t,query:c});return n?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>a("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[r||"Ask AI",c&&` "${c}"`]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function E(){return e.jsxs(d.EmbeddedSearch.Results,{children:[e.jsx(d.EmbeddedSearch.ResultsLoading,{}),e.jsx(d.EmbeddedSearch.ResultsTabList,{children:s=>s.map(r=>e.jsx(d.EmbeddedSearch.ResultsTab,{tab:r},r))}),e.jsx(d.EmbeddedSearch.ResultsEmpty,{}),e.jsxs(d.EmbeddedSearch.ResultsContent,{children:[e.jsx(g,{}),e.jsx(R,{})]})]})}function g(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsx(d.EmbeddedSearch.ResultsList,{children:s=>s.map(r=>e.jsxs(d.EmbeddedSearch.ResultsItem,{item:r,children:[e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbs,{children:t=>t.map((n,c)=>e.jsxs(i.Fragment,{children:[n,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},`${n}-${c}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemTag,{}),e.jsx(d.EmbeddedSearch.ResultsItemDescription,{children:t=>t.map((n,c)=>e.jsx(d.EmbeddedSearch.ResultsItemDescriptionPart,{part:n},`part-${c}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIndicator,{})]},r.id))})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function R(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsxs(d.EmbeddedSearch.ResultsItemPreview,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeader,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeading,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbs,{children:s=>s.map((r,t)=>e.jsxs(i.Fragment,{children:[r,e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbIcon,{})]},`${r}-${t}`))})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBody,{}),e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutline,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineList,{children:s=>s.map((r,t)=>e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutlineItem,{href:r.url??void 0,"data-is-match":d.dataAttr(r.isMatch),children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemText,{children:r.content}),r.url&&e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${r.anchor}-${t}`))})]})]})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function A(){return e.jsx(d.EmbeddedSearch.Footer,{children:e.jsxs(d.EmbeddedSearch.TaglineContainer,{children:[e.jsx(d.EmbeddedSearch.TaglineText,{}),e.jsx(d.EmbeddedSearch.TaglineLogo,{}),e.jsx(d.EmbeddedSearch.TaglineBrandName,{})]})})}exports.InkeepEmbeddedSearch=x;exports.InkeepEmbeddedSearchImpl=u;exports.InkeepEmbeddedSearchImplContent=S;exports.InkeepEmbeddedSearchProvider=m;
|
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
3
|
-
import { Shadow as
|
|
3
|
+
import { Shadow as m, RootProvider as I, WebWidgetInteractionType as g, EmbeddedSearch as e, useInkeepConfig as R, useModal as p, useWidget as w, dataAttr as u, Modal as A } from "@inkeep/cxkit-styled";
|
|
4
4
|
import { Fragment as d } from "react";
|
|
5
|
-
import { WidgetToggle as
|
|
6
|
-
import { ModalContent as
|
|
7
|
-
|
|
5
|
+
import { WidgetToggle as T, useToggleView as S } from "./widget-toggle.js";
|
|
6
|
+
import { ModalContent as v } from "./modal.js";
|
|
7
|
+
import { useCommandState as h } from "../packages/primitives/src/atoms/cmdk/index.js";
|
|
8
|
+
function M(n) {
|
|
8
9
|
const { baseSettings: r, searchSettings: l } = n;
|
|
9
|
-
return /* @__PURE__ */ t(
|
|
10
|
-
|
|
10
|
+
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
|
|
11
|
+
I,
|
|
11
12
|
{
|
|
12
13
|
config: {
|
|
13
14
|
baseSettings: r,
|
|
14
15
|
searchSettings: l
|
|
15
16
|
},
|
|
16
|
-
componentType:
|
|
17
|
-
children: /* @__PURE__ */ t(
|
|
17
|
+
componentType: g.EmbeddedSearch,
|
|
18
|
+
children: /* @__PURE__ */ t(f, { ...n })
|
|
18
19
|
}
|
|
19
20
|
) });
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function k(n) {
|
|
22
23
|
const { children: r, onToggleView: l, isHidden: o, shouldAutoFocusInput: i = !l } = n;
|
|
23
24
|
return /* @__PURE__ */ t(e.Provider, { isHidden: o, shouldAutoFocusInput: i, children: r });
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */ t(
|
|
26
|
+
function f(n) {
|
|
27
|
+
return /* @__PURE__ */ t(k, { ...n, children: /* @__PURE__ */ t(P, { ...n }) });
|
|
27
28
|
}
|
|
28
29
|
function P(n) {
|
|
29
30
|
const {
|
|
30
31
|
searchSettings: { view: r }
|
|
31
|
-
} =
|
|
32
|
-
return /* @__PURE__ */ t(i && !c ?
|
|
32
|
+
} = R(), { onToggleView: l, shouldShowAskAICard: o = !!l && r !== "dual-pane" } = n, i = p(), c = w();
|
|
33
|
+
return /* @__PURE__ */ t(i && !c ? v : d, { children: /* @__PURE__ */ t(
|
|
33
34
|
e.Wrapper,
|
|
34
35
|
{
|
|
35
36
|
"data-show-ask-ai-card": u(o),
|
|
@@ -38,7 +39,7 @@ function P(n) {
|
|
|
38
39
|
/* @__PURE__ */ t(b, { ...n }),
|
|
39
40
|
/* @__PURE__ */ s(e.Content, { children: [
|
|
40
41
|
/* @__PURE__ */ t(
|
|
41
|
-
|
|
42
|
+
C,
|
|
42
43
|
{
|
|
43
44
|
askAILabel: n.askAILabel,
|
|
44
45
|
onToggleView: n.onToggleView,
|
|
@@ -47,19 +48,19 @@ function P(n) {
|
|
|
47
48
|
),
|
|
48
49
|
/* @__PURE__ */ t(L, {})
|
|
49
50
|
] }),
|
|
50
|
-
/* @__PURE__ */ t(
|
|
51
|
+
/* @__PURE__ */ t($, {})
|
|
51
52
|
] })
|
|
52
53
|
}
|
|
53
54
|
) });
|
|
54
55
|
}
|
|
55
56
|
function b(n) {
|
|
56
|
-
const { onToggleView: r, askAILabel: l, searchLabel: o } = n,
|
|
57
|
+
const { onToggleView: r, askAILabel: l, searchLabel: o } = n, i = h((c) => c.search);
|
|
57
58
|
return /* @__PURE__ */ s(e.InputGroup, { children: [
|
|
58
59
|
/* @__PURE__ */ t(e.InputIcon, {}),
|
|
59
60
|
/* @__PURE__ */ t(e.Input, {}),
|
|
60
61
|
/* @__PURE__ */ t(e.Loading, {}),
|
|
61
62
|
r && /* @__PURE__ */ t(
|
|
62
|
-
|
|
63
|
+
T,
|
|
63
64
|
{
|
|
64
65
|
onToggleView: r,
|
|
65
66
|
query: i,
|
|
@@ -68,11 +69,11 @@ function b(n) {
|
|
|
68
69
|
view: "search"
|
|
69
70
|
}
|
|
70
71
|
),
|
|
71
|
-
/* @__PURE__ */ t(
|
|
72
|
+
/* @__PURE__ */ t(A.Close, {})
|
|
72
73
|
] });
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
const { askAILabel: r, onToggleView: l, shouldShowAskAICard: o } = n,
|
|
75
|
+
function C(n) {
|
|
76
|
+
const { askAILabel: r, onToggleView: l, shouldShowAskAICard: o } = n, i = h((a) => a.search), { handleToggle: c } = S({
|
|
76
77
|
onToggleView: l,
|
|
77
78
|
query: i
|
|
78
79
|
});
|
|
@@ -91,12 +92,12 @@ function L() {
|
|
|
91
92
|
/* @__PURE__ */ t(e.ResultsTabList, { children: (n) => n.map((r) => /* @__PURE__ */ t(e.ResultsTab, { tab: r }, r)) }),
|
|
92
93
|
/* @__PURE__ */ t(e.ResultsEmpty, {}),
|
|
93
94
|
/* @__PURE__ */ s(e.ResultsContent, { children: [
|
|
94
|
-
/* @__PURE__ */ t(
|
|
95
|
-
/* @__PURE__ */ t(
|
|
95
|
+
/* @__PURE__ */ t(V, {}),
|
|
96
|
+
/* @__PURE__ */ t(O, {})
|
|
96
97
|
] })
|
|
97
98
|
] });
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function V() {
|
|
100
101
|
return /* @__PURE__ */ s(e.ResultsScrollArea, { children: [
|
|
101
102
|
/* @__PURE__ */ t(e.ResultsScrollAreaViewport, { children: /* @__PURE__ */ t(e.ResultsList, { children: (n) => n.map((r) => /* @__PURE__ */ s(e.ResultsItem, { item: r, children: [
|
|
102
103
|
/* @__PURE__ */ t(e.ResultsItemBreadcrumbs, { children: (l) => l.map((o, i) => /* @__PURE__ */ s(d, { children: [
|
|
@@ -119,7 +120,7 @@ function C() {
|
|
|
119
120
|
/* @__PURE__ */ t(e.ResultsScrollAreaCorner, {})
|
|
120
121
|
] });
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function O() {
|
|
123
124
|
return /* @__PURE__ */ s(e.ResultsScrollArea, { children: [
|
|
124
125
|
/* @__PURE__ */ t(e.ResultsScrollAreaViewport, { children: /* @__PURE__ */ s(e.ResultsItemPreview, { children: [
|
|
125
126
|
/* @__PURE__ */ s(e.ResultsItemPreviewHeader, { children: [
|
|
@@ -154,7 +155,7 @@ function V() {
|
|
|
154
155
|
/* @__PURE__ */ t(e.ResultsScrollAreaCorner, {})
|
|
155
156
|
] });
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function $() {
|
|
158
159
|
return /* @__PURE__ */ t(e.Footer, { children: /* @__PURE__ */ s(e.TaglineContainer, { children: [
|
|
159
160
|
/* @__PURE__ */ t(e.TaglineText, {}),
|
|
160
161
|
/* @__PURE__ */ t(e.TaglineLogo, {}),
|
|
@@ -162,8 +163,8 @@ function O() {
|
|
|
162
163
|
] }) });
|
|
163
164
|
}
|
|
164
165
|
export {
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
M as InkeepEmbeddedSearch,
|
|
167
|
+
f as InkeepEmbeddedSearchImpl,
|
|
167
168
|
P as InkeepEmbeddedSearchImplContent,
|
|
168
|
-
|
|
169
|
+
k as InkeepEmbeddedSearchProvider
|
|
169
170
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(t,n,{checkForDefaultPrevented:r=!0}={}){return function(e){if(t?.(e),r===!1||!e.defaultPrevented)return n?.(e)}}exports.composeEventHandlers=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=f(l);function r(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function s(...e){return t=>{let n=!1;const u=e.map(o=>{const c=r(o,t);return!n&&typeof c=="function"&&(n=!0),c});if(n)return()=>{for(let o=0;o<u.length;o++){const c=u[o];typeof c=="function"?c():r(e[o],null)}}}}function a(...e){return i.useCallback(s(...e),e)}exports.composeRefs=s;exports.useComposedRefs=a;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
function l(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
6
|
+
}
|
|
7
|
+
function i(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = l(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function s(...n) {
|
|
24
|
+
return f.useCallback(i(...n), n);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
i as composeRefs,
|
|
28
|
+
s as useComposedRefs
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),v=require("react/jsx-runtime");function P(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const i=P(C);function j(e,o){const t=i.createContext(o),s=c=>{const{children:n,...r}=c,u=i.useMemo(()=>r,Object.values(r));return v.jsx(t.Provider,{value:u,children:n})};s.displayName=e+"Provider";function a(c){const n=i.useContext(t);if(n)return n;if(o!==void 0)return o;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[s,a]}function g(e,o=[]){let t=[];function s(c,n){const r=i.createContext(n),u=t.length;t=[...t,n];const d=p=>{const{scope:f,children:l,...x}=p,S=f?.[e]?.[u]||r,b=i.useMemo(()=>x,Object.values(x));return v.jsx(S.Provider,{value:b,children:l})};d.displayName=c+"Provider";function m(p,f){const l=f?.[e]?.[u]||r,x=i.useContext(l);if(x)return x;if(n!==void 0)return n;throw new Error(`\`${p}\` must be used within \`${c}\``)}return[d,m]}const a=()=>{const c=t.map(n=>i.createContext(n));return function(r){const u=r?.[e]||c;return i.useMemo(()=>({[`__scope${e}`]:{...r,[e]:u}}),[r,u])}};return a.scopeName=e,[s,_(a,...o)]}function _(...e){const o=e[0];if(e.length===1)return o;const t=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const n=s.reduce((r,{useScope:u,scopeName:d})=>{const p=u(c)[`__scope${d}`];return{...r,...p}},{});return i.useMemo(()=>({[`__scope${o.scopeName}`]:n}),[n])}};return t.scopeName=o.scopeName,t}exports.createContext=j;exports.createContextScope=g;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
+
function $(t, c) {
|
|
4
|
+
const n = u.createContext(c), p = (r) => {
|
|
5
|
+
const { children: e, ...o } = r, s = u.useMemo(() => o, Object.values(o));
|
|
6
|
+
return /* @__PURE__ */ f(n.Provider, { value: s, children: e });
|
|
7
|
+
};
|
|
8
|
+
p.displayName = t + "Provider";
|
|
9
|
+
function i(r) {
|
|
10
|
+
const e = u.useContext(n);
|
|
11
|
+
if (e) return e;
|
|
12
|
+
if (c !== void 0) return c;
|
|
13
|
+
throw new Error(`\`${r}\` must be used within \`${t}\``);
|
|
14
|
+
}
|
|
15
|
+
return [p, i];
|
|
16
|
+
}
|
|
17
|
+
function w(t, c = []) {
|
|
18
|
+
let n = [];
|
|
19
|
+
function p(r, e) {
|
|
20
|
+
const o = u.createContext(e), s = n.length;
|
|
21
|
+
n = [...n, e];
|
|
22
|
+
const d = (x) => {
|
|
23
|
+
const { scope: m, children: v, ...a } = x, S = m?.[t]?.[s] || o, h = u.useMemo(() => a, Object.values(a));
|
|
24
|
+
return /* @__PURE__ */ f(S.Provider, { value: h, children: v });
|
|
25
|
+
};
|
|
26
|
+
d.displayName = r + "Provider";
|
|
27
|
+
function C(x, m) {
|
|
28
|
+
const v = m?.[t]?.[s] || o, a = u.useContext(v);
|
|
29
|
+
if (a) return a;
|
|
30
|
+
if (e !== void 0) return e;
|
|
31
|
+
throw new Error(`\`${x}\` must be used within \`${r}\``);
|
|
32
|
+
}
|
|
33
|
+
return [d, C];
|
|
34
|
+
}
|
|
35
|
+
const i = () => {
|
|
36
|
+
const r = n.map((e) => u.createContext(e));
|
|
37
|
+
return function(o) {
|
|
38
|
+
const s = o?.[t] || r;
|
|
39
|
+
return u.useMemo(
|
|
40
|
+
() => ({ [`__scope${t}`]: { ...o, [t]: s } }),
|
|
41
|
+
[o, s]
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
return i.scopeName = t, [p, P(i, ...c)];
|
|
46
|
+
}
|
|
47
|
+
function P(...t) {
|
|
48
|
+
const c = t[0];
|
|
49
|
+
if (t.length === 1) return c;
|
|
50
|
+
const n = () => {
|
|
51
|
+
const p = t.map((i) => ({
|
|
52
|
+
useScope: i(),
|
|
53
|
+
scopeName: i.scopeName
|
|
54
|
+
}));
|
|
55
|
+
return function(r) {
|
|
56
|
+
const e = p.reduce((o, { useScope: s, scopeName: d }) => {
|
|
57
|
+
const x = s(r)[`__scope${d}`];
|
|
58
|
+
return { ...o, ...x };
|
|
59
|
+
}, {});
|
|
60
|
+
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: e }), [e]);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
return n.scopeName = c.scopeName, n;
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
$ as createContext,
|
|
67
|
+
w as createContextScope
|
|
68
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react"),f=require("../../../../../@radix-ui_primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.cjs"),C=require("../../../../../@radix-ui_react-compose-refs@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs"),I=require("../../../../../@radix-ui_react-context@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-context/dist/index.cjs"),x=require("../../../../../@radix-ui_react-id@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-id/dist/index.cjs"),B=require("@radix-ui/react-use-controllable-state"),U=require("../../../../../@radix-ui_react-dismissable-layer@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types__v2z2flytqizqloot5tnzsv72ca/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs"),V=require("../../../../../@radix-ui_react-focus-scope@1.1.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@_jnpeo7zp526zce4fsmzkscleui/node_modules/@radix-ui/react-focus-scope/dist/index.cjs"),z=require("../../../../../@radix-ui_react-portal@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19.0._k6mvjumazun2buzo2dcp22wl2y/node_modules/@radix-ui/react-portal/dist/index.cjs"),R=require("../../../../../@radix-ui_react-presence@1.1.2_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19._ceqn6mtlqa4vrghvmtsw5zpqya/node_modules/@radix-ui/react-presence/dist/index.cjs"),p=require("../../../../../@radix-ui_react-primitive@2.0.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19_zjcik7jr4zh3druglzeqejtmrq/node_modules/@radix-ui/react-primitive/dist/index.cjs"),K=require("../../../../../@radix-ui_react-focus-guards@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-focus-guards/dist/index.cjs"),Y=require("../../../../../react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/Combination.cjs"),Z=require("../../../../../aria-hidden@1.2.4/node_modules/aria-hidden/dist/es2015/index.cjs"),J=require("../../../../../@radix-ui_react-slot@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.cjs"),a=require("react/jsx-runtime");function Q(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=Q(H);var P="Dialog",[j,X]=I.createContextScope(P),[ee,u]=j(P),_=e=>{const{__scopeDialog:t,children:o,open:r,defaultOpen:i,onOpenChange:n,modal:l=!0}=e,c=s.useRef(null),g=s.useRef(null),[v=!1,m]=B.useControllableState({prop:r,defaultProp:i,onChange:n});return a.jsx(ee,{scope:t,triggerRef:c,contentRef:g,contentId:x.useId(),titleId:x.useId(),descriptionId:x.useId(),open:v,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(L=>!L),[m]),modal:l,children:o})};_.displayName=P;var T="DialogTrigger",A=s.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,i=u(T,o),n=C.useComposedRefs(t,i.triggerRef);return a.jsx(p.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":N(i.open),...r,ref:n,onClick:f.composeEventHandlers(e.onClick,i.onOpenToggle)})});A.displayName=T;var y="DialogPortal",[te,M]=j(y,{forceMount:void 0}),E=e=>{const{__scopeDialog:t,forceMount:o,children:r,container:i}=e,n=u(y,t);return a.jsx(te,{scope:t,forceMount:o,children:s.Children.map(r,l=>a.jsx(R.Presence,{present:o||n.open,children:a.jsx(z.Portal,{asChild:!0,container:i,children:l})}))})};E.displayName=y;var D="DialogOverlay",O=s.forwardRef((e,t)=>{const o=M(D,e.__scopeDialog),{forceMount:r=o.forceMount,...i}=e,n=u(D,e.__scopeDialog);return n.modal?a.jsx(R.Presence,{present:r||n.open,children:a.jsx(oe,{...i,ref:t})}):null});O.displayName=D;var oe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,i=u(D,o);return a.jsx(Y.default,{as:J.Slot,allowPinchZoom:!0,shards:[i.contentRef],children:a.jsx(p.Primitive.div,{"data-state":N(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),d="DialogContent",h=s.forwardRef((e,t)=>{const o=M(d,e.__scopeDialog),{forceMount:r=o.forceMount,...i}=e,n=u(d,e.__scopeDialog);return a.jsx(R.Presence,{present:r||n.open,children:n.modal?a.jsx(ne,{...i,ref:t}):a.jsx(re,{...i,ref:t})})});h.displayName=d;var ne=s.forwardRef((e,t)=>{const o=u(d,e.__scopeDialog),r=s.useRef(null),i=C.useComposedRefs(t,o.contentRef,r);return s.useEffect(()=>{const n=r.current;if(n)return Z.hideOthers(n)},[]),a.jsx(S,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:f.composeEventHandlers(e.onCloseAutoFocus,n=>{n.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:f.composeEventHandlers(e.onPointerDownOutside,n=>{const l=n.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&n.preventDefault()}),onFocusOutside:f.composeEventHandlers(e.onFocusOutside,n=>n.preventDefault())})}),re=s.forwardRef((e,t)=>{const o=u(d,e.__scopeDialog),r=s.useRef(!1),i=s.useRef(!1);return a.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(r.current||o.triggerRef.current?.focus(),n.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(r.current=!0,n.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=n.target;o.triggerRef.current?.contains(l)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&i.current&&n.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:n,...l}=e,c=u(d,o),g=s.useRef(null),v=C.useComposedRefs(t,g);return K.useFocusGuards(),a.jsxs(a.Fragment,{children:[a.jsx(V.FocusScope,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:n,children:a.jsx(U.DismissableLayer,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":N(c.open),...l,ref:v,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(ae,{titleId:c.titleId}),a.jsx(ce,{contentRef:g,descriptionId:c.descriptionId})]})]})}),b="DialogTitle",w=s.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,i=u(b,o);return a.jsx(p.Primitive.h2,{id:i.titleId,...r,ref:t})});w.displayName=b;var F="DialogDescription",q=s.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,i=u(F,o);return a.jsx(p.Primitive.p,{id:i.descriptionId,...r,ref:t})});q.displayName=F;var $="DialogClose",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,i=u($,o);return a.jsx(p.Primitive.button,{type:"button",...r,ref:t,onClick:f.composeEventHandlers(e.onClick,()=>i.onOpenChange(!1))})});W.displayName=$;function N(e){return e?"open":"closed"}var k="DialogTitleWarning",[ie,G]=I.createContext(k,{contentName:d,titleName:b,docsSlug:"dialog"}),ae=({titleId:e})=>{const t=G(k),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},se="DialogDescriptionWarning",ce=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(se).contentName}}.`;return s.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},le=_,ue=E,de=O,ge=h;exports.Content=ge;exports.Dialog=_;exports.DialogClose=W;exports.DialogContent=h;exports.DialogDescription=q;exports.DialogOverlay=O;exports.DialogPortal=E;exports.DialogTitle=w;exports.DialogTrigger=A;exports.Overlay=de;exports.Portal=ue;exports.Root=le;exports.WarningProvider=ie;exports.createDialogScope=X;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { composeEventHandlers as p } from "../../../../../@radix-ui_primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.js";
|
|
3
|
+
import { useComposedRefs as R } from "../../../../../@radix-ui_react-compose-refs@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.js";
|
|
4
|
+
import { createContextScope as $, createContext as B } from "../../../../../@radix-ui_react-context@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-context/dist/index.js";
|
|
5
|
+
import { useId as C } from "../../../../../@radix-ui_react-id@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-id/dist/index.js";
|
|
6
|
+
import { useControllableState as j } from "@radix-ui/react-use-controllable-state";
|
|
7
|
+
import { DismissableLayer as H } from "../../../../../@radix-ui_react-dismissable-layer@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types__v2z2flytqizqloot5tnzsv72ca/node_modules/@radix-ui/react-dismissable-layer/dist/index.js";
|
|
8
|
+
import { FocusScope as V } from "../../../../../@radix-ui_react-focus-scope@1.1.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@_jnpeo7zp526zce4fsmzkscleui/node_modules/@radix-ui/react-focus-scope/dist/index.js";
|
|
9
|
+
import { Portal as q } from "../../../../../@radix-ui_react-portal@1.1.3_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19.0._k6mvjumazun2buzo2dcp22wl2y/node_modules/@radix-ui/react-portal/dist/index.js";
|
|
10
|
+
import { Presence as _ } from "../../../../../@radix-ui_react-presence@1.1.2_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19._ceqn6mtlqa4vrghvmtsw5zpqya/node_modules/@radix-ui/react-presence/dist/index.js";
|
|
11
|
+
import { Primitive as g } from "../../../../../@radix-ui_react-primitive@2.0.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19_zjcik7jr4zh3druglzeqejtmrq/node_modules/@radix-ui/react-primitive/dist/index.js";
|
|
12
|
+
import { useFocusGuards as K } from "../../../../../@radix-ui_react-focus-guards@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-focus-guards/dist/index.js";
|
|
13
|
+
import U from "../../../../../react-remove-scroll@2.6.3_@types_react@19.0.10_react@19.0.0/node_modules/react-remove-scroll/dist/es2015/Combination.js";
|
|
14
|
+
import { hideOthers as Y } from "../../../../../aria-hidden@1.2.4/node_modules/aria-hidden/dist/es2015/index.js";
|
|
15
|
+
import { Slot as Z } from "../../../../../@radix-ui_react-slot@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.js";
|
|
16
|
+
import { jsx as i, jsxs as y, Fragment as I } from "react/jsx-runtime";
|
|
17
|
+
var h = "Dialog", [O, Ne] = $(h), [z, u] = O(h), x = (e) => {
|
|
18
|
+
const {
|
|
19
|
+
__scopeDialog: t,
|
|
20
|
+
children: n,
|
|
21
|
+
open: a,
|
|
22
|
+
defaultOpen: r,
|
|
23
|
+
onOpenChange: o,
|
|
24
|
+
modal: l = !0
|
|
25
|
+
} = e, c = s.useRef(null), f = s.useRef(null), [D = !1, v] = j({
|
|
26
|
+
prop: a,
|
|
27
|
+
defaultProp: r,
|
|
28
|
+
onChange: o
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ i(
|
|
31
|
+
z,
|
|
32
|
+
{
|
|
33
|
+
scope: t,
|
|
34
|
+
triggerRef: c,
|
|
35
|
+
contentRef: f,
|
|
36
|
+
contentId: C(),
|
|
37
|
+
titleId: C(),
|
|
38
|
+
descriptionId: C(),
|
|
39
|
+
open: D,
|
|
40
|
+
onOpenChange: v,
|
|
41
|
+
onOpenToggle: s.useCallback(() => v((L) => !L), [v]),
|
|
42
|
+
modal: l,
|
|
43
|
+
children: n
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
x.displayName = h;
|
|
48
|
+
var A = "DialogTrigger", J = s.forwardRef(
|
|
49
|
+
(e, t) => {
|
|
50
|
+
const { __scopeDialog: n, ...a } = e, r = u(A, n), o = R(t, r.triggerRef);
|
|
51
|
+
return /* @__PURE__ */ i(
|
|
52
|
+
g.button,
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
"aria-haspopup": "dialog",
|
|
56
|
+
"aria-expanded": r.open,
|
|
57
|
+
"aria-controls": r.contentId,
|
|
58
|
+
"data-state": P(r.open),
|
|
59
|
+
...a,
|
|
60
|
+
ref: o,
|
|
61
|
+
onClick: p(e.onClick, r.onOpenToggle)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
J.displayName = A;
|
|
67
|
+
var E = "DialogPortal", [Q, b] = O(E, {
|
|
68
|
+
forceMount: void 0
|
|
69
|
+
}), T = (e) => {
|
|
70
|
+
const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(E, t);
|
|
71
|
+
return /* @__PURE__ */ i(Q, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i(_, { present: n || o.open, children: /* @__PURE__ */ i(q, { asChild: !0, container: r, children: l }) })) });
|
|
72
|
+
};
|
|
73
|
+
T.displayName = E;
|
|
74
|
+
var m = "DialogOverlay", M = s.forwardRef(
|
|
75
|
+
(e, t) => {
|
|
76
|
+
const n = b(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
|
|
77
|
+
return o.modal ? /* @__PURE__ */ i(_, { present: a || o.open, children: /* @__PURE__ */ i(X, { ...r, ref: t }) }) : null;
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
M.displayName = m;
|
|
81
|
+
var X = s.forwardRef(
|
|
82
|
+
(e, t) => {
|
|
83
|
+
const { __scopeDialog: n, ...a } = e, r = u(m, n);
|
|
84
|
+
return (
|
|
85
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
86
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
87
|
+
/* @__PURE__ */ i(U, { as: Z, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
88
|
+
g.div,
|
|
89
|
+
{
|
|
90
|
+
"data-state": P(r.open),
|
|
91
|
+
...a,
|
|
92
|
+
ref: t,
|
|
93
|
+
style: { pointerEvents: "auto", ...a.style }
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
), d = "DialogContent", w = s.forwardRef(
|
|
99
|
+
(e, t) => {
|
|
100
|
+
const n = b(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
|
|
101
|
+
return /* @__PURE__ */ i(_, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(ee, { ...r, ref: t }) : /* @__PURE__ */ i(oe, { ...r, ref: t }) });
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
w.displayName = d;
|
|
105
|
+
var ee = s.forwardRef(
|
|
106
|
+
(e, t) => {
|
|
107
|
+
const n = u(d, e.__scopeDialog), a = s.useRef(null), r = R(t, n.contentRef, a);
|
|
108
|
+
return s.useEffect(() => {
|
|
109
|
+
const o = a.current;
|
|
110
|
+
if (o) return Y(o);
|
|
111
|
+
}, []), /* @__PURE__ */ i(
|
|
112
|
+
F,
|
|
113
|
+
{
|
|
114
|
+
...e,
|
|
115
|
+
ref: r,
|
|
116
|
+
trapFocus: n.open,
|
|
117
|
+
disableOutsidePointerEvents: !0,
|
|
118
|
+
onCloseAutoFocus: p(e.onCloseAutoFocus, (o) => {
|
|
119
|
+
o.preventDefault(), n.triggerRef.current?.focus();
|
|
120
|
+
}),
|
|
121
|
+
onPointerDownOutside: p(e.onPointerDownOutside, (o) => {
|
|
122
|
+
const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
|
|
123
|
+
(l.button === 2 || c) && o.preventDefault();
|
|
124
|
+
}),
|
|
125
|
+
onFocusOutside: p(
|
|
126
|
+
e.onFocusOutside,
|
|
127
|
+
(o) => o.preventDefault()
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
), oe = s.forwardRef(
|
|
133
|
+
(e, t) => {
|
|
134
|
+
const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
135
|
+
return /* @__PURE__ */ i(
|
|
136
|
+
F,
|
|
137
|
+
{
|
|
138
|
+
...e,
|
|
139
|
+
ref: t,
|
|
140
|
+
trapFocus: !1,
|
|
141
|
+
disableOutsidePointerEvents: !1,
|
|
142
|
+
onCloseAutoFocus: (o) => {
|
|
143
|
+
e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
|
|
144
|
+
},
|
|
145
|
+
onInteractOutside: (o) => {
|
|
146
|
+
e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
147
|
+
const l = o.target;
|
|
148
|
+
n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
), F = s.forwardRef(
|
|
154
|
+
(e, t) => {
|
|
155
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), D = R(t, f);
|
|
156
|
+
return K(), /* @__PURE__ */ y(I, { children: [
|
|
157
|
+
/* @__PURE__ */ i(
|
|
158
|
+
V,
|
|
159
|
+
{
|
|
160
|
+
asChild: !0,
|
|
161
|
+
loop: !0,
|
|
162
|
+
trapped: a,
|
|
163
|
+
onMountAutoFocus: r,
|
|
164
|
+
onUnmountAutoFocus: o,
|
|
165
|
+
children: /* @__PURE__ */ i(
|
|
166
|
+
H,
|
|
167
|
+
{
|
|
168
|
+
role: "dialog",
|
|
169
|
+
id: c.contentId,
|
|
170
|
+
"aria-describedby": c.descriptionId,
|
|
171
|
+
"aria-labelledby": c.titleId,
|
|
172
|
+
"data-state": P(c.open),
|
|
173
|
+
...l,
|
|
174
|
+
ref: D,
|
|
175
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ y(I, { children: [
|
|
181
|
+
/* @__PURE__ */ i(ae, { titleId: c.titleId }),
|
|
182
|
+
/* @__PURE__ */ i(se, { contentRef: f, descriptionId: c.descriptionId })
|
|
183
|
+
] })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
), N = "DialogTitle", te = s.forwardRef(
|
|
187
|
+
(e, t) => {
|
|
188
|
+
const { __scopeDialog: n, ...a } = e, r = u(N, n);
|
|
189
|
+
return /* @__PURE__ */ i(g.h2, { id: r.titleId, ...a, ref: t });
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
te.displayName = N;
|
|
193
|
+
var S = "DialogDescription", re = s.forwardRef(
|
|
194
|
+
(e, t) => {
|
|
195
|
+
const { __scopeDialog: n, ...a } = e, r = u(S, n);
|
|
196
|
+
return /* @__PURE__ */ i(g.p, { id: r.descriptionId, ...a, ref: t });
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
re.displayName = S;
|
|
200
|
+
var W = "DialogClose", ne = s.forwardRef(
|
|
201
|
+
(e, t) => {
|
|
202
|
+
const { __scopeDialog: n, ...a } = e, r = u(W, n);
|
|
203
|
+
return /* @__PURE__ */ i(
|
|
204
|
+
g.button,
|
|
205
|
+
{
|
|
206
|
+
type: "button",
|
|
207
|
+
...a,
|
|
208
|
+
ref: t,
|
|
209
|
+
onClick: p(e.onClick, () => r.onOpenChange(!1))
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
ne.displayName = W;
|
|
215
|
+
function P(e) {
|
|
216
|
+
return e ? "open" : "closed";
|
|
217
|
+
}
|
|
218
|
+
var k = "DialogTitleWarning", [Pe, G] = B(k, {
|
|
219
|
+
contentName: d,
|
|
220
|
+
titleName: N,
|
|
221
|
+
docsSlug: "dialog"
|
|
222
|
+
}), ae = ({ titleId: e }) => {
|
|
223
|
+
const t = G(k), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
224
|
+
|
|
225
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
226
|
+
|
|
227
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
228
|
+
return s.useEffect(() => {
|
|
229
|
+
e && (document.getElementById(e) || console.error(n));
|
|
230
|
+
}, [n, e]), null;
|
|
231
|
+
}, ie = "DialogDescriptionWarning", se = ({ contentRef: e, descriptionId: t }) => {
|
|
232
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ie).contentName}}.`;
|
|
233
|
+
return s.useEffect(() => {
|
|
234
|
+
const r = e.current?.getAttribute("aria-describedby");
|
|
235
|
+
t && r && (document.getElementById(t) || console.warn(a));
|
|
236
|
+
}, [a, e, t]), null;
|
|
237
|
+
}, ye = x, Ie = T, Oe = M, xe = w;
|
|
238
|
+
export {
|
|
239
|
+
xe as Content,
|
|
240
|
+
x as Dialog,
|
|
241
|
+
ne as DialogClose,
|
|
242
|
+
w as DialogContent,
|
|
243
|
+
re as DialogDescription,
|
|
244
|
+
M as DialogOverlay,
|
|
245
|
+
T as DialogPortal,
|
|
246
|
+
te as DialogTitle,
|
|
247
|
+
J as DialogTrigger,
|
|
248
|
+
Oe as Overlay,
|
|
249
|
+
Ie as Portal,
|
|
250
|
+
ye as Root,
|
|
251
|
+
Pe as WarningProvider,
|
|
252
|
+
Ne as createDialogScope
|
|
253
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),b=require("../../../../../@radix-ui_primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.cjs"),m=require("../../../../../@radix-ui_react-primitive@2.0.1_@types_react-dom@19.0.3_@types_react@19.0.10__@types_react@19_zjcik7jr4zh3druglzeqejtmrq/node_modules/@radix-ui/react-primitive/dist/index.cjs"),R=require("../../../../../@radix-ui_react-compose-refs@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs"),w=require("../../../../../@radix-ui_react-use-callback-ref@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs"),H=require("../../../../../@radix-ui_react-use-escape-keydown@1.1.0_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs"),x=require("react/jsx-runtime");function U(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=U(q);var z="DismissableLayer",h="dismissableLayer.update",M="dismissableLayer.pointerDownOutside",$="dismissableLayer.focusOutside",L,T=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:f,onDismiss:d,...v}=e,a=i.useContext(T),[u,I]=i.useState(null),l=u?.ownerDocument??globalThis?.document,[,N]=i.useState({}),W=R.useComposedRefs(t,s=>I(s)),p=Array.from(a.layers),[_]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),A=p.indexOf(_),D=u?p.indexOf(u):-1,j=a.layersWithOutsidePointerEventsDisabled.size>0,O=D>=A,k=X(s=>{const E=s.target,C=[...a.branches].some(y=>y.contains(E));!O||C||(o?.(s),f?.(s),s.defaultPrevented||d?.())},l),P=Y(s=>{const E=s.target;[...a.branches].some(y=>y.contains(E))||(c?.(s),f?.(s),s.defaultPrevented||d?.())},l);return H.useEscapeKeydown(s=>{D===a.layers.size-1&&(r?.(s),!s.defaultPrevented&&d&&(s.preventDefault(),d()))},l),i.useEffect(()=>{if(u)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(L=l.body.style.pointerEvents,l.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(u)),a.layers.add(u),g(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(l.body.style.pointerEvents=L)}},[u,l,n,a]),i.useEffect(()=>()=>{u&&(a.layers.delete(u),a.layersWithOutsidePointerEventsDisabled.delete(u),g())},[u,a]),i.useEffect(()=>{const s=()=>N({});return document.addEventListener(h,s),()=>document.removeEventListener(h,s)},[]),x.jsx(m.Primitive.div,{...v,ref:W,style:{pointerEvents:j?O?"auto":"none":void 0,...e.style},onFocusCapture:b.composeEventHandlers(e.onFocusCapture,P.onFocusCapture),onBlurCapture:b.composeEventHandlers(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:b.composeEventHandlers(e.onPointerDownCapture,k.onPointerDownCapture)})});S.displayName=z;var K="DismissableLayerBranch",B=i.forwardRef((e,t)=>{const n=i.useContext(T),r=i.useRef(null),o=R.useComposedRefs(t,r);return i.useEffect(()=>{const c=r.current;if(c)return n.branches.add(c),()=>{n.branches.delete(c)}},[n.branches]),x.jsx(m.Primitive.div,{...e,ref:o})});B.displayName=K;function X(e,t=globalThis?.document){const n=w.useCallbackRef(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const c=d=>{if(d.target&&!r.current){let v=function(){F(M,n,a,{discrete:!0})};const a={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=v,t.addEventListener("click",o.current,{once:!0})):v()}else t.removeEventListener("click",o.current);r.current=!1},f=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(f),t.removeEventListener("pointerdown",c),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Y(e,t=globalThis?.document){const n=w.useCallbackRef(e),r=i.useRef(!1);return i.useEffect(()=>{const o=c=>{c.target&&!r.current&&F($,n,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function g(){const e=new CustomEvent(h);document.dispatchEvent(e)}function F(e,t,n,{discrete:r}){const o=n.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?m.dispatchDiscreteCustomEvent(o,c):o.dispatchEvent(c)}exports.DismissableLayer=S;exports.DismissableLayerBranch=B;
|