@gridui/popover 1.2.0 → 1.3.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 CHANGED
@@ -3,11 +3,21 @@
3
3
  Core family. Public API: `Popover`, `PopoverAnchor`, `PopoverAnchorProps`, `PopoverClose`, `PopoverCloseProps`, `PopoverPanel`, `PopoverPanelProps`, `PopoverProps`, `PopoverTrigger`, `PopoverTriggerProps`.
4
4
 
5
5
  Import components from `@gridui/popover` and load `@gridui/popover/styles.css` after Theme.
6
- Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
6
+ Applications own routes, labels, state persistence, and branding.
7
+
8
+ ## Styles
9
+
10
+ Load Theme once. Use `@gridui/popover/styled` for automatic component CSS in
11
+ CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/popover/styles.css`.
12
+ Both entries expose the same root API. The standalone stylesheet includes component
13
+ dependency styles; Theme/reset remain separate. See the
14
+ [integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
15
+ for static HTML loading, SSR limits, and avoiding duplicate CSS.
16
+
7
17
 
8
18
  See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/popover/.changeset/history).
9
19
 
10
- Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after Theme and before this family.
20
+ Surface motion uses `@gridui/overlay`; its styles are included.
11
21
 
12
22
  [Component reference](docs/reference/README.md) contains focused API pages for each public component.
13
23
 
package/dist/index.js CHANGED
@@ -186,6 +186,7 @@ var PopoverPanel = (props) => {
186
186
  const motionStyle = useMotionStyle();
187
187
  const {
188
188
  className,
189
+ container,
189
190
  ref: forwardedRef,
190
191
  forceMount,
191
192
  align = "start",
@@ -251,6 +252,7 @@ var PopoverPanel = (props) => {
251
252
  return /* @__PURE__ */ jsx4(
252
253
  Primitive4.Portal,
253
254
  {
255
+ container,
254
256
  forceMount,
255
257
  children: forceMount ? /* @__PURE__ */ jsx4(RetainedLayer, { children: content }) : content
256
258
  }
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/shared/context.ts", "../src/popover/hover-intent.ts", "../src/popover/popover.tsx", "../src/popover-anchor/popover-anchor.tsx", "../src/popover-close/popover-close.tsx", "../src/popover-panel/popover-panel.tsx", "../src/popover-panel/style.ts", "../src/popover-trigger/style.ts", "../src/popover-trigger/popover-trigger.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Popover\n * @namespace Shared\n * @description Context\n */\n\nimport { createContext, type PointerEvent } from \"react\";\n\nexport type NavigationInteraction = {\n readonly hoverOpened: {\n current: boolean;\n };\n readonly enter: (event: PointerEvent<HTMLElement>) => void;\n readonly leave: (event: PointerEvent<HTMLElement>) => void;\n readonly activate: () => void;\n readonly dismiss: () => void;\n};\n\nexport const Interaction = createContext<NavigationInteraction | null>(null);\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace Popover\n * @description Hover Intent\n */\n\nexport const createHoverIntent = (open: () => void, close: () => void) => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let dismissed = false;\n const cancel = (): void => {\n clearTimeout(timer);\n timer = undefined;\n };\n return {\n enter(alreadyOpen: boolean): void {\n cancel();\n if (!dismissed && !alreadyOpen) {\n timer = setTimeout(open, 150);\n }\n },\n leave(shouldClose: boolean): void {\n cancel();\n dismissed = false;\n if (shouldClose) {\n timer = setTimeout(close, 250);\n }\n },\n dismiss(): void {\n cancel();\n dismissed = true;\n },\n cancel,\n };\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace Popover\n * @description Popover\n */\n\nimport { Interaction, type NavigationInteraction } from \"../shared/context\";\nimport { createHoverIntent } from \"./hover-intent\";\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { type ComponentPropsWithRef, type FC, useEffect, useMemo, useRef } from \"react\";\n\nexport type PopoverProps = ComponentPropsWithRef<typeof Primitive.Root> & {\n readonly hoverEnabled?: boolean;\n};\n\nexport const Popover: FC<PopoverProps> = (props: PopoverProps) => {\n const {\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n hoverEnabled = true,\n ...restProps\n } = props;\n const { open, onOpenChange: change } = useOverlayState({\n open: controlledOpen,\n defaultOpen,\n onOpenChange,\n });\n const hoverOpened = useRef(false);\n const openRef = useRef(open);\n const changeRef = useRef(change);\n const hoverTarget = useRef<HTMLElement | null>(null);\n useEffect(() => {\n openRef.current = open;\n changeRef.current = change;\n }, [\n open,\n change,\n ]);\n const intent = useMemo(() => {\n return createHoverIntent(() => {\n if (!hoverTarget.current?.isConnected || hoverTarget.current.matches(\":disabled, [aria-disabled='true']\")) {\n return;\n }\n hoverOpened.current = true;\n changeRef.current(true);\n }, () => {\n changeRef.current(false);\n });\n }, []);\n useEffect(() => {\n return intent.cancel;\n }, [intent]);\n useEffect(() => {\n if (!hoverEnabled) {\n intent.cancel();\n }\n }, [\n hoverEnabled,\n intent,\n ]);\n useEffect(() => {\n if (!open) {\n intent.cancel();\n }\n }, [\n intent,\n open,\n ]);\n const interaction: NavigationInteraction = {\n hoverOpened,\n enter(event) {\n if (hoverEnabled && event.pointerType === \"mouse\" && !event.currentTarget.matches(\":disabled, [aria-disabled='true']\")\n && window.matchMedia(\"(hover: hover) and (pointer: fine)\").matches) {\n hoverTarget.current = event.currentTarget;\n intent.enter(openRef.current);\n }\n },\n leave(event) {\n const focused = event.currentTarget.contains(document.activeElement);\n intent.leave(hoverOpened.current && !focused);\n },\n activate() {\n intent.cancel();\n hoverOpened.current = false;\n },\n dismiss() {\n intent.dismiss();\n hoverOpened.current = false;\n },\n };\n return (<Interaction.Provider\n value={interaction}\n >\n <OverlayOpen.Provider\n value={open}\n >\n <Primitive.Root\n {...restProps}\n open={open}\n onOpenChange={(next) => {\n if (!next) {\n interaction.dismiss();\n }\n change(next);\n }}\n />\n </OverlayOpen.Provider>\n </Interaction.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverAnchor\n * @description Popover Anchor\n */\n\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type PopoverAnchorProps = ComponentPropsWithRef<typeof Primitive.Anchor>;\n\nexport const PopoverAnchor: FC<PopoverAnchorProps> = (props: PopoverAnchorProps) => {\n return (<Primitive.Anchor\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverClose\n * @description Popover Close\n */\n\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type PopoverCloseProps = ComponentPropsWithRef<typeof Primitive.Close>;\n\nexport const PopoverClose: FC<PopoverCloseProps> = (props: PopoverCloseProps) => {\n return (<Primitive.Close\n {...props}\n />);\n};\n", "import { useMotionStyle } from \"@gridui/motion/policy\";\n/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverPanel\n * @description Popover Panel\n */\n\nimport { Interaction } from \"../shared/context\";\nimport { menuPanelStyles } from \"./style\";\nimport { interactionLayerProps, RetainedLayer, useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { type ComponentPropsWithRef, type FC, useContext } from \"react\";\n\nexport type PopoverPanelProps = ComponentPropsWithRef<typeof Primitive.Content>;\n\nexport const PopoverPanel: FC<PopoverPanelProps> = (props: PopoverPanelProps) => {\n const motionStyle = useMotionStyle();\n const {\n className,\n ref: forwardedRef,\n forceMount,\n align = \"start\",\n sideOffset = 8,\n collisionPadding = 16,\n onPointerEnter,\n onPointerLeave,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n ...restProps\n } = props;\n const interaction = useContext(Interaction);\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({\n ref: scrollbarRef,\n selector: 'a[href], button, input, select, textarea, summary, [tabindex], [role=\"option\"]',\n });\n const content = (<Primitive.Content\n {...interactionLayerProps}\n {...restProps}\n ref={ref}\n forceMount={forceMount}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(menuPanelStyles(), className)}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (!event.defaultPrevented) {\n interaction?.enter(event);\n }\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n if (!event.defaultPrevented) {\n interaction?.leave(event);\n }\n }}\n onOpenAutoFocus={(event) => {\n onOpenAutoFocus?.(event);\n if (interaction?.hoverOpened.current) {\n event.preventDefault();\n }\n }}\n onCloseAutoFocus={(event) => {\n onCloseAutoFocus?.(event);\n if (interaction?.hoverOpened.current) {\n event.preventDefault();\n }\n }}\n onEscapeKeyDown={(event) => {\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented) {\n interaction?.dismiss();\n }\n }}\n style={{ ...(props.style), ...motionStyle }}\n />);\n return (<Primitive.Portal\n forceMount={forceMount}\n >\n {forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content}\n </Primitive.Portal>);\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverPanel\n * @description Style\n */\n\nimport { overlaySurfaceStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const menuPanelStyles = cva(cn(\n overlaySurfaceStyles(),\n \"gridui-menu-panel\",\n \"gridui-u-popover--z-(--gridui-z-popover) gridui-u-popover--box-border gridui-u-popover--p-gridui-24 gridui-u-popover--type-supporting gridui-u-popover--overflow-y-auto gridui-u-popover--overscroll-contain gridui-u-popover--w-3xl gridui-u-popover--max-w-[min(calc(100vw-2*var(--gridui-page-gutter)),var(--radix-popover-content-available-width))] gridui-u-popover--max-h-(--radix-popover-content-available-height) gridui-u-popover--rounded-control\",\n));\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverTrigger\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const popoverTriggerStyles = cva(\"gridui-menu-trigger gridui-u-popover--data-[state=open]:bg-surface\");\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverTrigger\n * @description Popover Trigger\n */\n\nimport { Interaction } from \"../shared/context\";\nimport { popoverTriggerStyles } from \"./style\";\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { type FC, useContext } from \"react\";\n\nexport type PopoverTriggerProps = ButtonProps;\n\nexport const PopoverTrigger: FC<PopoverTriggerProps> = (props: PopoverTriggerProps) => {\n const {\n size = \"small\",\n className,\n onPointerEnter,\n onPointerLeave,\n onPointerDown,\n onKeyDown,\n ...restProps\n } = props;\n const interaction = useContext(Interaction);\n const buttonProps: ButtonProps = restProps.variant === undefined ? {\n ...restProps,\n variant: \"quiet\",\n } : restProps;\n return (<Primitive.Trigger\n asChild\n >\n <Button\n {...buttonProps}\n size={size}\n className={cn(popoverTriggerStyles(), className)}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (!restProps.disabled\n && !restProps.loading\n && !event.defaultPrevented) {\n interaction?.enter(event);\n }\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n if (!event.defaultPrevented) {\n interaction?.leave(event);\n }\n }}\n onPointerDown={(event) => {\n onPointerDown?.(event);\n if (!event.defaultPrevented) {\n interaction?.activate();\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented && (event.key === \"Enter\" || event.key === \" \")) {\n interaction?.activate();\n }\n }}\n />\n </Primitive.Trigger>);\n};\n"],
5
- "mappings": ";AAOA,SAAS,qBAAwC;AAY1C,IAAM,cAAc,cAA4C,IAAI;;;ACZpE,IAAM,oBAAoB,CAAC,MAAkB,UAAsB;AACtE,MAAI;AACJ,MAA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D,YAAW,WAAW;AAC1C,QAAM,cAA2B,UAAU,YAAY,SAAY;AAAA,IAC/D,GAAG;AAAA,IACH,SAAS;AAAA,EACb,IAAI;AACJ,SAAQ,gBAAAC;AAAA,IAAW;AAAA,IAAV;AAAA,MACL,SAAO;AAAA,MAEP,0BAAAA;AAAA,QAAC;AAAA;AAAA,UACI,GAAG;AAAA,UACJ;AAAA,UACA,WAAWH,IAAG,qBAAqB,GAAG,SAAS;AAAA,UAC/C,gBAAgB,CAAC,UAAU;AACvB,6BAAiB,KAAK;AACtB,gBAAI,CAAC,UAAU,YACJ,CAAC,UAAU,WACX,CAAC,MAAM,kBAAkB;AAChC,2BAAa,MAAM,KAAK;AAAA,YAC5B;AAAA,UACJ;AAAA,UACA,gBAAgB,CAAC,UAAU;AACvB,6BAAiB,KAAK;AACtB,gBAAI,CAAC,MAAM,kBAAkB;AACzB,2BAAa,MAAM,KAAK;AAAA,YAC5B;AAAA,UACJ;AAAA,UACA,eAAe,CAAC,UAAU;AACtB,4BAAgB,KAAK;AACrB,gBAAI,CAAC,MAAM,kBAAkB;AACzB,2BAAa,SAAS;AAAA,YAC1B;AAAA,UACJ;AAAA,UACA,WAAW,CAAC,UAAU;AAClB,wBAAY,KAAK;AACjB,gBAAI,CAAC,MAAM,qBAAqB,MAAM,QAAQ,WAAW,MAAM,QAAQ,MAAM;AACzE,2BAAa,SAAS;AAAA,YAC1B;AAAA,UACJ;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Popover\n * @namespace Shared\n * @description Context\n */\n\nimport { createContext, type PointerEvent } from \"react\";\n\nexport type NavigationInteraction = {\n readonly hoverOpened: {\n current: boolean;\n };\n readonly enter: (event: PointerEvent<HTMLElement>) => void;\n readonly leave: (event: PointerEvent<HTMLElement>) => void;\n readonly activate: () => void;\n readonly dismiss: () => void;\n};\n\nexport const Interaction = createContext<NavigationInteraction | null>(null);\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace Popover\n * @description Hover Intent\n */\n\nexport const createHoverIntent = (open: () => void, close: () => void) => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let dismissed = false;\n const cancel = (): void => {\n clearTimeout(timer);\n timer = undefined;\n };\n return {\n enter(alreadyOpen: boolean): void {\n cancel();\n if (!dismissed && !alreadyOpen) {\n timer = setTimeout(open, 150);\n }\n },\n leave(shouldClose: boolean): void {\n cancel();\n dismissed = false;\n if (shouldClose) {\n timer = setTimeout(close, 250);\n }\n },\n dismiss(): void {\n cancel();\n dismissed = true;\n },\n cancel,\n };\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace Popover\n * @description Popover\n */\n\nimport { Interaction, type NavigationInteraction } from \"../shared/context\";\nimport { createHoverIntent } from \"./hover-intent\";\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { type ComponentPropsWithRef, type FC, useEffect, useMemo, useRef } from \"react\";\n\nexport type PopoverProps = ComponentPropsWithRef<typeof Primitive.Root> & {\n readonly hoverEnabled?: boolean;\n};\n\nexport const Popover: FC<PopoverProps> = (props: PopoverProps) => {\n const {\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n hoverEnabled = true,\n ...restProps\n } = props;\n const { open, onOpenChange: change } = useOverlayState({\n open: controlledOpen,\n defaultOpen,\n onOpenChange,\n });\n const hoverOpened = useRef(false);\n const openRef = useRef(open);\n const changeRef = useRef(change);\n const hoverTarget = useRef<HTMLElement | null>(null);\n useEffect(() => {\n openRef.current = open;\n changeRef.current = change;\n }, [\n open,\n change,\n ]);\n const intent = useMemo(() => {\n return createHoverIntent(() => {\n if (!hoverTarget.current?.isConnected || hoverTarget.current.matches(\":disabled, [aria-disabled='true']\")) {\n return;\n }\n hoverOpened.current = true;\n changeRef.current(true);\n }, () => {\n changeRef.current(false);\n });\n }, []);\n useEffect(() => {\n return intent.cancel;\n }, [intent]);\n useEffect(() => {\n if (!hoverEnabled) {\n intent.cancel();\n }\n }, [\n hoverEnabled,\n intent,\n ]);\n useEffect(() => {\n if (!open) {\n intent.cancel();\n }\n }, [\n intent,\n open,\n ]);\n const interaction: NavigationInteraction = {\n hoverOpened,\n enter(event) {\n if (hoverEnabled && event.pointerType === \"mouse\" && !event.currentTarget.matches(\":disabled, [aria-disabled='true']\")\n && window.matchMedia(\"(hover: hover) and (pointer: fine)\").matches) {\n hoverTarget.current = event.currentTarget;\n intent.enter(openRef.current);\n }\n },\n leave(event) {\n const focused = event.currentTarget.contains(document.activeElement);\n intent.leave(hoverOpened.current && !focused);\n },\n activate() {\n intent.cancel();\n hoverOpened.current = false;\n },\n dismiss() {\n intent.dismiss();\n hoverOpened.current = false;\n },\n };\n return (<Interaction.Provider\n value={interaction}\n >\n <OverlayOpen.Provider\n value={open}\n >\n <Primitive.Root\n {...restProps}\n open={open}\n onOpenChange={(next) => {\n if (!next) {\n interaction.dismiss();\n }\n change(next);\n }}\n />\n </OverlayOpen.Provider>\n </Interaction.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverAnchor\n * @description Popover Anchor\n */\n\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type PopoverAnchorProps = ComponentPropsWithRef<typeof Primitive.Anchor>;\n\nexport const PopoverAnchor: FC<PopoverAnchorProps> = (props: PopoverAnchorProps) => {\n return (<Primitive.Anchor\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverClose\n * @description Popover Close\n */\n\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type PopoverCloseProps = ComponentPropsWithRef<typeof Primitive.Close>;\n\nexport const PopoverClose: FC<PopoverCloseProps> = (props: PopoverCloseProps) => {\n return (<Primitive.Close\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverPanel\n * @description Popover Panel\n */\n\nimport { useMotionStyle } from \"@gridui/motion/policy\";\n/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverPanel\n * @description Popover Panel\n */\n\nimport { Interaction } from \"../shared/context\";\nimport { menuPanelStyles } from \"./style\";\nimport { interactionLayerProps, RetainedLayer, useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { type ComponentPropsWithRef, type FC, useContext } from \"react\";\n\nexport type PopoverPanelProps = ComponentPropsWithRef<typeof Primitive.Content> & {\n readonly container?: ComponentPropsWithRef<typeof Primitive.Portal>[\"container\"];\n};\n\nexport const PopoverPanel: FC<PopoverPanelProps> = (props: PopoverPanelProps) => {\n const motionStyle = useMotionStyle();\n const {\n className,\n container,\n ref: forwardedRef,\n forceMount,\n align = \"start\",\n sideOffset = 8,\n collisionPadding = 16,\n onPointerEnter,\n onPointerLeave,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n ...restProps\n } = props;\n const interaction = useContext(Interaction);\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({\n ref: scrollbarRef,\n selector: 'a[href], button, input, select, textarea, summary, [tabindex], [role=\"option\"]',\n });\n const content = (<Primitive.Content\n {...interactionLayerProps}\n {...restProps}\n ref={ref}\n forceMount={forceMount}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(menuPanelStyles(), className)}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (!event.defaultPrevented) {\n interaction?.enter(event);\n }\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n if (!event.defaultPrevented) {\n interaction?.leave(event);\n }\n }}\n onOpenAutoFocus={(event) => {\n onOpenAutoFocus?.(event);\n if (interaction?.hoverOpened.current) {\n event.preventDefault();\n }\n }}\n onCloseAutoFocus={(event) => {\n onCloseAutoFocus?.(event);\n if (interaction?.hoverOpened.current) {\n event.preventDefault();\n }\n }}\n onEscapeKeyDown={(event) => {\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented) {\n interaction?.dismiss();\n }\n }}\n style={{ ...(props.style), ...motionStyle }}\n />);\n return (<Primitive.Portal\n container={container}\n forceMount={forceMount}\n >\n {forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content}\n </Primitive.Portal>);\n};\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverPanel\n * @description Style\n */\n\nimport { overlaySurfaceStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const menuPanelStyles = cva(cn(\n overlaySurfaceStyles(),\n \"gridui-menu-panel\",\n \"gridui-u-popover--z-(--gridui-z-popover) gridui-u-popover--box-border gridui-u-popover--p-gridui-24 gridui-u-popover--type-supporting gridui-u-popover--overflow-y-auto gridui-u-popover--overscroll-contain gridui-u-popover--w-3xl gridui-u-popover--max-w-[min(calc(100vw-2*var(--gridui-page-gutter)),var(--radix-popover-content-available-width))] gridui-u-popover--max-h-(--radix-popover-content-available-height) gridui-u-popover--rounded-control\",\n));\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverTrigger\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const popoverTriggerStyles = cva(\"gridui-menu-trigger gridui-u-popover--data-[state=open]:bg-surface\");\n", "/**\n * @author WMXPY\n * @package Popover\n * @namespace PopoverTrigger\n * @description Popover Trigger\n */\n\nimport { Interaction } from \"../shared/context\";\nimport { popoverTriggerStyles } from \"./style\";\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { type FC, useContext } from \"react\";\n\nexport type PopoverTriggerProps = ButtonProps;\n\nexport const PopoverTrigger: FC<PopoverTriggerProps> = (props: PopoverTriggerProps) => {\n const {\n size = \"small\",\n className,\n onPointerEnter,\n onPointerLeave,\n onPointerDown,\n onKeyDown,\n ...restProps\n } = props;\n const interaction = useContext(Interaction);\n const buttonProps: ButtonProps = restProps.variant === undefined ? {\n ...restProps,\n variant: \"quiet\",\n } : restProps;\n return (<Primitive.Trigger\n asChild\n >\n <Button\n {...buttonProps}\n size={size}\n className={cn(popoverTriggerStyles(), className)}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (!restProps.disabled\n && !restProps.loading\n && !event.defaultPrevented) {\n interaction?.enter(event);\n }\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n if (!event.defaultPrevented) {\n interaction?.leave(event);\n }\n }}\n onPointerDown={(event) => {\n onPointerDown?.(event);\n if (!event.defaultPrevented) {\n interaction?.activate();\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented && (event.key === \"Enter\" || event.key === \" \")) {\n interaction?.activate();\n }\n }}\n />\n </Primitive.Trigger>);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,qBAAwC;AAY1C,IAAM,cAAc,cAA4C,IAAI;;;ACZpE,IAAM,oBAAoB,CAAC,MAAkB,UAAsB;AACtE,MAAI;AACJ,MAAI,YAAY;AAChB,QAAM,SAAS,MAAY;AACvB,iBAAa,KAAK;AAClB,YAAQ;AAAA,EACZ;AACA,SAAO;AAAA,IACH,MAAM,aAA4B;AAC9B,aAAO;AACP,UAAI,CAAC,aAAa,CAAC,aAAa;AAC5B,gBAAQ,WAAW,MAAM,GAAG;AAAA,MAChC;AAAA,IACJ;AAAA,IACA,MAAM,aAA4B;AAC9B,aAAO;AACP,kBAAY;AACZ,UAAI,aAAa;AACb,gBAAQ,WAAW,OAAO,GAAG;AAAA,MACjC;AAAA,IACJ;AAAA,IACA,UAAgB;AACZ,aAAO;AACP,kBAAY;AAAA,IAChB;AAAA,IACA;AAAA,EACJ;AACJ;;;ACzBA,SAAS,aAAa,uBAAuB;AAC7C,YAAY,eAAe;AAC3B,SAA8C,WAAW,SAAS,cAAc;AAwFpE;AAlFL,IAAM,UA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B,gBAAI,CAAC,MAAM,kBAAkB;AACzB,2BAAa,MAAM,KAAK;AAAA,YAC5B;AAAA,UACJ;AAAA,UACA,eAAe,CAAC,UAAU;AACtB,4BAAgB,KAAK;AACrB,gBAAI,CAAC,MAAM,kBAAkB;AACzB,2BAAa,SAAS;AAAA,YAC1B;AAAA,UACJ;AAAA,UACA,WAAW,CAAC,UAAU;AAClB,wBAAY,KAAK;AACjB,gBAAI,CAAC,MAAM,qBAAqB,MAAM,QAAQ,WAAW,MAAM,QAAQ,MAAM;AACzE,2BAAa,SAAS;AAAA,YAC1B;AAAA,UACJ;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
6
6
  "names": ["Primitive", "jsx", "Primitive", "jsx", "cn", "Primitive", "jsx", "cva", "cn", "Primitive", "useContext", "jsx"]
7
7
  }
@@ -1,4 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Popover
4
+ * @namespace PopoverPanel
5
+ * @description Popover Panel
6
+ */
1
7
  import * as Primitive from "@radix-ui/react-popover";
2
8
  import { type ComponentPropsWithRef, type FC } from "react";
3
- export type PopoverPanelProps = ComponentPropsWithRef<typeof Primitive.Content>;
9
+ export type PopoverPanelProps = ComponentPropsWithRef<typeof Primitive.Content> & {
10
+ readonly container?: ComponentPropsWithRef<typeof Primitive.Portal>["container"];
11
+ };
4
12
  export declare const PopoverPanel: FC<PopoverPanelProps>;
package/dist/styled.js ADDED
@@ -0,0 +1,4 @@
1
+ import "@gridui/button/styled";
2
+ import "@gridui/overlay/styled";
3
+ import "./styles.local.css";
4
+ export * from "./index.js";
package/dist/styles.css CHANGED
@@ -1,3 +1,597 @@
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer theme, base, components, utilities;
4
+ @layer theme {
5
+ :root, :host {
6
+ --spacing: 0.25rem;
7
+ }
8
+ }
9
+ @layer utilities {
10
+ .gridui-u-button--pointer-events-none {
11
+ pointer-events: none;
12
+ }
13
+ .gridui-u-button--inline-flex {
14
+ display: inline-flex;
15
+ }
16
+ .gridui-u-button--h-full {
17
+ height: 100%;
18
+ }
19
+ .gridui-u-button--h-gridui-control {
20
+ height: var(--gridui-control-min-height);
21
+ }
22
+ .gridui-u-button--min-h-18 {
23
+ min-height: calc(var(--spacing) * 18);
24
+ }
25
+ .gridui-u-button--min-h-gridui-control {
26
+ min-height: var(--gridui-control-min-height);
27
+ }
28
+ .gridui-u-button--min-h-gridui-control-large {
29
+ min-height: var(--gridui-control-min-height-large);
30
+ }
31
+ .gridui-u-button--min-h-gridui-control-small {
32
+ min-height: var(--gridui-control-min-height-small);
33
+ }
34
+ .gridui-u-button--w-fit {
35
+ width: fit-content;
36
+ }
37
+ .gridui-u-button--w-full {
38
+ width: 100%;
39
+ }
40
+ .gridui-u-button--w-gridui-64 {
41
+ width: var(--gridui-space-64);
42
+ }
43
+ .gridui-u-button--w-gridui-control {
44
+ width: var(--gridui-control-min-height);
45
+ }
46
+ .gridui-u-button--w-gridui-control-large {
47
+ width: var(--gridui-control-min-height-large);
48
+ }
49
+ .gridui-u-button--w-gridui-control-small {
50
+ width: var(--gridui-control-min-height-small);
51
+ }
52
+ .gridui-u-button--max-w-full {
53
+ max-width: 100%;
54
+ }
55
+ .gridui-u-button--min-w-0 {
56
+ min-width: 0px;
57
+ }
58
+ .gridui-u-button--min-w-gridui-24 {
59
+ min-width: var(--gridui-space-24);
60
+ }
61
+ .gridui-u-button--flex-1 {
62
+ flex: 1;
63
+ }
64
+ .gridui-u-button--shrink-0 {
65
+ flex-shrink: 0;
66
+ }
67
+ .gridui-u-button--cursor-pointer {
68
+ cursor: pointer;
69
+ }
70
+ .gridui-u-button--flex-col {
71
+ flex-direction: column;
72
+ }
73
+ .gridui-u-button--items-center {
74
+ align-items: center;
75
+ }
76
+ .gridui-u-button--items-stretch {
77
+ align-items: stretch;
78
+ }
79
+ .gridui-u-button--justify-between {
80
+ justify-content: space-between;
81
+ }
82
+ .gridui-u-button--justify-center {
83
+ justify-content: center;
84
+ }
85
+ .gridui-u-button--justify-start {
86
+ justify-content: flex-start;
87
+ }
88
+ .gridui-u-button--gap-0 {
89
+ gap: 0px;
90
+ }
91
+ .gridui-u-button--gap-gridui-8 {
92
+ gap: var(--gridui-space-8);
93
+ }
94
+ .gridui-u-button--gap-gridui-32 {
95
+ gap: var(--gridui-space-32);
96
+ }
97
+ .gridui-u-button--self-stretch {
98
+ align-self: stretch;
99
+ }
100
+ .gridui-u-button--rounded-control {
101
+ border-radius: var(--gridui-control-radius);
102
+ }
103
+ .gridui-u-button--rounded-none {
104
+ border-radius: 0;
105
+ }
106
+ .gridui-u-button--border-0 {
107
+ border-style: var(--tw-border-style);
108
+ border-width: 0px;
109
+ }
110
+ .gridui-u-button--border-b {
111
+ border-bottom-style: var(--tw-border-style);
112
+ border-bottom-width: 1px;
113
+ }
114
+ .gridui-u-button--border-accent-background {
115
+ border-color: var(--gridui-accent-background);
116
+ }
117
+ .gridui-u-button--border-control-border {
118
+ border-color: var(--gridui-control-border);
119
+ }
120
+ .gridui-u-button--border-foreground {
121
+ border-color: var(--gridui-foreground);
122
+ }
123
+ .gridui-u-button--bg-accent-background {
124
+ background-color: var(--gridui-accent-background);
125
+ }
126
+ .gridui-u-button--bg-selection-background {
127
+ background-color: var(--gridui-selection-background);
128
+ }
129
+ .gridui-u-button--bg-transparent {
130
+ background-color: transparent;
131
+ }
132
+ .gridui-u-button--p-0 {
133
+ padding: 0px;
134
+ }
135
+ .gridui-u-button--px-0 {
136
+ padding-inline: 0px;
137
+ }
138
+ .gridui-u-button--px-gridui-8 {
139
+ padding-inline: var(--gridui-space-8);
140
+ }
141
+ .gridui-u-button--px-gridui-16 {
142
+ padding-inline: var(--gridui-space-16);
143
+ }
144
+ .gridui-u-button--px-gridui-24 {
145
+ padding-inline: var(--gridui-space-24);
146
+ }
147
+ .gridui-u-button--py-gridui-4 {
148
+ padding-block: var(--gridui-space-4);
149
+ }
150
+ .gridui-u-button--py-gridui-8 {
151
+ padding-block: var(--gridui-space-8);
152
+ }
153
+ .gridui-u-button--py-gridui-16 {
154
+ padding-block: var(--gridui-space-16);
155
+ }
156
+ .gridui-u-button--text-center {
157
+ text-align: center;
158
+ }
159
+ .gridui-u-button--text-left {
160
+ text-align: left;
161
+ }
162
+ .gridui-u-button--text-start {
163
+ text-align: start;
164
+ }
165
+ .gridui-u-button--type-supporting {
166
+ font: var(--gridui-type-supporting);
167
+ font-family: var(--gridui-font-body);
168
+ letter-spacing: normal;
169
+ }
170
+ .gridui-u-button--type-ui {
171
+ font: var(--gridui-type-ui);
172
+ font-family: var(--gridui-font-body);
173
+ letter-spacing: normal;
174
+ }
175
+ .gridui-u-button--wrap-anywhere {
176
+ overflow-wrap: anywhere;
177
+ }
178
+ .gridui-u-button--text-accent-foreground {
179
+ color: var(--gridui-accent-foreground);
180
+ }
181
+ .gridui-u-button--text-foreground {
182
+ color: var(--gridui-foreground);
183
+ }
184
+ .gridui-u-button--no-underline {
185
+ text-decoration-line: none;
186
+ }
187
+ .gridui-u-button--\[transition-property\:var\(--gridui-motion-transition\,color\,background-color\,border-color\,text-decoration-color\,fill\,stroke\)\] {
188
+ transition-property: var(--gridui-motion-transition,color,background-color,border-color,text-decoration-color,fill,stroke);
189
+ }
190
+ .gridui-u-button--duration-\[calc\(var\(--gridui-motion-duration-quick\)\*var\(--gridui-motion-factor\,1\)\)\] {
191
+ --tw-duration: calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor,1));
192
+ transition-duration: calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor,1));
193
+ }
194
+ .gridui-u-button--ease-\(--gridui-motion-ease-out\) {
195
+ --tw-ease: var(--gridui-motion-ease-out);
196
+ transition-timing-function: var(--gridui-motion-ease-out);
197
+ }
198
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-icon-size\)\] {
199
+ --gridui-button-icon-size: var(--gridui-icon-size);
200
+ }
201
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-icon-size-large\)\] {
202
+ --gridui-button-icon-size: var(--gridui-icon-size-large);
203
+ }
204
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-space-32\)\] {
205
+ --gridui-button-icon-size: var(--gridui-space-32);
206
+ }
207
+ .gridui-u-button--\[--gridui-button-icon-size\:var\(--gridui-space-48\)\] {
208
+ --gridui-button-icon-size: var(--gridui-space-48);
209
+ }
210
+ @media (hover: hover) {
211
+ .gridui-u-button--not-disabled\:not-aria-disabled\:not-data-disabled\:hover\:bg-accent-hover:not(:disabled):not([aria-disabled="true"]):not([data-disabled]):hover {
212
+ background-color: var(--gridui-accent-hover);
213
+ }
214
+ }
215
+ .gridui-u-button--not-disabled\:not-aria-disabled\:not-data-disabled\:active\:bg-accent-pressed:not(:disabled):not([aria-disabled="true"]):not([data-disabled]):active {
216
+ background-color: var(--gridui-accent-pressed);
217
+ }
218
+ .gridui-u-button--not-disabled\:not-aria-disabled\:not-data-disabled\:active\:bg-surface-pressed:not(:disabled):not([aria-disabled="true"]):not([data-disabled]):active {
219
+ background-color: var(--gridui-surface-pressed);
220
+ }
221
+ .gridui-u-button--disabled\:cursor-not-allowed:disabled {
222
+ cursor: not-allowed;
223
+ }
224
+ .gridui-u-button--aria-disabled\:cursor-not-allowed[aria-disabled="true"] {
225
+ cursor: not-allowed;
226
+ }
227
+ .gridui-u-button--data-disabled\:cursor-not-allowed[data-disabled] {
228
+ cursor: not-allowed;
229
+ }
230
+ .gridui-u-button--data-gridui-busy\:cursor-wait[data-gridui-busy] {
231
+ cursor: wait;
232
+ }
233
+ @media (prefers-reduced-motion: reduce) {
234
+ .gridui-u-button--motion-reduce\:transition-none {
235
+ transition-property: none;
236
+ }
237
+ }
238
+ .gridui-u-button--\[\&_\>_span\]\:whitespace-nowrap > span {
239
+ white-space: nowrap;
240
+ }
241
+ .gridui-u-button--\[\&_\>_span\]\:\[writing-mode\:vertical-rl\] > span {
242
+ writing-mode: vertical-rl;
243
+ }
244
+ .gridui-u-button--\[\&_svg\]\:pointer-events-none svg {
245
+ pointer-events: none;
246
+ }
247
+ .gridui-u-button--\[\&_svg\]\:h-\(--gridui-button-icon-size\) svg {
248
+ height: var(--gridui-button-icon-size);
249
+ }
250
+ .gridui-u-button--\[\&_svg\]\:w-\(--gridui-button-icon-size\) svg {
251
+ width: var(--gridui-button-icon-size);
252
+ }
253
+ .gridui-u-button--\[\&_svg\]\:shrink-0 svg {
254
+ flex-shrink: 0;
255
+ }
256
+ .gridui-u-button--\[\&\.gridui-button-extra-large\]\:h-18.gridui-button-extra-large {
257
+ height: calc(var(--spacing) * 18);
258
+ }
259
+ .gridui-u-button--\[\&\.gridui-button-extra-large\]\:w-18.gridui-button-extra-large {
260
+ width: calc(var(--spacing) * 18);
261
+ }
262
+ .gridui-u-button--\[\&\.gridui-button-large\]\:h-gridui-control-large.gridui-button-large {
263
+ height: var(--gridui-control-min-height-large);
264
+ }
265
+ .gridui-u-button--\[\&\.gridui-button-large\]\:w-gridui-control-large.gridui-button-large {
266
+ width: var(--gridui-control-min-height-large);
267
+ }
268
+ .gridui-u-button--\[\&\.gridui-button-small\]\:h-gridui-control-small.gridui-button-small {
269
+ height: var(--gridui-control-min-height-small);
270
+ }
271
+ .gridui-u-button--\[\&\.gridui-button-small\]\:w-gridui-control-small.gridui-button-small {
272
+ width: var(--gridui-control-min-height-small);
273
+ }
274
+ @media (pointer: coarse) {
275
+ .gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:h-gridui-control.gridui-button-small {
276
+ height: var(--gridui-control-min-height);
277
+ }
278
+ .gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:w-gridui-control.gridui-button-small {
279
+ width: var(--gridui-control-min-height);
280
+ }
281
+ }
282
+ }
283
+ @layer components {
284
+ .gridui-button {
285
+ border: 1px solid transparent;
286
+ }
287
+ .gridui-button-cell {
288
+ border: 0;
289
+ }
290
+ .gridui-button-label-content {
291
+ display: inline-flex;
292
+ min-width: 0;
293
+ flex-direction: inherit;
294
+ align-items: inherit;
295
+ justify-content: inherit;
296
+ gap: inherit;
297
+ }
298
+ .gridui-button-body {
299
+ display: inline-flex;
300
+ flex: 1;
301
+ min-width: 0;
302
+ flex-direction: inherit;
303
+ align-items: inherit;
304
+ justify-content: inherit;
305
+ gap: inherit;
306
+ }
307
+ .gridui-button:is(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled]) > .gridui-button-content, .gridui-button:is(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled]) > .gridui-button-start-region > .gridui-button-content, .gridui-button:is(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled]) > .gridui-button-end-region > .gridui-button-content {
308
+ opacity: 0.5;
309
+ }
310
+ .gridui-button-start-region {
311
+ min-width: calc(var(--gridui-button-icon-size) + var(--gridui-space-16));
312
+ border-inline-end: 1px solid;
313
+ border-color: inherit;
314
+ }
315
+ .gridui-button-end-region {
316
+ border-inline-start: 1px solid;
317
+ border-color: inherit;
318
+ }
319
+ @media (prefers-reduced-motion: no-preference) {
320
+ .gridui-button-icon-motion-outward:not(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled], [aria-readonly="true"], [data-readonly], [readonly]) .gridui-button-end-icon {
321
+ transition: var(--gridui-motion-transition, transform calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out));
322
+ }
323
+ .gridui-button-icon-motion-outward:not(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled], [aria-readonly="true"], [data-readonly], [readonly]):hover .gridui-button-end-icon {
324
+ transform: var(--gridui-motion-transform, translate(var(--gridui-space-4), calc(-1 * var(--gridui-space-4))));
325
+ }
326
+ .gridui-button-icon-motion-outward:not(:disabled, [aria-disabled="true"]:not([data-gridui-busy]), [data-disabled], [aria-readonly="true"], [data-readonly], [readonly]):dir(rtl):hover .gridui-button-end-icon {
327
+ transform: var(--gridui-motion-transform, translate(calc(-1 * var(--gridui-space-4)), calc(-1 * var(--gridui-space-4))));
328
+ }
329
+ }
330
+ .gridui-button-group {
331
+ --gridui-button-group-padding-block: var(--gridui-space-24);
332
+ container: gridui-button-group / inline-size;
333
+ min-width: 0;
334
+ }
335
+ .gridui-button-group-items {
336
+ display: grid;
337
+ grid-auto-flow: column;
338
+ grid-auto-columns: minmax(0, 1fr);
339
+ align-items: stretch;
340
+ }
341
+ .gridui-button-group-items[data-layout="standard"] {
342
+ gap: var(--gridui-space-8);
343
+ }
344
+ .gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item]:not([hidden]) ~ [data-gridui-button-group-item]:not([hidden])::before {
345
+ position: absolute;
346
+ inset-block: 0;
347
+ inset-inline-start: 0;
348
+ width: 1px;
349
+ background: var(--gridui-button-group-border, var(--gridui-border));
350
+ pointer-events: none;
351
+ content: "";
352
+ }
353
+ @container gridui-button-group (max-width: 20rem) {
354
+ .gridui-button-group-items {
355
+ grid-auto-flow: row;
356
+ grid-auto-rows: 1fr;
357
+ }
358
+ .gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item]:not([hidden]) ~ [data-gridui-button-group-item]:not([hidden])::before {
359
+ inset-block: 0 auto;
360
+ inset-inline: 0;
361
+ width: auto;
362
+ height: 1px;
363
+ }
364
+ }
365
+ }
366
+ @layer utilities {
367
+ .gridui-button-group-items > [data-gridui-button-group-item] {
368
+ position: relative;
369
+ width: 100%;
370
+ height: 100%;
371
+ min-width: 0;
372
+ }
373
+ .gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item] {
374
+ min-height: 2.75rem;
375
+ padding: var(--gridui-button-group-padding-block) var(--gridui-space-24);
376
+ border: 0;
377
+ border-radius: 0;
378
+ }
379
+ }
380
+ @property --tw-border-style {
381
+ syntax: "*";
382
+ inherits: false;
383
+ initial-value: solid;
384
+ }
385
+ @property --tw-duration {
386
+ syntax: "*";
387
+ inherits: false;
388
+ }
389
+ @property --tw-ease {
390
+ syntax: "*";
391
+ inherits: false;
392
+ }
393
+ @layer properties {
394
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
395
+ *, ::before, ::after, ::backdrop {
396
+ --tw-border-style: solid;
397
+ --tw-duration: initial;
398
+ --tw-ease: initial;
399
+ }
400
+ }
401
+ }
402
+
403
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
404
+ @layer properties;
405
+ @layer theme, base, components, utilities;
406
+ @layer theme {
407
+ :root, :host {
408
+ --spacing: 0.25rem;
409
+ }
410
+ }
411
+ @layer utilities {
412
+ .gridui-u-overlay--z-\(--gridui-z-popover\) {
413
+ z-index: var(--gridui-z-popover);
414
+ }
415
+ .gridui-u-overlay--flex {
416
+ display: flex;
417
+ }
418
+ .gridui-u-overlay--inline-flex {
419
+ display: inline-flex;
420
+ }
421
+ .gridui-u-overlay--size-gridui-16 {
422
+ width: var(--gridui-space-16);
423
+ height: var(--gridui-space-16);
424
+ }
425
+ .gridui-u-overlay--min-h-10 {
426
+ min-height: calc(var(--spacing) * 10);
427
+ }
428
+ .gridui-u-overlay--min-w-0 {
429
+ min-width: 0px;
430
+ }
431
+ .gridui-u-overlay--shrink-0 {
432
+ flex-shrink: 0;
433
+ }
434
+ .gridui-u-overlay--cursor-pointer {
435
+ cursor: pointer;
436
+ }
437
+ .gridui-u-overlay--items-center {
438
+ align-items: center;
439
+ }
440
+ .gridui-u-overlay--justify-center {
441
+ justify-content: center;
442
+ }
443
+ .gridui-u-overlay--gap-gridui-8 {
444
+ gap: var(--gridui-space-8);
445
+ }
446
+ .gridui-u-overlay--rounded-control {
447
+ border-radius: var(--gridui-control-radius);
448
+ }
449
+ .gridui-u-overlay--border {
450
+ border-style: var(--tw-border-style);
451
+ border-width: 1px;
452
+ }
453
+ .gridui-u-overlay--border-solid {
454
+ --tw-border-style: solid;
455
+ border-style: solid;
456
+ }
457
+ .gridui-u-overlay--border-border {
458
+ border-color: var(--gridui-border);
459
+ }
460
+ .gridui-u-overlay--bg-background {
461
+ background-color: var(--gridui-background);
462
+ }
463
+ .gridui-u-overlay--p-0 {
464
+ padding: 0px;
465
+ }
466
+ .gridui-u-overlay--p-gridui-8 {
467
+ padding: var(--gridui-space-8);
468
+ }
469
+ .gridui-u-overlay--px-gridui-8 {
470
+ padding-inline: var(--gridui-space-8);
471
+ }
472
+ .gridui-u-overlay--py-gridui-8 {
473
+ padding-block: var(--gridui-space-8);
474
+ }
475
+ .gridui-u-overlay--type-data {
476
+ font: var(--gridui-type-data);
477
+ font-family: var(--gridui-font-body);
478
+ letter-spacing: normal;
479
+ font-variant-numeric: tabular-nums;
480
+ }
481
+ .gridui-u-overlay--type-caption {
482
+ font: var(--gridui-type-caption);
483
+ font-family: var(--gridui-font-body);
484
+ letter-spacing: normal;
485
+ }
486
+ .gridui-u-overlay--wrap-anywhere {
487
+ overflow-wrap: anywhere;
488
+ }
489
+ .gridui-u-overlay--whitespace-normal {
490
+ white-space: normal;
491
+ }
492
+ .gridui-u-overlay--text-foreground {
493
+ color: var(--gridui-foreground);
494
+ }
495
+ .gridui-u-overlay--text-inherit {
496
+ color: inherit;
497
+ }
498
+ .gridui-u-overlay--text-muted {
499
+ color: var(--gridui-muted);
500
+ }
501
+ .gridui-u-overlay--no-underline {
502
+ text-decoration-line: none;
503
+ }
504
+ .gridui-u-overlay--aria-selected\:bg-selection-background[aria-selected="true"] {
505
+ background-color: var(--gridui-selection-background);
506
+ }
507
+ .gridui-u-overlay--aria-\[current\=page\]\:bg-selection-background[aria-current="page"] {
508
+ background-color: var(--gridui-selection-background);
509
+ }
510
+ .gridui-u-overlay--data-disabled\:pointer-events-none[data-disabled] {
511
+ pointer-events: none;
512
+ }
513
+ .gridui-u-overlay--data-disabled\:opacity-50[data-disabled] {
514
+ opacity: 50%;
515
+ }
516
+ .gridui-u-overlay--data-\[state\=checked\]\:bg-selection-background[data-state="checked"] {
517
+ background-color: var(--gridui-selection-background);
518
+ }
519
+ }
520
+ @layer components {
521
+ .gridui-overlay-surface {
522
+ --gridui-surface-offset-x: 0px;
523
+ --gridui-surface-offset-y: 0px;
524
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
525
+ --gridui-overlay-fill-mode: both;
526
+ transform-origin: var(--gridui-overlay-origin, center);
527
+ }
528
+ .gridui-overlay-dialog {
529
+ --gridui-overlay-fill-mode: none;
530
+ transform-origin: center;
531
+ }
532
+ .gridui-overlay-tooltip {
533
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-quick);
534
+ }
535
+ .gridui-overlay-floating[data-side="bottom"] {
536
+ --gridui-surface-offset-y: calc(-1 * var(--gridui-motion-distance));
537
+ }
538
+ .gridui-overlay-floating[data-side="top"] {
539
+ --gridui-surface-offset-y: var(--gridui-motion-distance);
540
+ }
541
+ .gridui-overlay-floating[data-side="left"] {
542
+ --gridui-surface-offset-x: var(--gridui-motion-distance);
543
+ }
544
+ .gridui-overlay-floating[data-side="right"] {
545
+ --gridui-surface-offset-x: calc(-1 * var(--gridui-motion-distance));
546
+ }
547
+ .gridui-overlay-surface[data-state="closed"] {
548
+ pointer-events: none;
549
+ }
550
+ .gridui-overlay-surface:not([data-side="none"]):is([data-state="open"], [data-state="delayed-open"], [data-state="instant-open"]) {
551
+ animation: var(--gridui-motion-animation, gridui-surface-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
552
+ }
553
+ .gridui-overlay-surface:not([data-side="none"])[data-state="closed"] {
554
+ animation: var(--gridui-motion-animation, gridui-surface-exit calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
555
+ }
556
+ .gridui-overlay-backdrop {
557
+ background: var(--gridui-backdrop);
558
+ @supports (color: color-mix(in lab, red, red)) {
559
+ background: color-mix(in srgb, var(--gridui-backdrop) var(--gridui-backdrop-opacity), transparent);
560
+ }
561
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
562
+ --gridui-overlay-exit-duration: var(--gridui-motion-duration-quick);
563
+ --gridui-overlay-fill-mode: none;
564
+ }
565
+ .gridui-overlay-backdrop-deliberate {
566
+ --gridui-overlay-enter-duration: var(--gridui-motion-duration-deliberate);
567
+ --gridui-overlay-exit-duration: var(--gridui-motion-duration-normal);
568
+ --gridui-overlay-fill-mode: both;
569
+ }
570
+ .gridui-overlay-backdrop[data-state="open"] {
571
+ animation: var(--gridui-motion-animation, gridui-fade-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
572
+ }
573
+ .gridui-overlay-backdrop[data-state="closed"] {
574
+ animation: var(--gridui-motion-animation, gridui-fade-exit calc(var(--gridui-overlay-exit-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
575
+ }
576
+ @media (prefers-reduced-motion: reduce) {
577
+ .gridui-overlay-surface:not([data-side="none"])[data-state], .gridui-overlay-backdrop[data-state] {
578
+ animation: none;
579
+ }
580
+ }
581
+ }
582
+ @property --tw-border-style {
583
+ syntax: "*";
584
+ inherits: false;
585
+ initial-value: solid;
586
+ }
587
+ @layer properties {
588
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
589
+ *, ::before, ::after, ::backdrop {
590
+ --tw-border-style: solid;
591
+ }
592
+ }
593
+ }
594
+
1
595
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
596
  @layer theme, base, components, utilities;
3
597
  @layer theme {
@@ -0,0 +1,49 @@
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
+ @layer theme, base, components, utilities;
3
+ @layer theme {
4
+ :root, :host {
5
+ --container-3xl: 48rem;
6
+ }
7
+ }
8
+ @layer utilities {
9
+ .gridui-u-popover--z-\(--gridui-z-popover\) {
10
+ z-index: var(--gridui-z-popover);
11
+ }
12
+ .gridui-u-popover--box-border {
13
+ box-sizing: border-box;
14
+ }
15
+ .gridui-u-popover--max-h-\(--radix-popover-content-available-height\) {
16
+ max-height: var(--radix-popover-content-available-height);
17
+ }
18
+ .gridui-u-popover--w-3xl {
19
+ width: var(--container-3xl);
20
+ }
21
+ .gridui-u-popover--max-w-\[min\(calc\(100vw-2\*var\(--gridui-page-gutter\)\)\,var\(--radix-popover-content-available-width\)\)\] {
22
+ max-width: min(calc(100vw - 2 * var(--gridui-page-gutter)), var(--radix-popover-content-available-width));
23
+ }
24
+ .gridui-u-popover--overflow-y-auto {
25
+ overflow-y: auto;
26
+ }
27
+ .gridui-u-popover--overscroll-contain {
28
+ overscroll-behavior: contain;
29
+ }
30
+ .gridui-u-popover--rounded-control {
31
+ border-radius: var(--gridui-control-radius);
32
+ }
33
+ .gridui-u-popover--p-gridui-24 {
34
+ padding: var(--gridui-space-24);
35
+ }
36
+ .gridui-u-popover--type-supporting {
37
+ font: var(--gridui-type-supporting);
38
+ font-family: var(--gridui-font-body);
39
+ letter-spacing: normal;
40
+ }
41
+ .gridui-u-popover--data-\[state\=open\]\:bg-surface[data-state="open"] {
42
+ background-color: var(--gridui-surface);
43
+ }
44
+ }
45
+ @layer components {
46
+ .gridui-menu-panel {
47
+ --gridui-overlay-origin: var(--radix-popover-content-transform-origin);
48
+ }
49
+ }
package/docs/catalog.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/popover",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "category": "core",
6
6
  "description": "GridUI React popover",
7
- "usage": "Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after Theme and before this family.",
7
+ "usage": "Surface motion uses `@gridui/overlay`; its styles are included.",
8
8
  "documentation": [
9
9
  "README.md",
10
10
  "docs/reference/README.md",
@@ -72,6 +72,7 @@
72
72
  "@gridui/overlay/styles.css",
73
73
  "@gridui/popover/styles.css"
74
74
  ],
75
+ "styledImport": "@gridui/popover/styled",
75
76
  "examples": [
76
77
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/popover/stories/contextual-panels.mdx",
77
78
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/popover/stories/getting-started.mdx",
@@ -167,3 +167,7 @@ Default: ``16``
167
167
 
168
168
  ``("always" | "optimized") | undefined`` · Optional
169
169
 
170
+ ### container
171
+
172
+ ``Element | DocumentFragment | null | undefined`` · Optional
173
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/popover",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "GridUI React popover",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -10,14 +10,19 @@
10
10
  "docs"
11
11
  ],
12
12
  "sideEffects": [
13
- "**/*.css"
13
+ "**/*.css",
14
+ "./dist/styled.js"
14
15
  ],
15
16
  "exports": {
16
17
  ".": {
17
18
  "types": "./dist/index.d.ts",
18
19
  "import": "./dist/index.js"
19
20
  },
20
- "./styles.css": "./dist/styles.css"
21
+ "./styles.css": "./dist/styles.css",
22
+ "./styled": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/styled.js"
25
+ }
21
26
  },
22
27
  "publishConfig": {
23
28
  "access": "public"
@@ -27,13 +32,13 @@
27
32
  "react-dom": "^19.2.0"
28
33
  },
29
34
  "dependencies": {
30
- "@gridui/button": "^5.1.0",
31
- "@gridui/overlay": "^2.3.0",
35
+ "@gridui/button": "^5.2.0",
36
+ "@gridui/motion": "^1.0.2",
37
+ "@gridui/overlay": "^2.4.0",
32
38
  "@gridui/style-utils": "^4.0.0",
33
- "@gridui/theme": "^3.0.0",
39
+ "@gridui/theme": "^4.0.0",
34
40
  "@radix-ui/react-popover": "1.3.1",
35
- "class-variance-authority": "0.7.1",
36
- "@gridui/motion": "^1.0.1"
41
+ "class-variance-authority": "0.7.1"
37
42
  },
38
43
  "devDependencies": {
39
44
  "@gridui-internal/configuration": "0.0.0-internal",