@adamosuiteservices/ui 1.0.0
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/README.md +1 -0
- package/dist/accordion-rounded.cjs +6 -0
- package/dist/accordion-rounded.js +85 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +65 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.js +69 -0
- package/dist/avatar.cjs +17 -0
- package/dist/avatar.js +248 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.js +54 -0
- package/dist/button-BFK0LYE1.js +58 -0
- package/dist/button-BnuVhhWO.cjs +1 -0
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.js +76 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +5 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +2852 -0
- package/dist/card.cjs +1 -0
- package/dist/card.js +112 -0
- package/dist/check-CLxNVljQ.cjs +6 -0
- package/dist/check-Ci0GjV-B.js +11 -0
- package/dist/checkbox-BlfeC4MI.js +271 -0
- package/dist/checkbox-uByYIkZe.cjs +1 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.js +4 -0
- package/dist/chevron-down-BqEHzml5.cjs +6 -0
- package/dist/chevron-down-CpVS2Z7w.js +11 -0
- package/dist/chevron-left-B8QsBNvc.cjs +6 -0
- package/dist/chevron-left-Eal-WYLp.js +11 -0
- package/dist/chevron-right-BpzggHsr.cjs +6 -0
- package/dist/chevron-right-Cnc2tB4-.js +11 -0
- package/dist/circle-CX7JIirj.cjs +6 -0
- package/dist/circle-DYv-7Qb9.js +11 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.js +34 -0
- package/dist/colors.css +1 -0
- package/dist/combobox.cjs +6 -0
- package/dist/combobox.js +515 -0
- package/dist/components/layout/sidebar/index.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +17 -0
- package/dist/components/layout/sidebar/sidebar.stories.d.ts +6 -0
- package/dist/components/layout/toaster/index.d.ts +2 -0
- package/dist/components/layout/toaster/toaster.d.ts +26 -0
- package/dist/components/layout/toaster/toaster.stories.d.ts +15 -0
- package/dist/components/layout/toaster/use-toast.d.ts +1 -0
- package/dist/components/ui/accordion/accordion.d.ts +7 -0
- package/dist/components/ui/accordion/accordion.stories.d.ts +17 -0
- package/dist/components/ui/accordion/index.d.ts +1 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.d.ts +11 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.stories.d.ts +21 -0
- package/dist/components/ui/accordion-rounded/index.d.ts +1 -0
- package/dist/components/ui/alert/alert.d.ts +9 -0
- package/dist/components/ui/alert/alert.stories.d.ts +24 -0
- package/dist/components/ui/alert/index.d.ts +1 -0
- package/dist/components/ui/avatar/avatar.d.ts +6 -0
- package/dist/components/ui/avatar/avatar.stories.d.ts +14 -0
- package/dist/components/ui/avatar/index.d.ts +1 -0
- package/dist/components/ui/badge/badge.d.ts +10 -0
- package/dist/components/ui/badge/badge.stories.d.ts +41 -0
- package/dist/components/ui/badge/index.d.ts +1 -0
- package/dist/components/ui/button/button.d.ts +10 -0
- package/dist/components/ui/button/button.stories.d.ts +38 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/button-group/button-group.stories.d.ts +19 -0
- package/dist/components/ui/button-group/index.d.ts +1 -0
- package/dist/components/ui/calendar/calendar.d.ts +8 -0
- package/dist/components/ui/calendar/calendar.stories.d.ts +27 -0
- package/dist/components/ui/calendar/index.d.ts +1 -0
- package/dist/components/ui/card/card.d.ts +13 -0
- package/dist/components/ui/card/card.stories.d.ts +18 -0
- package/dist/components/ui/card/index.d.ts +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox/checkbox.stories.d.ts +15 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/collapsible/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible/collapsible.stories.d.ts +12 -0
- package/dist/components/ui/collapsible/index.d.ts +1 -0
- package/dist/components/ui/combobox/combobox.d.ts +35 -0
- package/dist/components/ui/combobox/combobox.stories.d.ts +27 -0
- package/dist/components/ui/combobox/index.d.ts +1 -0
- package/dist/components/ui/command/command.d.ts +18 -0
- package/dist/components/ui/command/index.d.ts +1 -0
- package/dist/components/ui/context-menu/context-menu.d.ts +25 -0
- package/dist/components/ui/context-menu/context-menu.stories.d.ts +10 -0
- package/dist/components/ui/context-menu/index.d.ts +1 -0
- package/dist/components/ui/dialog/dialog.d.ts +17 -0
- package/dist/components/ui/dialog/dialog.stories.d.ts +13 -0
- package/dist/components/ui/dialog/index.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.stories.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/field/field.d.ts +24 -0
- package/dist/components/ui/field/field.stories.d.ts +18 -0
- package/dist/components/ui/field/index.d.ts +1 -0
- package/dist/components/ui/hover-card/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card/hover-card.stories.d.ts +25 -0
- package/dist/components/ui/hover-card/index.d.ts +1 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/input.d.ts +3 -0
- package/dist/components/ui/input/input.stories.d.ts +23 -0
- package/dist/components/ui/input-group/Input-group.stories.d.ts +28 -0
- package/dist/components/ui/input-group/index.d.ts +1 -0
- package/dist/components/ui/input-group/input-group.d.ts +16 -0
- package/dist/components/ui/kbd/index.d.ts +1 -0
- package/dist/components/ui/kbd/kbd.d.ts +3 -0
- package/dist/components/ui/kbd/kbd.stories.d.ts +26 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/label/label.d.ts +4 -0
- package/dist/components/ui/label/label.stories.d.ts +24 -0
- package/dist/components/ui/pagination/index.d.ts +1 -0
- package/dist/components/ui/pagination/pagination.d.ts +13 -0
- package/dist/components/ui/pagination/pagination.stories.d.ts +28 -0
- package/dist/components/ui/popover/index.d.ts +1 -0
- package/dist/components/ui/popover/popover.d.ts +7 -0
- package/dist/components/ui/popover/popover.stories.d.ts +26 -0
- package/dist/components/ui/progress/index.d.ts +1 -0
- package/dist/components/ui/progress/progress.d.ts +9 -0
- package/dist/components/ui/progress/progress.stories.d.ts +29 -0
- package/dist/components/ui/radio-group/index.d.ts +1 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group/radio-group.stories.d.ts +18 -0
- package/dist/components/ui/select/index.d.ts +1 -0
- package/dist/components/ui/select/select.d.ts +15 -0
- package/dist/components/ui/select/select.stories.d.ts +19 -0
- package/dist/components/ui/separator/index.d.ts +1 -0
- package/dist/components/ui/separator/separator.d.ts +4 -0
- package/dist/components/ui/separator/separator.stories.d.ts +18 -0
- package/dist/components/ui/sheet/index.d.ts +1 -0
- package/dist/components/ui/sheet/sheet.d.ts +14 -0
- package/dist/components/ui/sheet/sheet.stories.d.ts +17 -0
- package/dist/components/ui/skeleton/index.d.ts +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton/skeleton.stories.d.ts +22 -0
- package/dist/components/ui/slider/index.d.ts +1 -0
- package/dist/components/ui/slider/slider.d.ts +7 -0
- package/dist/components/ui/slider/slider.stories.d.ts +21 -0
- package/dist/components/ui/spinner/index.d.ts +1 -0
- package/dist/components/ui/spinner/spinner.d.ts +2 -0
- package/dist/components/ui/spinner/spinner.stories.d.ts +20 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/switch/switch.d.ts +4 -0
- package/dist/components/ui/switch/switch.stories.d.ts +17 -0
- package/dist/components/ui/table/index.d.ts +1 -0
- package/dist/components/ui/table/table.d.ts +10 -0
- package/dist/components/ui/table/table.stories.d.ts +11 -0
- package/dist/components/ui/tabs/index.d.ts +1 -0
- package/dist/components/ui/tabs/tabs.d.ts +7 -0
- package/dist/components/ui/tabs/tabs.stories.d.ts +16 -0
- package/dist/components/ui/tabs-underline/index.d.ts +1 -0
- package/dist/components/ui/tabs-underline/tabs-underline.d.ts +7 -0
- package/dist/components/ui/tabs-underline/tabs-underline.stories.d.ts +16 -0
- package/dist/components/ui/textarea/index.d.ts +1 -0
- package/dist/components/ui/textarea/textarea.d.ts +3 -0
- package/dist/components/ui/textarea/textarea.stories.d.ts +21 -0
- package/dist/components/ui/toggle/index.d.ts +1 -0
- package/dist/components/ui/toggle/toggle.d.ts +9 -0
- package/dist/components/ui/toggle/toggle.stories.d.ts +21 -0
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip/tooltip.stories.d.ts +19 -0
- package/dist/components/ui/typography/index.d.ts +1 -0
- package/dist/components/ui/typography/typography.d.ts +8 -0
- package/dist/components/ui/typography/typography.stories.d.ts +33 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.js +427 -0
- package/dist/createLucideIcon-B_8CJpcQ.js +94 -0
- package/dist/createLucideIcon-CAtnV-yz.cjs +21 -0
- package/dist/custom-layered-styles.css +1 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.js +139 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.js +423 -0
- package/dist/field.cjs +1 -0
- package/dist/field.js +221 -0
- package/dist/fonts.css +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-portal-container.d.ts +31 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.js +210 -0
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-6oTEokEx.js +82 -0
- package/dist/index-B-NyefE0.js +243 -0
- package/dist/index-B-ZRqW0J.js +118 -0
- package/dist/index-B-cHTKrs.js +158 -0
- package/dist/index-BGQepRFJ.js +27 -0
- package/dist/index-BGiGvaq8.cjs +1 -0
- package/dist/index-BKbK2GzY.cjs +1 -0
- package/dist/index-BMitW9UR.cjs +1 -0
- package/dist/index-BRLtxFFr.cjs +1 -0
- package/dist/index-BWaO7kQK.cjs +1 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BpvjJ_T6.cjs +5 -0
- package/dist/index-C0UREtMP.js +59 -0
- package/dist/index-C329e3yQ.js +134 -0
- package/dist/index-C5wjudc-.js +36 -0
- package/dist/index-C8ni3LLa.cjs +1 -0
- package/dist/index-CAOY367Y.js +1540 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/index-CQhYMnjT.js +34 -0
- package/dist/index-Ce3QBKyj.cjs +1 -0
- package/dist/index-CezwiPd_.js +615 -0
- package/dist/index-Cv867SGx.js +13 -0
- package/dist/index-CwUFT-GQ.js +228 -0
- package/dist/index-CzY-WZXL.cjs +1 -0
- package/dist/index-D02K8KOB.js +54 -0
- package/dist/index-D3S7dBDI.cjs +1 -0
- package/dist/index-D3wSWKST.cjs +1 -0
- package/dist/index-D7hQvndv.cjs +1 -0
- package/dist/index-DQvx1rG_.cjs +1 -0
- package/dist/index-DXQ-7kNJ.cjs +41 -0
- package/dist/index-DYxWvftI.cjs +1 -0
- package/dist/index-DnS_sBBe.cjs +1 -0
- package/dist/index-DulPG3F9.js +179 -0
- package/dist/index-EUea2gfp.js +70 -0
- package/dist/index-FxyLF8MY.js +68 -0
- package/dist/index-IKJMQref.cjs +1 -0
- package/dist/index-MQ0c3ZX_.cjs +1 -0
- package/dist/index-P1sVIHE3.js +32 -0
- package/dist/index-VIUqZjyP.cjs +1 -0
- package/dist/index-WIv2ndLu.cjs +1 -0
- package/dist/index-bSPhqlcX.cjs +1 -0
- package/dist/index-cwZN7ZY3.cjs +1 -0
- package/dist/index-gO_QEiaK.cjs +1 -0
- package/dist/index-iAvn1gzj.cjs +1 -0
- package/dist/index-o0sNTcKe.js +674 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-yR-v1A4G.js +15 -0
- package/dist/input-3MDa_DYk.cjs +1 -0
- package/dist/input-Cl7xmQYQ.js +22 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.js +152 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +4 -0
- package/dist/jsx-runtime-BB_1_6y_.cjs +22 -0
- package/dist/jsx-runtime-BzflLqGi.js +282 -0
- package/dist/kbd.cjs +1 -0
- package/dist/kbd.js +31 -0
- package/dist/label-MxqN87DQ.cjs +1 -0
- package/dist/label-hg_jN6Y8.js +35 -0
- package/dist/label.cjs +1 -0
- package/dist/label.js +4 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/minus-C0pHPx21.cjs +6 -0
- package/dist/minus-DE-onYs2.js +11 -0
- package/dist/pagination.cjs +6 -0
- package/dist/pagination.js +134 -0
- package/dist/popover-BBXe2myL.cjs +1 -0
- package/dist/popover-DNiRNCdn.js +263 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.js +7 -0
- package/dist/progress.cjs +6 -0
- package/dist/progress.js +137 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.js +271 -0
- package/dist/radius.css +1 -0
- package/dist/select.cjs +6 -0
- package/dist/select.js +987 -0
- package/dist/separator-C9kqOQR-.js +44 -0
- package/dist/separator-Dbx-SVIs.cjs +1 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.js +4 -0
- package/dist/sheet-0jRbqkzj.cjs +1 -0
- package/dist/sheet-RAbg4M5A.js +128 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.js +11 -0
- package/dist/sidebar.cjs +6 -0
- package/dist/sidebar.js +139 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.js +486 -0
- package/dist/space.css +1 -0
- package/dist/spinner.cjs +6 -0
- package/dist/spinner.js +24 -0
- package/dist/styles.css +1 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +154 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +115 -0
- package/dist/tabs-underline.cjs +1 -0
- package/dist/tabs-underline.js +68 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.js +68 -0
- package/dist/tailwind-animations.css +1 -0
- package/dist/tailwind-colors.css +1 -0
- package/dist/tailwind-fonts.css +1 -0
- package/dist/tailwind-radius.css +1 -0
- package/dist/tailwind-spacing.css +1 -0
- package/dist/tailwind-theme.css +1 -0
- package/dist/textarea-D76719tg.js +19 -0
- package/dist/textarea-UdELO_Jn.cjs +1 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.js +4 -0
- package/dist/themes.css +1 -0
- package/dist/toaster.cjs +1 -0
- package/dist/toaster.js +87 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.js +69 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.js +375 -0
- package/dist/types/theme.type.d.ts +2 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +34 -0
- package/dist/use-portal-container.cjs +1 -0
- package/dist/use-portal-container.js +21 -0
- package/dist/utils-CRiPKpXj.js +2743 -0
- package/dist/utils-DoxiiusW.cjs +1 -0
- package/dist/x-CBKgg4YL.cjs +6 -0
- package/dist/x-Dl66o_vF.js +14 -0
- package/package.json +275 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-portal-container';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface UsePortalContainerOptions {
|
|
2
|
+
/** Maximum number of attempts to find the element (default: 100) */
|
|
3
|
+
maxAttempts?: number;
|
|
4
|
+
/** Whether to log a warning if element is not found (default: true) */
|
|
5
|
+
logWarning?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Hook to find and return a DOM element for portal rendering.
|
|
9
|
+
* Useful when the target container might not be immediately available in the DOM.
|
|
10
|
+
*
|
|
11
|
+
* @param selector - CSS selector string to find the target element
|
|
12
|
+
* @param options - Configuration options
|
|
13
|
+
* @returns The found HTMLElement or null if not found
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const container = usePortalContainer("[data-slot='sidebar-topbar']");
|
|
18
|
+
*
|
|
19
|
+
* return (
|
|
20
|
+
* <>
|
|
21
|
+
* {container && (
|
|
22
|
+
* <Portal container={container}>
|
|
23
|
+
* <div>Portal content</div>
|
|
24
|
+
* </Portal>
|
|
25
|
+
* )}
|
|
26
|
+
* </>
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function usePortalContainer(selector: string, options?: UsePortalContainerOptions): HTMLElement | null;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-BB_1_6y_.cjs"),q=require("react"),l=require("./index-BWaO7kQK.cjs"),L=require("./index-cwZN7ZY3.cjs"),k=require("./index-BKbK2GzY.cjs"),f=require("./index-BGiGvaq8.cjs"),$=require("./index-Ce3QBKyj.cjs"),w=require("./index-IKJMQref.cjs"),F=require("./index-DQvx1rG_.cjs"),I=require("./index-VIUqZjyP.cjs"),U=require("./utils-DoxiiusW.cjs");function z(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const a=z(q);var H,P="HoverCard",[T]=L.createContextScope(P,[f.createPopperScope]),b=f.createPopperScope(),[W,j]=T(P),O=e=>{const{__scopeHoverCard:t,children:r,open:n,defaultOpen:i,onOpenChange:c,openDelay:m=700,closeDelay:v=300}=e,d=b(t),x=a.useRef(0),u=a.useRef(0),C=a.useRef(!1),p=a.useRef(!1),[h,o]=l.useControllableState({prop:n,defaultProp:i??!1,onChange:c,caller:P}),R=a.useCallback(()=>{clearTimeout(u.current),x.current=window.setTimeout(()=>o(!0),m)},[m,o]),A=a.useCallback(()=>{clearTimeout(x.current),!C.current&&!p.current&&(u.current=window.setTimeout(()=>o(!1),v))},[v,o]),M=a.useCallback(()=>o(!1),[o]);return a.useEffect(()=>()=>{clearTimeout(x.current),clearTimeout(u.current)},[]),s.jsxRuntimeExports.jsx(W,{scope:t,open:h,onOpenChange:o,onOpen:R,onClose:A,onDismiss:M,hasSelectionRef:C,isPointerDownOnContentRef:p,children:s.jsxRuntimeExports.jsx(f.Root2,{...d,children:r})})};O.displayName=P;var y="HoverCardTrigger",_=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...n}=e,i=j(y,r),c=b(r);return s.jsxRuntimeExports.jsx(f.Anchor,{asChild:!0,...c,children:s.jsxRuntimeExports.jsx(F.Primitive.a,{"data-state":i.open?"open":"closed",...n,ref:t,onPointerEnter:l.composeEventHandlers(e.onPointerEnter,g(i.onOpen)),onPointerLeave:l.composeEventHandlers(e.onPointerLeave,g(i.onClose)),onFocus:l.composeEventHandlers(e.onFocus,i.onOpen),onBlur:l.composeEventHandlers(e.onBlur,i.onClose),onTouchStart:l.composeEventHandlers(e.onTouchStart,m=>m.preventDefault())})})});_.displayName=y;var S="HoverCardPortal",[B,G]=T(S,{forceMount:void 0}),N=e=>{const{__scopeHoverCard:t,forceMount:r,children:n,container:i}=e,c=j(S,t);return s.jsxRuntimeExports.jsx(B,{scope:t,forceMount:r,children:s.jsxRuntimeExports.jsx(w.Presence,{present:r||c.open,children:s.jsxRuntimeExports.jsx($.Portal,{asChild:!0,container:i,children:n})})})};N.displayName=S;var E="HoverCardContent",D=a.forwardRef((e,t)=>{const r=G(E,e.__scopeHoverCard),{forceMount:n=r.forceMount,...i}=e,c=j(E,e.__scopeHoverCard);return s.jsxRuntimeExports.jsx(w.Presence,{present:n||c.open,children:s.jsxRuntimeExports.jsx(K,{"data-state":c.open?"open":"closed",...i,onPointerEnter:l.composeEventHandlers(e.onPointerEnter,g(c.onOpen)),onPointerLeave:l.composeEventHandlers(e.onPointerLeave,g(c.onClose)),ref:t})})});D.displayName=E;var K=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:m,...v}=e,d=j(E,r),x=b(r),u=a.useRef(null),C=k.useComposedRefs(t,u),[p,h]=a.useState(!1);return a.useEffect(()=>{if(p){const o=document.body;return H=o.style.userSelect||o.style.webkitUserSelect,o.style.userSelect="none",o.style.webkitUserSelect="none",()=>{o.style.userSelect=H,o.style.webkitUserSelect=H}}},[p]),a.useEffect(()=>{if(u.current){const o=()=>{h(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",o),()=>{document.removeEventListener("pointerup",o),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),a.useEffect(()=>{u.current&&Q(u.current).forEach(R=>R.setAttribute("tabindex","-1"))}),s.jsxRuntimeExports.jsx(I.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:m,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:l.composeEventHandlers(c,o=>{o.preventDefault()}),onDismiss:d.onDismiss,children:s.jsxRuntimeExports.jsx(f.Content,{...x,...v,onPointerDown:l.composeEventHandlers(v.onPointerDown,o=>{o.currentTarget.contains(o.target)&&h(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:C,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),V="HoverCardArrow",J=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...n}=e,i=b(r);return s.jsxRuntimeExports.jsx(f.Arrow,{...i,...n,ref:t})});J.displayName=V;function g(e){return t=>t.pointerType==="touch"?void 0:e()}function Q(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}var X=O,Y=_,Z=N,ee=D;function te({...e}){return s.jsxRuntimeExports.jsx(X,{"data-slot":"hover-card",...e})}function re({...e}){return s.jsxRuntimeExports.jsx(Y,{"data-slot":"hover-card-trigger",...e})}function oe({className:e,align:t="center",sideOffset:r=4,...n}){return s.jsxRuntimeExports.jsx(Z,{"data-slot":"hover-card-portal",children:s.jsxRuntimeExports.jsx(ee,{"data-slot":"hover-card-content",align:t,sideOffset:r,className:U.cn("adm:bg-popover adm:text-popover-foreground adm:data-[state=open]:animate-in adm:data-[state=closed]:animate-out adm:data-[state=closed]:fade-out-0 adm:data-[state=open]:fade-in-0 adm:data-[state=closed]:zoom-out-95 adm:data-[state=open]:zoom-in-95 adm:data-[side=bottom]:slide-in-from-top-2 adm:data-[side=left]:slide-in-from-right-2 adm:data-[side=right]:slide-in-from-left-2 adm:data-[side=top]:slide-in-from-bottom-2 adm:z-50 adm:w-64 adm:origin-(--radix-hover-card-content-transform-origin) adm:rounded-md adm:border adm:p-4 adm:shadow-md adm:outline-hidden",e),...n})})}exports.HoverCard=te;exports.HoverCardContent=oe;exports.HoverCardTrigger=re;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { j as a } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { u as M, c as l } from "./index-C0UREtMP.js";
|
|
4
|
+
import { c as k } from "./index-FxyLF8MY.js";
|
|
5
|
+
import { u as F } from "./index-6oTEokEx.js";
|
|
6
|
+
import { c as T, R as I, A as U, C as $, a as W } from "./index-CAOY367Y.js";
|
|
7
|
+
import { P as z } from "./index-yR-v1A4G.js";
|
|
8
|
+
import { P as H } from "./index-EUea2gfp.js";
|
|
9
|
+
import { P as B } from "./index-C5wjudc-.js";
|
|
10
|
+
import { D as G } from "./index-C329e3yQ.js";
|
|
11
|
+
import { c as K } from "./utils-CRiPKpXj.js";
|
|
12
|
+
var w, R = "HoverCard", [O] = k(R, [
|
|
13
|
+
T
|
|
14
|
+
]), S = T(), [V, b] = O(R), _ = (e) => {
|
|
15
|
+
const {
|
|
16
|
+
__scopeHoverCard: o,
|
|
17
|
+
children: t,
|
|
18
|
+
open: s,
|
|
19
|
+
defaultOpen: i,
|
|
20
|
+
onOpenChange: c,
|
|
21
|
+
openDelay: f = 700,
|
|
22
|
+
closeDelay: m = 300
|
|
23
|
+
} = e, d = S(o), v = n.useRef(0), u = n.useRef(0), h = n.useRef(!1), p = n.useRef(!1), [C, r] = M({
|
|
24
|
+
prop: s,
|
|
25
|
+
defaultProp: i ?? !1,
|
|
26
|
+
onChange: c,
|
|
27
|
+
caller: R
|
|
28
|
+
}), x = n.useCallback(() => {
|
|
29
|
+
clearTimeout(u.current), v.current = window.setTimeout(() => r(!0), f);
|
|
30
|
+
}, [f, r]), A = n.useCallback(() => {
|
|
31
|
+
clearTimeout(v.current), !h.current && !p.current && (u.current = window.setTimeout(() => r(!1), m));
|
|
32
|
+
}, [m, r]), L = n.useCallback(() => r(!1), [r]);
|
|
33
|
+
return n.useEffect(() => () => {
|
|
34
|
+
clearTimeout(v.current), clearTimeout(u.current);
|
|
35
|
+
}, []), /* @__PURE__ */ a.jsx(
|
|
36
|
+
V,
|
|
37
|
+
{
|
|
38
|
+
scope: o,
|
|
39
|
+
open: C,
|
|
40
|
+
onOpenChange: r,
|
|
41
|
+
onOpen: x,
|
|
42
|
+
onClose: A,
|
|
43
|
+
onDismiss: L,
|
|
44
|
+
hasSelectionRef: h,
|
|
45
|
+
isPointerDownOnContentRef: p,
|
|
46
|
+
children: /* @__PURE__ */ a.jsx(I, { ...d, children: t })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
_.displayName = R;
|
|
51
|
+
var y = "HoverCardTrigger", N = n.forwardRef(
|
|
52
|
+
(e, o) => {
|
|
53
|
+
const { __scopeHoverCard: t, ...s } = e, i = b(y, t), c = S(t);
|
|
54
|
+
return /* @__PURE__ */ a.jsx(U, { asChild: !0, ...c, children: /* @__PURE__ */ a.jsx(
|
|
55
|
+
B.a,
|
|
56
|
+
{
|
|
57
|
+
"data-state": i.open ? "open" : "closed",
|
|
58
|
+
...s,
|
|
59
|
+
ref: o,
|
|
60
|
+
onPointerEnter: l(e.onPointerEnter, g(i.onOpen)),
|
|
61
|
+
onPointerLeave: l(e.onPointerLeave, g(i.onClose)),
|
|
62
|
+
onFocus: l(e.onFocus, i.onOpen),
|
|
63
|
+
onBlur: l(e.onBlur, i.onClose),
|
|
64
|
+
onTouchStart: l(e.onTouchStart, (f) => f.preventDefault())
|
|
65
|
+
}
|
|
66
|
+
) });
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
N.displayName = y;
|
|
70
|
+
var E = "HoverCardPortal", [q, J] = O(E, {
|
|
71
|
+
forceMount: void 0
|
|
72
|
+
}), D = (e) => {
|
|
73
|
+
const { __scopeHoverCard: o, forceMount: t, children: s, container: i } = e, c = b(E, o);
|
|
74
|
+
return /* @__PURE__ */ a.jsx(q, { scope: o, forceMount: t, children: /* @__PURE__ */ a.jsx(H, { present: t || c.open, children: /* @__PURE__ */ a.jsx(z, { asChild: !0, container: i, children: s }) }) });
|
|
75
|
+
};
|
|
76
|
+
D.displayName = E;
|
|
77
|
+
var P = "HoverCardContent", j = n.forwardRef(
|
|
78
|
+
(e, o) => {
|
|
79
|
+
const t = J(P, e.__scopeHoverCard), { forceMount: s = t.forceMount, ...i } = e, c = b(P, e.__scopeHoverCard);
|
|
80
|
+
return /* @__PURE__ */ a.jsx(H, { present: s || c.open, children: /* @__PURE__ */ a.jsx(
|
|
81
|
+
Q,
|
|
82
|
+
{
|
|
83
|
+
"data-state": c.open ? "open" : "closed",
|
|
84
|
+
...i,
|
|
85
|
+
onPointerEnter: l(e.onPointerEnter, g(c.onOpen)),
|
|
86
|
+
onPointerLeave: l(e.onPointerLeave, g(c.onClose)),
|
|
87
|
+
ref: o
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
j.displayName = P;
|
|
93
|
+
var Q = n.forwardRef((e, o) => {
|
|
94
|
+
const {
|
|
95
|
+
__scopeHoverCard: t,
|
|
96
|
+
onEscapeKeyDown: s,
|
|
97
|
+
onPointerDownOutside: i,
|
|
98
|
+
onFocusOutside: c,
|
|
99
|
+
onInteractOutside: f,
|
|
100
|
+
...m
|
|
101
|
+
} = e, d = b(P, t), v = S(t), u = n.useRef(null), h = F(o, u), [p, C] = n.useState(!1);
|
|
102
|
+
return n.useEffect(() => {
|
|
103
|
+
if (p) {
|
|
104
|
+
const r = document.body;
|
|
105
|
+
return w = r.style.userSelect || r.style.webkitUserSelect, r.style.userSelect = "none", r.style.webkitUserSelect = "none", () => {
|
|
106
|
+
r.style.userSelect = w, r.style.webkitUserSelect = w;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}, [p]), n.useEffect(() => {
|
|
110
|
+
if (u.current) {
|
|
111
|
+
const r = () => {
|
|
112
|
+
C(!1), d.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
113
|
+
document.getSelection()?.toString() !== "" && (d.hasSelectionRef.current = !0);
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
return document.addEventListener("pointerup", r), () => {
|
|
117
|
+
document.removeEventListener("pointerup", r), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !1;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}, [d.isPointerDownOnContentRef, d.hasSelectionRef]), n.useEffect(() => {
|
|
121
|
+
u.current && Z(u.current).forEach((x) => x.setAttribute("tabindex", "-1"));
|
|
122
|
+
}), /* @__PURE__ */ a.jsx(
|
|
123
|
+
G,
|
|
124
|
+
{
|
|
125
|
+
asChild: !0,
|
|
126
|
+
disableOutsidePointerEvents: !1,
|
|
127
|
+
onInteractOutside: f,
|
|
128
|
+
onEscapeKeyDown: s,
|
|
129
|
+
onPointerDownOutside: i,
|
|
130
|
+
onFocusOutside: l(c, (r) => {
|
|
131
|
+
r.preventDefault();
|
|
132
|
+
}),
|
|
133
|
+
onDismiss: d.onDismiss,
|
|
134
|
+
children: /* @__PURE__ */ a.jsx(
|
|
135
|
+
$,
|
|
136
|
+
{
|
|
137
|
+
...v,
|
|
138
|
+
...m,
|
|
139
|
+
onPointerDown: l(m.onPointerDown, (r) => {
|
|
140
|
+
r.currentTarget.contains(r.target) && C(!0), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !0;
|
|
141
|
+
}),
|
|
142
|
+
ref: h,
|
|
143
|
+
style: {
|
|
144
|
+
...m.style,
|
|
145
|
+
userSelect: p ? "text" : void 0,
|
|
146
|
+
// Safari requires prefix
|
|
147
|
+
WebkitUserSelect: p ? "text" : void 0,
|
|
148
|
+
"--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
149
|
+
"--radix-hover-card-content-available-width": "var(--radix-popper-available-width)",
|
|
150
|
+
"--radix-hover-card-content-available-height": "var(--radix-popper-available-height)",
|
|
151
|
+
"--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)",
|
|
152
|
+
"--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}), X = "HoverCardArrow", Y = n.forwardRef(
|
|
159
|
+
(e, o) => {
|
|
160
|
+
const { __scopeHoverCard: t, ...s } = e, i = S(t);
|
|
161
|
+
return /* @__PURE__ */ a.jsx(W, { ...i, ...s, ref: o });
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
Y.displayName = X;
|
|
165
|
+
function g(e) {
|
|
166
|
+
return (o) => o.pointerType === "touch" ? void 0 : e();
|
|
167
|
+
}
|
|
168
|
+
function Z(e) {
|
|
169
|
+
const o = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
170
|
+
acceptNode: (s) => s.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
171
|
+
});
|
|
172
|
+
for (; t.nextNode(); ) o.push(t.currentNode);
|
|
173
|
+
return o;
|
|
174
|
+
}
|
|
175
|
+
var ee = _, re = N, oe = D, te = j;
|
|
176
|
+
function me({
|
|
177
|
+
...e
|
|
178
|
+
}) {
|
|
179
|
+
return /* @__PURE__ */ a.jsx(ee, { "data-slot": "hover-card", ...e });
|
|
180
|
+
}
|
|
181
|
+
function ve({
|
|
182
|
+
...e
|
|
183
|
+
}) {
|
|
184
|
+
return /* @__PURE__ */ a.jsx(re, { "data-slot": "hover-card-trigger", ...e });
|
|
185
|
+
}
|
|
186
|
+
function he({
|
|
187
|
+
className: e,
|
|
188
|
+
align: o = "center",
|
|
189
|
+
sideOffset: t = 4,
|
|
190
|
+
...s
|
|
191
|
+
}) {
|
|
192
|
+
return /* @__PURE__ */ a.jsx(oe, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ a.jsx(
|
|
193
|
+
te,
|
|
194
|
+
{
|
|
195
|
+
"data-slot": "hover-card-content",
|
|
196
|
+
align: o,
|
|
197
|
+
sideOffset: t,
|
|
198
|
+
className: K(
|
|
199
|
+
"adm:bg-popover adm:text-popover-foreground adm:data-[state=open]:animate-in adm:data-[state=closed]:animate-out adm:data-[state=closed]:fade-out-0 adm:data-[state=open]:fade-in-0 adm:data-[state=closed]:zoom-out-95 adm:data-[state=open]:zoom-in-95 adm:data-[side=bottom]:slide-in-from-top-2 adm:data-[side=left]:slide-in-from-right-2 adm:data-[side=right]:slide-in-from-left-2 adm:data-[side=top]:slide-in-from-bottom-2 adm:z-50 adm:w-64 adm:origin-(--radix-hover-card-content-transform-origin) adm:rounded-md adm:border adm:p-4 adm:shadow-md adm:outline-hidden",
|
|
200
|
+
e
|
|
201
|
+
),
|
|
202
|
+
...s
|
|
203
|
+
}
|
|
204
|
+
) });
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
me as HoverCard,
|
|
208
|
+
he as HoverCardContent,
|
|
209
|
+
ve as HoverCardTrigger
|
|
210
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { j as f } from "./jsx-runtime-BzflLqGi.js";
|
|
3
|
+
function d(e, t) {
|
|
4
|
+
if (typeof e == "function")
|
|
5
|
+
return e(t);
|
|
6
|
+
e != null && (e.current = t);
|
|
7
|
+
}
|
|
8
|
+
function m(...e) {
|
|
9
|
+
return (t) => {
|
|
10
|
+
let r = !1;
|
|
11
|
+
const o = e.map((n) => {
|
|
12
|
+
const l = d(n, t);
|
|
13
|
+
return !r && typeof l == "function" && (r = !0), l;
|
|
14
|
+
});
|
|
15
|
+
if (r)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let n = 0; n < o.length; n++) {
|
|
18
|
+
const l = o[n];
|
|
19
|
+
typeof l == "function" ? l() : d(e[n], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function x(...e) {
|
|
25
|
+
return i.useCallback(m(...e), e);
|
|
26
|
+
}
|
|
27
|
+
// @__NO_SIDE_EFFECTS__
|
|
28
|
+
function g(e) {
|
|
29
|
+
const t = /* @__PURE__ */ C(e), r = i.forwardRef((o, n) => {
|
|
30
|
+
const { children: l, ...a } = o, s = i.Children.toArray(l), c = s.find(E);
|
|
31
|
+
if (c) {
|
|
32
|
+
const u = c.props.children, S = s.map((p) => p === c ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : p);
|
|
33
|
+
return /* @__PURE__ */ f.jsx(t, { ...a, ref: n, children: i.isValidElement(u) ? i.cloneElement(u, void 0, S) : null });
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ f.jsx(t, { ...a, ref: n, children: l });
|
|
36
|
+
});
|
|
37
|
+
return r.displayName = `${e}.Slot`, r;
|
|
38
|
+
}
|
|
39
|
+
var j = /* @__PURE__ */ g("Slot");
|
|
40
|
+
// @__NO_SIDE_EFFECTS__
|
|
41
|
+
function C(e) {
|
|
42
|
+
const t = i.forwardRef((r, o) => {
|
|
43
|
+
const { children: n, ...l } = r;
|
|
44
|
+
if (i.isValidElement(n)) {
|
|
45
|
+
const a = b(n), s = R(l, n.props);
|
|
46
|
+
return n.type !== i.Fragment && (s.ref = o ? m(o, a) : a), i.cloneElement(n, s);
|
|
47
|
+
}
|
|
48
|
+
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
49
|
+
});
|
|
50
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
51
|
+
}
|
|
52
|
+
var y = Symbol("radix.slottable");
|
|
53
|
+
// @__NO_SIDE_EFFECTS__
|
|
54
|
+
function _(e) {
|
|
55
|
+
const t = ({ children: r }) => /* @__PURE__ */ f.jsx(f.Fragment, { children: r });
|
|
56
|
+
return t.displayName = `${e}.Slottable`, t.__radixId = y, t;
|
|
57
|
+
}
|
|
58
|
+
function E(e) {
|
|
59
|
+
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === y;
|
|
60
|
+
}
|
|
61
|
+
function R(e, t) {
|
|
62
|
+
const r = { ...t };
|
|
63
|
+
for (const o in t) {
|
|
64
|
+
const n = e[o], l = t[o];
|
|
65
|
+
/^on[A-Z]/.test(o) ? n && l ? r[o] = (...s) => {
|
|
66
|
+
const c = l(...s);
|
|
67
|
+
return n(...s), c;
|
|
68
|
+
} : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...l } : o === "className" && (r[o] = [n, l].filter(Boolean).join(" "));
|
|
69
|
+
}
|
|
70
|
+
return { ...e, ...r };
|
|
71
|
+
}
|
|
72
|
+
function b(e) {
|
|
73
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
74
|
+
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
j as S,
|
|
78
|
+
g as a,
|
|
79
|
+
_ as b,
|
|
80
|
+
m as c,
|
|
81
|
+
x as u
|
|
82
|
+
};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { u as B, c as g } from "./index-C0UREtMP.js";
|
|
3
|
+
import { u as R, a as H } from "./index-6oTEokEx.js";
|
|
4
|
+
import { c as V, a as q } from "./index-FxyLF8MY.js";
|
|
5
|
+
import { u as C } from "./index-Cv867SGx.js";
|
|
6
|
+
import { D as K } from "./index-C329e3yQ.js";
|
|
7
|
+
import { h as U, R as Y, u as Z, F as z } from "./index-o0sNTcKe.js";
|
|
8
|
+
import { P as J } from "./index-yR-v1A4G.js";
|
|
9
|
+
import { P as _ } from "./index-EUea2gfp.js";
|
|
10
|
+
import { P as p } from "./index-C5wjudc-.js";
|
|
11
|
+
import { j as s } from "./jsx-runtime-BzflLqGi.js";
|
|
12
|
+
var D = "Dialog", [y] = V(D), [Q, u] = y(D), N = (e) => {
|
|
13
|
+
const {
|
|
14
|
+
__scopeDialog: t,
|
|
15
|
+
children: n,
|
|
16
|
+
open: a,
|
|
17
|
+
defaultOpen: r,
|
|
18
|
+
onOpenChange: o,
|
|
19
|
+
modal: l = !0
|
|
20
|
+
} = e, c = i.useRef(null), f = i.useRef(null), [v, x] = B({
|
|
21
|
+
prop: a,
|
|
22
|
+
defaultProp: r ?? !1,
|
|
23
|
+
onChange: o,
|
|
24
|
+
caller: D
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ s.jsx(
|
|
27
|
+
Q,
|
|
28
|
+
{
|
|
29
|
+
scope: t,
|
|
30
|
+
triggerRef: c,
|
|
31
|
+
contentRef: f,
|
|
32
|
+
contentId: C(),
|
|
33
|
+
titleId: C(),
|
|
34
|
+
descriptionId: C(),
|
|
35
|
+
open: v,
|
|
36
|
+
onOpenChange: x,
|
|
37
|
+
onOpenToggle: i.useCallback(() => x(($) => !$), [x]),
|
|
38
|
+
modal: l,
|
|
39
|
+
children: n
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
N.displayName = D;
|
|
44
|
+
var O = "DialogTrigger", I = i.forwardRef(
|
|
45
|
+
(e, t) => {
|
|
46
|
+
const { __scopeDialog: n, ...a } = e, r = u(O, n), o = R(t, r.triggerRef);
|
|
47
|
+
return /* @__PURE__ */ s.jsx(
|
|
48
|
+
p.button,
|
|
49
|
+
{
|
|
50
|
+
type: "button",
|
|
51
|
+
"aria-haspopup": "dialog",
|
|
52
|
+
"aria-expanded": r.open,
|
|
53
|
+
"aria-controls": r.contentId,
|
|
54
|
+
"data-state": P(r.open),
|
|
55
|
+
...a,
|
|
56
|
+
ref: o,
|
|
57
|
+
onClick: g(e.onClick, r.onOpenToggle)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
I.displayName = O;
|
|
63
|
+
var h = "DialogPortal", [X, A] = y(h, {
|
|
64
|
+
forceMount: void 0
|
|
65
|
+
}), T = (e) => {
|
|
66
|
+
const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(h, t);
|
|
67
|
+
return /* @__PURE__ */ s.jsx(X, { scope: t, forceMount: n, children: i.Children.map(a, (l) => /* @__PURE__ */ s.jsx(_, { present: n || o.open, children: /* @__PURE__ */ s.jsx(J, { asChild: !0, container: r, children: l }) })) });
|
|
68
|
+
};
|
|
69
|
+
T.displayName = h;
|
|
70
|
+
var m = "DialogOverlay", j = i.forwardRef(
|
|
71
|
+
(e, t) => {
|
|
72
|
+
const n = A(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
|
|
73
|
+
return o.modal ? /* @__PURE__ */ s.jsx(_, { present: a || o.open, children: /* @__PURE__ */ s.jsx(oe, { ...r, ref: t }) }) : null;
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
j.displayName = m;
|
|
77
|
+
var ee = H("DialogOverlay.RemoveScroll"), oe = i.forwardRef(
|
|
78
|
+
(e, t) => {
|
|
79
|
+
const { __scopeDialog: n, ...a } = e, r = u(m, n);
|
|
80
|
+
return (
|
|
81
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
82
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
83
|
+
/* @__PURE__ */ s.jsx(Y, { as: ee, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ s.jsx(
|
|
84
|
+
p.div,
|
|
85
|
+
{
|
|
86
|
+
"data-state": P(r.open),
|
|
87
|
+
...a,
|
|
88
|
+
ref: t,
|
|
89
|
+
style: { pointerEvents: "auto", ...a.style }
|
|
90
|
+
}
|
|
91
|
+
) })
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
), d = "DialogContent", b = i.forwardRef(
|
|
95
|
+
(e, t) => {
|
|
96
|
+
const n = A(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
|
|
97
|
+
return /* @__PURE__ */ s.jsx(_, { present: a || o.open, children: o.modal ? /* @__PURE__ */ s.jsx(te, { ...r, ref: t }) : /* @__PURE__ */ s.jsx(re, { ...r, ref: t }) });
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
b.displayName = d;
|
|
101
|
+
var te = i.forwardRef(
|
|
102
|
+
(e, t) => {
|
|
103
|
+
const n = u(d, e.__scopeDialog), a = i.useRef(null), r = R(t, n.contentRef, a);
|
|
104
|
+
return i.useEffect(() => {
|
|
105
|
+
const o = a.current;
|
|
106
|
+
if (o) return U(o);
|
|
107
|
+
}, []), /* @__PURE__ */ s.jsx(
|
|
108
|
+
M,
|
|
109
|
+
{
|
|
110
|
+
...e,
|
|
111
|
+
ref: r,
|
|
112
|
+
trapFocus: n.open,
|
|
113
|
+
disableOutsidePointerEvents: !0,
|
|
114
|
+
onCloseAutoFocus: g(e.onCloseAutoFocus, (o) => {
|
|
115
|
+
o.preventDefault(), n.triggerRef.current?.focus();
|
|
116
|
+
}),
|
|
117
|
+
onPointerDownOutside: g(e.onPointerDownOutside, (o) => {
|
|
118
|
+
const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
|
|
119
|
+
(l.button === 2 || c) && o.preventDefault();
|
|
120
|
+
}),
|
|
121
|
+
onFocusOutside: g(
|
|
122
|
+
e.onFocusOutside,
|
|
123
|
+
(o) => o.preventDefault()
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
), re = i.forwardRef(
|
|
129
|
+
(e, t) => {
|
|
130
|
+
const n = u(d, e.__scopeDialog), a = i.useRef(!1), r = i.useRef(!1);
|
|
131
|
+
return /* @__PURE__ */ s.jsx(
|
|
132
|
+
M,
|
|
133
|
+
{
|
|
134
|
+
...e,
|
|
135
|
+
ref: t,
|
|
136
|
+
trapFocus: !1,
|
|
137
|
+
disableOutsidePointerEvents: !1,
|
|
138
|
+
onCloseAutoFocus: (o) => {
|
|
139
|
+
e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
|
|
140
|
+
},
|
|
141
|
+
onInteractOutside: (o) => {
|
|
142
|
+
e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
143
|
+
const l = o.target;
|
|
144
|
+
n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
), M = i.forwardRef(
|
|
150
|
+
(e, t) => {
|
|
151
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = i.useRef(null), v = R(t, f);
|
|
152
|
+
return Z(), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
153
|
+
/* @__PURE__ */ s.jsx(
|
|
154
|
+
z,
|
|
155
|
+
{
|
|
156
|
+
asChild: !0,
|
|
157
|
+
loop: !0,
|
|
158
|
+
trapped: a,
|
|
159
|
+
onMountAutoFocus: r,
|
|
160
|
+
onUnmountAutoFocus: o,
|
|
161
|
+
children: /* @__PURE__ */ s.jsx(
|
|
162
|
+
K,
|
|
163
|
+
{
|
|
164
|
+
role: "dialog",
|
|
165
|
+
id: c.contentId,
|
|
166
|
+
"aria-describedby": c.descriptionId,
|
|
167
|
+
"aria-labelledby": c.titleId,
|
|
168
|
+
"data-state": P(c.open),
|
|
169
|
+
...l,
|
|
170
|
+
ref: v,
|
|
171
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
177
|
+
/* @__PURE__ */ s.jsx(ne, { titleId: c.titleId }),
|
|
178
|
+
/* @__PURE__ */ s.jsx(se, { contentRef: f, descriptionId: c.descriptionId })
|
|
179
|
+
] })
|
|
180
|
+
] });
|
|
181
|
+
}
|
|
182
|
+
), E = "DialogTitle", F = i.forwardRef(
|
|
183
|
+
(e, t) => {
|
|
184
|
+
const { __scopeDialog: n, ...a } = e, r = u(E, n);
|
|
185
|
+
return /* @__PURE__ */ s.jsx(p.h2, { id: r.titleId, ...a, ref: t });
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
F.displayName = E;
|
|
189
|
+
var w = "DialogDescription", S = i.forwardRef(
|
|
190
|
+
(e, t) => {
|
|
191
|
+
const { __scopeDialog: n, ...a } = e, r = u(w, n);
|
|
192
|
+
return /* @__PURE__ */ s.jsx(p.p, { id: r.descriptionId, ...a, ref: t });
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
S.displayName = w;
|
|
196
|
+
var W = "DialogClose", k = i.forwardRef(
|
|
197
|
+
(e, t) => {
|
|
198
|
+
const { __scopeDialog: n, ...a } = e, r = u(W, n);
|
|
199
|
+
return /* @__PURE__ */ s.jsx(
|
|
200
|
+
p.button,
|
|
201
|
+
{
|
|
202
|
+
type: "button",
|
|
203
|
+
...a,
|
|
204
|
+
ref: t,
|
|
205
|
+
onClick: g(e.onClick, () => r.onOpenChange(!1))
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
k.displayName = W;
|
|
211
|
+
function P(e) {
|
|
212
|
+
return e ? "open" : "closed";
|
|
213
|
+
}
|
|
214
|
+
var G = "DialogTitleWarning", [ve, L] = q(G, {
|
|
215
|
+
contentName: d,
|
|
216
|
+
titleName: E,
|
|
217
|
+
docsSlug: "dialog"
|
|
218
|
+
}), ne = ({ titleId: e }) => {
|
|
219
|
+
const t = L(G), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
220
|
+
|
|
221
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
222
|
+
|
|
223
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
224
|
+
return i.useEffect(() => {
|
|
225
|
+
e && (document.getElementById(e) || console.error(n));
|
|
226
|
+
}, [n, e]), null;
|
|
227
|
+
}, ae = "DialogDescriptionWarning", se = ({ contentRef: e, descriptionId: t }) => {
|
|
228
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L(ae).contentName}}.`;
|
|
229
|
+
return i.useEffect(() => {
|
|
230
|
+
const r = e.current?.getAttribute("aria-describedby");
|
|
231
|
+
t && r && (document.getElementById(t) || console.warn(a));
|
|
232
|
+
}, [a, e, t]), null;
|
|
233
|
+
}, xe = N, Ce = I, Re = T, _e = j, he = b, Ee = F, Pe = S, ye = k;
|
|
234
|
+
export {
|
|
235
|
+
ye as C,
|
|
236
|
+
Pe as D,
|
|
237
|
+
_e as O,
|
|
238
|
+
Re as P,
|
|
239
|
+
xe as R,
|
|
240
|
+
Ee as T,
|
|
241
|
+
he as a,
|
|
242
|
+
Ce as b
|
|
243
|
+
};
|