@gridui/dropdown-menu 1.1.1 → 1.1.2
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 +2 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +28 -118
- package/docs/context-menu.md +25 -0
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@ Core family. Public API: `ContextMenu`, `ContextMenuProps`, `DropdownMenu`, `Dro
|
|
|
5
5
|
Import components from `@gridui/dropdown-menu` and load `@gridui/dropdown-menu/styles.css` after Theme.
|
|
6
6
|
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
|
-
See [component ownership](
|
|
8
|
+
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/dropdown-menu/.changeset/history).
|
|
9
9
|
|
|
10
10
|
## Buttons and dropdown menus
|
|
11
11
|
|
|
12
12
|
Import `Button`, `ButtonLink`, `buttonClass`, `useAsyncAction`, and `downloadBlob`
|
|
13
|
-
from [`@gridui/button`](
|
|
13
|
+
from [`@gridui/button`](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/button/README.md). Load that package's `styles.css`
|
|
14
14
|
for standalone buttons and composed actions. The Button package owns
|
|
15
15
|
native semantics, variants, sizes, icons, loading, and action lifecycle behavior.
|
|
16
16
|
DropdownMenu uses Button through its public API.
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import { cva } from "class-variance-authority";
|
|
|
26
26
|
var dropdownContentStyles = cva(cn(
|
|
27
27
|
overlaySurfaceStyles(),
|
|
28
28
|
"gridui-dropdown-content",
|
|
29
|
-
"z-(--gridui-z-popover) min-w-44 max-w-[calc(100vw-2*var(--gridui-page-gutter))] max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto p-gridui-4 type-data"
|
|
29
|
+
"gridui-u-z-(--gridui-z-popover) gridui-u-min-w-44 gridui-u-max-w-[calc(100vw-2*var(--gridui-page-gutter))] gridui-u-max-h-(--radix-dropdown-menu-content-available-height) gridui-u-overflow-y-auto gridui-u-p-gridui-4 gridui-u-type-data"
|
|
30
30
|
));
|
|
31
31
|
|
|
32
32
|
// src/dropdown-menu-content/dropdown-menu-content.tsx
|
|
@@ -172,9 +172,9 @@ import { cn as cn3 } from "@gridui/style-utils";
|
|
|
172
172
|
import { cva as cva2 } from "class-variance-authority";
|
|
173
173
|
var dropdownItemStyles = cva2(cn3(
|
|
174
174
|
"gridui-dropdown-item",
|
|
175
|
-
"flex min-h-10 items-center gap-gridui-8 px-gridui-8 py-gridui-8 rounded-xs text-inherit no-underline outline-none cursor-pointer",
|
|
176
|
-
"data-highlighted:bg-surface data-highlighted:[box-shadow:inset_0_0_0_1px_var(--gridui-border)]",
|
|
177
|
-
"data-disabled:opacity-50 data-disabled:pointer-events-none"
|
|
175
|
+
"gridui-u-flex gridui-u-min-h-10 gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-px-gridui-8 gridui-u-py-gridui-8 gridui-u-rounded-xs gridui-u-text-inherit gridui-u-no-underline gridui-u-outline-none gridui-u-cursor-pointer",
|
|
176
|
+
"gridui-u-data-highlighted:bg-surface gridui-u-data-highlighted:[box-shadow:inset_0_0_0_1px_var(--gridui-border)]",
|
|
177
|
+
"gridui-u-data-disabled:opacity-50 gridui-u-data-disabled:pointer-events-none"
|
|
178
178
|
));
|
|
179
179
|
|
|
180
180
|
// src/dropdown-menu-item/dropdown-menu-item.tsx
|
|
@@ -200,7 +200,7 @@ import { cn as cn5 } from "@gridui/style-utils";
|
|
|
200
200
|
import { cva as cva3 } from "class-variance-authority";
|
|
201
201
|
var dropdownLabelStyles = cva3(cn5(
|
|
202
202
|
"gridui-dropdown-label",
|
|
203
|
-
"p-gridui-8 text-muted type-caption"
|
|
203
|
+
"gridui-u-p-gridui-8 gridui-u-text-muted gridui-u-type-caption"
|
|
204
204
|
));
|
|
205
205
|
|
|
206
206
|
// src/dropdown-menu-label/dropdown-menu-label.tsx
|
|
@@ -238,7 +238,7 @@ import { cn as cn7 } from "@gridui/style-utils";
|
|
|
238
238
|
import { cva as cva4 } from "class-variance-authority";
|
|
239
239
|
var dropdownIndicatorStyles = cva4(cn7(
|
|
240
240
|
"gridui-dropdown-indicator",
|
|
241
|
-
"w-gridui-16 shrink-0 text-foreground"
|
|
241
|
+
"gridui-u-w-gridui-16 gridui-u-shrink-0 gridui-u-text-foreground"
|
|
242
242
|
));
|
|
243
243
|
|
|
244
244
|
// src/dropdown-menu-radio-item/dropdown-menu-radio-item.tsx
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/dropdown-menu/dropdown-menu.tsx", "../src/dropdown-menu-content/style.ts", "../src/dropdown-menu-content/dropdown-menu-content.tsx", "../src/dropdown-menu-trigger/dropdown-menu-trigger.tsx", "../src/context-menu/context-menu.tsx", "../src/shared/style.ts", "../src/dropdown-menu-item/dropdown-menu-item.tsx", "../src/dropdown-menu-label/style.ts", "../src/dropdown-menu-label/dropdown-menu-label.tsx", "../src/dropdown-menu-radio-group/dropdown-menu-radio-group.tsx", "../src/dropdown-menu-radio-item/style.ts", "../src/dropdown-menu-radio-item/dropdown-menu-radio-item.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenu\n * @description Dropdown Menu\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuProps = ComponentPropsWithRef<typeof Primitive.Root>;\n\nexport const DropdownMenu: FC<DropdownMenuProps> = (props: DropdownMenuProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Primitive.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuContent\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 dropdownContentStyles = cva(cn(\n overlaySurfaceStyles(),\n \"gridui-dropdown-content\",\n \"z-(--gridui-z-popover) min-w-44 max-w-[calc(100vw-2*var(--gridui-page-gutter))] max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto p-gridui-4 type-data\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuContent\n * @description Dropdown Menu Content\n */\n\nimport { dropdownContentStyles } from \"./style\";\nimport { RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuContentProps = ComponentPropsWithRef<typeof Primitive.Content>;\n\nexport const DropdownMenuContent: FC<DropdownMenuContentProps> = (props: DropdownMenuContentProps) => {\n const {\n className,\n forceMount,\n sideOffset = 8,\n align = \"end\",\n ...restProps\n } = props;\n const content = (<Primitive.Content\n {...restProps}\n forceMount={forceMount}\n align={align}\n sideOffset={sideOffset}\n className={cn(dropdownContentStyles(), className)}\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 Dropdown Menu\n * @namespace DropdownMenuTrigger\n * @description Dropdown Menu Trigger\n */\n\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuTriggerProps = ComponentPropsWithRef<typeof Primitive.Trigger>;\n\nexport const DropdownMenuTrigger: FC<DropdownMenuTriggerProps> = (props: DropdownMenuTriggerProps) => {\n return (<Primitive.Trigger\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace ContextMenu\n * @description Context Menu\n */\n\nimport { DropdownMenu } from \"../dropdown-menu/dropdown-menu\";\nimport { DropdownMenuContent, type DropdownMenuContentProps } from \"../dropdown-menu-content/dropdown-menu-content\";\nimport { DropdownMenuTrigger } from \"../dropdown-menu-trigger/dropdown-menu-trigger\";\nimport { type FC, type ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nexport type ContextMenuProps = Omit<DropdownMenuContentProps, \"children\"> & {\n readonly x: number;\n readonly y: number;\n readonly label: string;\n readonly children: ReactNode;\n readonly onClose: () => void;\n};\n\n/** Uses the same menu semantics and presentation as trigger-based dropdowns. */\nexport const ContextMenu: FC<ContextMenuProps> = (props: ContextMenuProps) => {\n const { x, y, label, children, onClose, onCloseAutoFocus, onKeyDown, ...contentProps } = props;\n\n const [returnFocus] = useState(() => {\n return typeof document === \"undefined\" ? null : document.activeElement;\n });\n useEffect(() => {\n\n const dismissWhenInactive = () => {\n\n if (!document.hasFocus()) {\n onClose();\n }\n };\n window.addEventListener(\"blur\", dismissWhenInactive);\n\n return () => {\n\n window.removeEventListener(\"blur\", dismissWhenInactive);\n };\n }, [onClose]);\n\n if (typeof document === \"undefined\") {\n return null;\n }\n return createPortal((<DropdownMenu\n key={`${x}:${y}`}\n open\n modal={false}\n onOpenChange={open => {\n\n if (!open) {\n onClose();\n }\n }}\n >\n <DropdownMenuTrigger\n asChild\n >\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n style={{\n position: \"fixed\",\n left: x,\n top: y,\n width: 0,\n height: 0,\n padding: 0,\n border: 0,\n opacity: 0,\n pointerEvents: \"none\",\n }}\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n aria-label={label}\n side=\"bottom\"\n align=\"start\"\n sideOffset={0}\n collisionPadding={8}\n {...contentProps}\n onCloseAutoFocus={event => {\n onCloseAutoFocus?.(event);\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (document.activeElement === document.body\n && returnFocus instanceof HTMLElement\n && returnFocus.isConnected) {\n returnFocus.focus();\n }\n }}\n onKeyDown={event => {\n\n onKeyDown?.(event);\n if (!event.defaultPrevented && event.key === \"Tab\") {\n event.preventDefault();\n onClose();\n }\n }}\n >\n {children}\n </DropdownMenuContent>\n </DropdownMenu>), document.body);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace Shared\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dropdownItemStyles = cva(cn(\n \"gridui-dropdown-item\",\n \"flex min-h-10 items-center gap-gridui-8 px-gridui-8 py-gridui-8 rounded-xs text-inherit no-underline outline-none cursor-pointer\",\n \"data-highlighted:bg-surface data-highlighted:[box-shadow:inset_0_0_0_1px_var(--gridui-border)]\",\n \"data-disabled:opacity-50 data-disabled:pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuItem\n * @description Dropdown Menu Item\n */\n\nimport { dropdownItemStyles } from \"../shared/style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuItemProps = ComponentPropsWithRef<typeof Primitive.Item>;\n\nexport const DropdownMenuItem: FC<DropdownMenuItemProps> = (props: DropdownMenuItemProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Primitive.Item\n {...restProps}\n className={cn(dropdownItemStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuLabel\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dropdownLabelStyles = cva(cn(\n \"gridui-dropdown-label\",\n \"p-gridui-8 text-muted type-caption\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuLabel\n * @description Dropdown Menu Label\n */\n\nimport { dropdownLabelStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuLabelProps = ComponentPropsWithRef<typeof Primitive.Label>;\n\nexport const DropdownMenuLabel: FC<DropdownMenuLabelProps> = (props: DropdownMenuLabelProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Primitive.Label\n {...restProps}\n className={cn(dropdownLabelStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuRadioGroup\n * @description Dropdown Menu Radio Group\n */\n\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuRadioGroupProps = ComponentPropsWithRef<typeof Primitive.RadioGroup>;\n\nexport const DropdownMenuRadioGroup: FC<DropdownMenuRadioGroupProps> = (props: DropdownMenuRadioGroupProps) => {\n return (<Primitive.RadioGroup\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuRadioItem\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dropdownIndicatorStyles = cva(cn(\n \"gridui-dropdown-indicator\",\n \"w-gridui-16 shrink-0 text-foreground\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuRadioItem\n * @description Dropdown Menu Radio Item\n */\n\nimport { dropdownItemStyles } from \"../shared/style\";\nimport { dropdownIndicatorStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check } from \"lucide-react\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuRadioItemProps = ComponentPropsWithRef<typeof Primitive.RadioItem>;\n\nexport const DropdownMenuRadioItem: FC<DropdownMenuRadioItemProps> = (props: DropdownMenuRadioItemProps) => {\n const {\n className,\n children,\n ...restProps\n } = props;\n return (<Primitive.RadioItem\n {...restProps}\n className={cn(dropdownItemStyles(), className)}\n >\n <span\n className={cn(dropdownIndicatorStyles())}\n aria-hidden=\"true\"\n >\n <Primitive.ItemIndicator>\n <Check\n size={16}\n aria-hidden=\"true\"\n />\n </Primitive.ItemIndicator>\n </span>\n {children}\n </Primitive.RadioItem>);\n};\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenu\n * @description Dropdown Menu\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuProps = ComponentPropsWithRef<typeof Primitive.Root>;\n\nexport const DropdownMenu: FC<DropdownMenuProps> = (props: DropdownMenuProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Primitive.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuContent\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 dropdownContentStyles = cva(cn(\n overlaySurfaceStyles(),\n \"gridui-dropdown-content\",\n \"gridui-u-z-(--gridui-z-popover) gridui-u-min-w-44 gridui-u-max-w-[calc(100vw-2*var(--gridui-page-gutter))] gridui-u-max-h-(--radix-dropdown-menu-content-available-height) gridui-u-overflow-y-auto gridui-u-p-gridui-4 gridui-u-type-data\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuContent\n * @description Dropdown Menu Content\n */\n\nimport { dropdownContentStyles } from \"./style\";\nimport { RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuContentProps = ComponentPropsWithRef<typeof Primitive.Content>;\n\nexport const DropdownMenuContent: FC<DropdownMenuContentProps> = (props: DropdownMenuContentProps) => {\n const {\n className,\n forceMount,\n sideOffset = 8,\n align = \"end\",\n ...restProps\n } = props;\n const content = (<Primitive.Content\n {...restProps}\n forceMount={forceMount}\n align={align}\n sideOffset={sideOffset}\n className={cn(dropdownContentStyles(), className)}\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 Dropdown Menu\n * @namespace DropdownMenuTrigger\n * @description Dropdown Menu Trigger\n */\n\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuTriggerProps = ComponentPropsWithRef<typeof Primitive.Trigger>;\n\nexport const DropdownMenuTrigger: FC<DropdownMenuTriggerProps> = (props: DropdownMenuTriggerProps) => {\n return (<Primitive.Trigger\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace ContextMenu\n * @description Context Menu\n */\n\nimport { DropdownMenu } from \"../dropdown-menu/dropdown-menu\";\nimport { DropdownMenuContent, type DropdownMenuContentProps } from \"../dropdown-menu-content/dropdown-menu-content\";\nimport { DropdownMenuTrigger } from \"../dropdown-menu-trigger/dropdown-menu-trigger\";\nimport { type FC, type ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nexport type ContextMenuProps = Omit<DropdownMenuContentProps, \"children\"> & {\n readonly x: number;\n readonly y: number;\n readonly label: string;\n readonly children: ReactNode;\n readonly onClose: () => void;\n};\n\n/** Uses the same menu semantics and presentation as trigger-based dropdowns. */\nexport const ContextMenu: FC<ContextMenuProps> = (props: ContextMenuProps) => {\n const { x, y, label, children, onClose, onCloseAutoFocus, onKeyDown, ...contentProps } = props;\n\n const [returnFocus] = useState(() => {\n return typeof document === \"undefined\" ? null : document.activeElement;\n });\n useEffect(() => {\n\n const dismissWhenInactive = () => {\n\n if (!document.hasFocus()) {\n onClose();\n }\n };\n window.addEventListener(\"blur\", dismissWhenInactive);\n\n return () => {\n\n window.removeEventListener(\"blur\", dismissWhenInactive);\n };\n }, [onClose]);\n\n if (typeof document === \"undefined\") {\n return null;\n }\n return createPortal((<DropdownMenu\n key={`${x}:${y}`}\n open\n modal={false}\n onOpenChange={open => {\n\n if (!open) {\n onClose();\n }\n }}\n >\n <DropdownMenuTrigger\n asChild\n >\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n style={{\n position: \"fixed\",\n left: x,\n top: y,\n width: 0,\n height: 0,\n padding: 0,\n border: 0,\n opacity: 0,\n pointerEvents: \"none\",\n }}\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n aria-label={label}\n side=\"bottom\"\n align=\"start\"\n sideOffset={0}\n collisionPadding={8}\n {...contentProps}\n onCloseAutoFocus={event => {\n onCloseAutoFocus?.(event);\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (document.activeElement === document.body\n && returnFocus instanceof HTMLElement\n && returnFocus.isConnected) {\n returnFocus.focus();\n }\n }}\n onKeyDown={event => {\n\n onKeyDown?.(event);\n if (!event.defaultPrevented && event.key === \"Tab\") {\n event.preventDefault();\n onClose();\n }\n }}\n >\n {children}\n </DropdownMenuContent>\n </DropdownMenu>), document.body);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace Shared\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dropdownItemStyles = cva(cn(\n \"gridui-dropdown-item\",\n \"gridui-u-flex gridui-u-min-h-10 gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-px-gridui-8 gridui-u-py-gridui-8 gridui-u-rounded-xs gridui-u-text-inherit gridui-u-no-underline gridui-u-outline-none gridui-u-cursor-pointer\",\n \"gridui-u-data-highlighted:bg-surface gridui-u-data-highlighted:[box-shadow:inset_0_0_0_1px_var(--gridui-border)]\",\n \"gridui-u-data-disabled:opacity-50 gridui-u-data-disabled:pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuItem\n * @description Dropdown Menu Item\n */\n\nimport { dropdownItemStyles } from \"../shared/style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuItemProps = ComponentPropsWithRef<typeof Primitive.Item>;\n\nexport const DropdownMenuItem: FC<DropdownMenuItemProps> = (props: DropdownMenuItemProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Primitive.Item\n {...restProps}\n className={cn(dropdownItemStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuLabel\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dropdownLabelStyles = cva(cn(\n \"gridui-dropdown-label\",\n \"gridui-u-p-gridui-8 gridui-u-text-muted gridui-u-type-caption\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuLabel\n * @description Dropdown Menu Label\n */\n\nimport { dropdownLabelStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuLabelProps = ComponentPropsWithRef<typeof Primitive.Label>;\n\nexport const DropdownMenuLabel: FC<DropdownMenuLabelProps> = (props: DropdownMenuLabelProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Primitive.Label\n {...restProps}\n className={cn(dropdownLabelStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuRadioGroup\n * @description Dropdown Menu Radio Group\n */\n\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuRadioGroupProps = ComponentPropsWithRef<typeof Primitive.RadioGroup>;\n\nexport const DropdownMenuRadioGroup: FC<DropdownMenuRadioGroupProps> = (props: DropdownMenuRadioGroupProps) => {\n return (<Primitive.RadioGroup\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuRadioItem\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dropdownIndicatorStyles = cva(cn(\n \"gridui-dropdown-indicator\",\n \"gridui-u-w-gridui-16 gridui-u-shrink-0 gridui-u-text-foreground\",\n));\n", "/**\n * @author WMXPY\n * @package Dropdown Menu\n * @namespace DropdownMenuRadioItem\n * @description Dropdown Menu Radio Item\n */\n\nimport { dropdownItemStyles } from \"../shared/style\";\nimport { dropdownIndicatorStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check } from \"lucide-react\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DropdownMenuRadioItemProps = ComponentPropsWithRef<typeof Primitive.RadioItem>;\n\nexport const DropdownMenuRadioItem: FC<DropdownMenuRadioItemProps> = (props: DropdownMenuRadioItemProps) => {\n const {\n className,\n children,\n ...restProps\n } = props;\n return (<Primitive.RadioItem\n {...restProps}\n className={cn(dropdownItemStyles(), className)}\n >\n <span\n className={cn(dropdownIndicatorStyles())}\n aria-hidden=\"true\"\n >\n <Primitive.ItemIndicator>\n <Check\n size={16}\n aria-hidden=\"true\"\n />\n </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ACJ,SAAQ,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWF,IAAG,oBAAoB,GAAG,SAAS;AAAA;AAAA,EAClD;AACJ;;;AChBA,YAAYG,gBAAe;AAMf,gBAAAC,YAAA;AADL,IAAM,yBAA0D,CAAC,UAAuC;AAC3G,SAAQ,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA;AAAA,EACR;AACJ;;;ACTA,SAAS,MAAAC,WAAU;AACnB,SAAS,OAAAC,YAAW;AAEb,IAAM,0BAA0BA,KAAID;AAAA,EACvC;AAAA,EACA;AACJ,CAAC;;;ACJD,SAAS,MAAAE,WAAU;AACnB,YAAYC,gBAAe;AAC3B,SAAS,aAAa;AAWV,SASI,OAAAC,MATJ,QAAAC,aAAA;AANL,IAAM,wBAAwD,CAAC,UAAsC;AACxG,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWH,IAAG,mBAAmB,GAAG,SAAS;AAAA,MAE7C;AAAA,wBAAAE;AAAA,UAAC;AAAA;AAAA,YACG,WAAWF,IAAG,wBAAwB,CAAC;AAAA,YACvC,eAAY;AAAA,YAEZ,0BAAAE,KAAW,0BAAV,EACG,0BAAAA;AAAA,cAAC;AAAA;AAAA,gBACG,MAAM;AAAA,gBACN,eAAY;AAAA;AAAA,YAChB,GACJ;AAAA;AAAA,QACJ;AAAA,QACC;AAAA;AAAA;AAAA,EACL;AACJ;",
|
|
6
6
|
"names": ["cn", "Primitive", "jsx", "Primitive", "jsx", "jsx", "cn", "cva", "cn", "Primitive", "jsx", "cn", "cva", "cn", "Primitive", "jsx", "Primitive", "jsx", "cn", "cva", "cn", "Primitive", "jsx", "jsxs"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties;
|
|
3
2
|
@layer theme, base, components, utilities;
|
|
4
3
|
@layer theme {
|
|
5
4
|
:root, :host {
|
|
@@ -8,103 +7,92 @@
|
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
9
|
@layer utilities {
|
|
11
|
-
.
|
|
12
|
-
position: fixed;
|
|
13
|
-
}
|
|
14
|
-
.z-\(--gridui-z-popover\) {
|
|
10
|
+
.gridui-u-z-\(--gridui-z-popover\) {
|
|
15
11
|
z-index: var(--gridui-z-popover);
|
|
16
12
|
}
|
|
17
|
-
.flex {
|
|
13
|
+
.gridui-u-flex {
|
|
18
14
|
display: flex;
|
|
19
15
|
}
|
|
20
|
-
.max-h-\(--radix-dropdown-menu-content-available-height\) {
|
|
16
|
+
.gridui-u-max-h-\(--radix-dropdown-menu-content-available-height\) {
|
|
21
17
|
max-height: var(--radix-dropdown-menu-content-available-height);
|
|
22
18
|
}
|
|
23
|
-
.min-h-10 {
|
|
19
|
+
.gridui-u-min-h-10 {
|
|
24
20
|
min-height: calc(var(--spacing) * 10);
|
|
25
21
|
}
|
|
26
|
-
.w-gridui-16 {
|
|
22
|
+
.gridui-u-w-gridui-16 {
|
|
27
23
|
width: var(--gridui-space-16);
|
|
28
24
|
}
|
|
29
|
-
.max-w-\[calc\(100vw-2\*var\(--gridui-page-gutter\)\)\] {
|
|
25
|
+
.gridui-u-max-w-\[calc\(100vw-2\*var\(--gridui-page-gutter\)\)\] {
|
|
30
26
|
max-width: calc(100vw - 2 * var(--gridui-page-gutter));
|
|
31
27
|
}
|
|
32
|
-
.min-w-44 {
|
|
28
|
+
.gridui-u-min-w-44 {
|
|
33
29
|
min-width: calc(var(--spacing) * 44);
|
|
34
30
|
}
|
|
35
|
-
.shrink-0 {
|
|
31
|
+
.gridui-u-shrink-0 {
|
|
36
32
|
flex-shrink: 0;
|
|
37
33
|
}
|
|
38
|
-
.cursor-pointer {
|
|
34
|
+
.gridui-u-cursor-pointer {
|
|
39
35
|
cursor: pointer;
|
|
40
36
|
}
|
|
41
|
-
.items-center {
|
|
37
|
+
.gridui-u-items-center {
|
|
42
38
|
align-items: center;
|
|
43
39
|
}
|
|
44
|
-
.gap-gridui-8 {
|
|
40
|
+
.gridui-u-gap-gridui-8 {
|
|
45
41
|
gap: var(--gridui-space-8);
|
|
46
42
|
}
|
|
47
|
-
.overflow-y-auto {
|
|
43
|
+
.gridui-u-overflow-y-auto {
|
|
48
44
|
overflow-y: auto;
|
|
49
45
|
}
|
|
50
|
-
.rounded-xs {
|
|
46
|
+
.gridui-u-rounded-xs {
|
|
51
47
|
border-radius: var(--radius-xs);
|
|
52
48
|
}
|
|
53
|
-
.
|
|
54
|
-
border-style: var(--tw-border-style);
|
|
55
|
-
border-width: 1px;
|
|
56
|
-
}
|
|
57
|
-
.p-gridui-4 {
|
|
49
|
+
.gridui-u-p-gridui-4 {
|
|
58
50
|
padding: var(--gridui-space-4);
|
|
59
51
|
}
|
|
60
|
-
.p-gridui-8 {
|
|
52
|
+
.gridui-u-p-gridui-8 {
|
|
61
53
|
padding: var(--gridui-space-8);
|
|
62
54
|
}
|
|
63
|
-
.px-gridui-8 {
|
|
55
|
+
.gridui-u-px-gridui-8 {
|
|
64
56
|
padding-inline: var(--gridui-space-8);
|
|
65
57
|
}
|
|
66
|
-
.py-gridui-8 {
|
|
58
|
+
.gridui-u-py-gridui-8 {
|
|
67
59
|
padding-block: var(--gridui-space-8);
|
|
68
60
|
}
|
|
69
|
-
.type-data {
|
|
61
|
+
.gridui-u-type-data {
|
|
70
62
|
font: var(--gridui-type-data);
|
|
71
63
|
letter-spacing: normal;
|
|
72
64
|
font-variant-numeric: tabular-nums;
|
|
73
65
|
}
|
|
74
|
-
.type-caption {
|
|
66
|
+
.gridui-u-type-caption {
|
|
75
67
|
font: var(--gridui-type-caption);
|
|
76
68
|
letter-spacing: normal;
|
|
77
69
|
}
|
|
78
|
-
.text-foreground {
|
|
70
|
+
.gridui-u-text-foreground {
|
|
79
71
|
color: var(--gridui-foreground);
|
|
80
72
|
}
|
|
81
|
-
.text-inherit {
|
|
73
|
+
.gridui-u-text-inherit {
|
|
82
74
|
color: inherit;
|
|
83
75
|
}
|
|
84
|
-
.text-muted {
|
|
76
|
+
.gridui-u-text-muted {
|
|
85
77
|
color: var(--gridui-muted);
|
|
86
78
|
}
|
|
87
|
-
.no-underline {
|
|
79
|
+
.gridui-u-no-underline {
|
|
88
80
|
text-decoration-line: none;
|
|
89
81
|
}
|
|
90
|
-
.
|
|
91
|
-
--tw-blur: blur(8px);
|
|
92
|
-
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
93
|
-
}
|
|
94
|
-
.outline-none {
|
|
82
|
+
.gridui-u-outline-none {
|
|
95
83
|
--tw-outline-style: none;
|
|
96
84
|
outline-style: none;
|
|
97
85
|
}
|
|
98
|
-
.data-disabled\:pointer-events-none[data-disabled] {
|
|
86
|
+
.gridui-u-data-disabled\:pointer-events-none[data-disabled] {
|
|
99
87
|
pointer-events: none;
|
|
100
88
|
}
|
|
101
|
-
.data-disabled\:opacity-50[data-disabled] {
|
|
89
|
+
.gridui-u-data-disabled\:opacity-50[data-disabled] {
|
|
102
90
|
opacity: 50%;
|
|
103
91
|
}
|
|
104
|
-
.data-highlighted\:bg-surface[data-highlighted] {
|
|
92
|
+
.gridui-u-data-highlighted\:bg-surface[data-highlighted] {
|
|
105
93
|
background-color: var(--gridui-surface);
|
|
106
94
|
}
|
|
107
|
-
.data-highlighted\:\[box-shadow\:inset_0_0_0_1px_var\(--gridui-border\)\][data-highlighted] {
|
|
95
|
+
.gridui-u-data-highlighted\:\[box-shadow\:inset_0_0_0_1px_var\(--gridui-border\)\][data-highlighted] {
|
|
108
96
|
box-shadow: inset 0 0 0 1px var(--gridui-border);
|
|
109
97
|
}
|
|
110
98
|
}
|
|
@@ -113,81 +101,3 @@
|
|
|
113
101
|
--gridui-overlay-origin: var(--radix-dropdown-menu-content-transform-origin);
|
|
114
102
|
}
|
|
115
103
|
}
|
|
116
|
-
@property --tw-border-style {
|
|
117
|
-
syntax: "*";
|
|
118
|
-
inherits: false;
|
|
119
|
-
initial-value: solid;
|
|
120
|
-
}
|
|
121
|
-
@property --tw-blur {
|
|
122
|
-
syntax: "*";
|
|
123
|
-
inherits: false;
|
|
124
|
-
}
|
|
125
|
-
@property --tw-brightness {
|
|
126
|
-
syntax: "*";
|
|
127
|
-
inherits: false;
|
|
128
|
-
}
|
|
129
|
-
@property --tw-contrast {
|
|
130
|
-
syntax: "*";
|
|
131
|
-
inherits: false;
|
|
132
|
-
}
|
|
133
|
-
@property --tw-grayscale {
|
|
134
|
-
syntax: "*";
|
|
135
|
-
inherits: false;
|
|
136
|
-
}
|
|
137
|
-
@property --tw-hue-rotate {
|
|
138
|
-
syntax: "*";
|
|
139
|
-
inherits: false;
|
|
140
|
-
}
|
|
141
|
-
@property --tw-invert {
|
|
142
|
-
syntax: "*";
|
|
143
|
-
inherits: false;
|
|
144
|
-
}
|
|
145
|
-
@property --tw-opacity {
|
|
146
|
-
syntax: "*";
|
|
147
|
-
inherits: false;
|
|
148
|
-
}
|
|
149
|
-
@property --tw-saturate {
|
|
150
|
-
syntax: "*";
|
|
151
|
-
inherits: false;
|
|
152
|
-
}
|
|
153
|
-
@property --tw-sepia {
|
|
154
|
-
syntax: "*";
|
|
155
|
-
inherits: false;
|
|
156
|
-
}
|
|
157
|
-
@property --tw-drop-shadow {
|
|
158
|
-
syntax: "*";
|
|
159
|
-
inherits: false;
|
|
160
|
-
}
|
|
161
|
-
@property --tw-drop-shadow-color {
|
|
162
|
-
syntax: "*";
|
|
163
|
-
inherits: false;
|
|
164
|
-
}
|
|
165
|
-
@property --tw-drop-shadow-alpha {
|
|
166
|
-
syntax: "<percentage>";
|
|
167
|
-
inherits: false;
|
|
168
|
-
initial-value: 100%;
|
|
169
|
-
}
|
|
170
|
-
@property --tw-drop-shadow-size {
|
|
171
|
-
syntax: "*";
|
|
172
|
-
inherits: false;
|
|
173
|
-
}
|
|
174
|
-
@layer properties {
|
|
175
|
-
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
176
|
-
*, ::before, ::after, ::backdrop {
|
|
177
|
-
--tw-border-style: solid;
|
|
178
|
-
--tw-blur: initial;
|
|
179
|
-
--tw-brightness: initial;
|
|
180
|
-
--tw-contrast: initial;
|
|
181
|
-
--tw-grayscale: initial;
|
|
182
|
-
--tw-hue-rotate: initial;
|
|
183
|
-
--tw-invert: initial;
|
|
184
|
-
--tw-opacity: initial;
|
|
185
|
-
--tw-saturate: initial;
|
|
186
|
-
--tw-sepia: initial;
|
|
187
|
-
--tw-drop-shadow: initial;
|
|
188
|
-
--tw-drop-shadow-color: initial;
|
|
189
|
-
--tw-drop-shadow-alpha: 100%;
|
|
190
|
-
--tw-drop-shadow-size: initial;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Point-anchored context menu
|
|
2
|
+
|
|
3
|
+
Import `ContextMenu`, `ContextMenuProps`, and the existing `DropdownMenuItem`,
|
|
4
|
+
`DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, and `DropdownMenuLabel` from
|
|
5
|
+
`@gridui/dropdown-menu`. Load `@gridui/dropdown-menu/styles.css` after Theme.
|
|
6
|
+
|
|
7
|
+
Render `ContextMenu` only while open. Pass viewport `x` / `y` coordinates (for
|
|
8
|
+
example, `clientX` / `clientY`), an accessible `label`, menu children, and `onClose`
|
|
9
|
+
to clear the owner's open state. The owner decides which pointer or keyboard
|
|
10
|
+
interaction opens the menu and what each action does. For keyboard opening,
|
|
11
|
+
anchor to the invoking element's bounding rectangle.
|
|
12
|
+
|
|
13
|
+
The menu reuses dropdown keyboard navigation, disabled-item semantics, collision
|
|
14
|
+
handling, and item selection. It is nonmodal, closes on Escape, Tab, outside
|
|
15
|
+
interaction, or window focus loss, and portals its point anchor to the document
|
|
16
|
+
body so transformed application containers do not alter viewport coordinates.
|
|
17
|
+
It renders no server-side markup.
|
|
18
|
+
|
|
19
|
+
Content props such as `className`, `collisionPadding`, positioning options and
|
|
20
|
+
refs are forwarded. `onKeyDown` and `onCloseAutoFocus` are composed; preventing
|
|
21
|
+
their default cancels the library's corresponding behavior. Default close focus
|
|
22
|
+
returns to the element focused when mounted if focus has fallen back to the
|
|
23
|
+
body; it does not steal focus from an outside control. Focus the invoking element
|
|
24
|
+
before opening when it should be the return target. Consumers can override
|
|
25
|
+
return focus with `onCloseAutoFocus`.
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/dropdown-menu",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "GridUI React dropdown menu",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
+
"docs",
|
|
9
10
|
"README.md"
|
|
10
11
|
],
|
|
11
12
|
"sideEffects": [
|
|
@@ -26,16 +27,18 @@
|
|
|
26
27
|
"react-dom": "^19.2.0"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@gridui/overlay": "^1.1.
|
|
30
|
-
"@gridui/style-utils": "^2.1.
|
|
31
|
-
"@gridui/theme": "^2.2
|
|
30
|
+
"@gridui/overlay": "^1.1.2",
|
|
31
|
+
"@gridui/style-utils": "^2.1.4",
|
|
32
|
+
"@gridui/theme": "^2.3.2",
|
|
32
33
|
"@radix-ui/react-dropdown-menu": "2.2.1",
|
|
33
34
|
"class-variance-authority": "0.7.1",
|
|
34
|
-
"lucide-react": "1.
|
|
35
|
+
"lucide-react": "1.65.0"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
39
|
+
"@gridui/button": "2.2.0",
|
|
38
40
|
"@jest/globals": "30.5.2",
|
|
41
|
+
"@storybook/react-vite": "10.6.5",
|
|
39
42
|
"@types/jest": "30.0.0",
|
|
40
43
|
"@types/node": "26.6.6",
|
|
41
44
|
"@types/react": "19.3.0",
|