jaci-ui 0.7.0 → 0.9.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/CHANGELOG.md +12 -0
- package/README.md +75 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/components/alert-dialog/alert-dialog.cjs +4 -1
- package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.d.cts +2 -2
- package/dist/components/alert-dialog/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog/alert-dialog.js +4 -1
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/carousel/carousel.cjs +342 -0
- package/dist/components/carousel/carousel.cjs.map +1 -0
- package/dist/components/carousel/carousel.d.cts +44 -0
- package/dist/components/carousel/carousel.d.ts +44 -0
- package/dist/components/carousel/carousel.js +330 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/index.d.cts +2 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/code/code.cjs +32 -5
- package/dist/components/code/code.cjs.map +1 -1
- package/dist/components/code/code.d.cts +1 -0
- package/dist/components/code/code.d.ts +1 -0
- package/dist/components/code/code.js +34 -7
- package/dist/components/code/code.js.map +1 -1
- package/dist/components/color-picker/color-picker.cjs +4 -1
- package/dist/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/components/color-picker/color-picker.d.cts +2 -2
- package/dist/components/color-picker/color-picker.d.ts +2 -2
- package/dist/components/color-picker/color-picker.js +4 -1
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-swatch/color-swatch.cjs +33 -0
- package/dist/components/color-swatch/color-swatch.cjs.map +1 -0
- package/dist/components/color-swatch/color-swatch.d.cts +13 -0
- package/dist/components/color-swatch/color-swatch.d.ts +13 -0
- package/dist/components/color-swatch/color-swatch.js +33 -0
- package/dist/components/color-swatch/color-swatch.js.map +1 -0
- package/dist/components/color-swatch/index.d.cts +2 -0
- package/dist/components/color-swatch/index.d.ts +2 -0
- package/dist/components/combobox/combobox.cjs +4 -1
- package/dist/components/combobox/combobox.cjs.map +1 -1
- package/dist/components/combobox/combobox.d.cts +2 -2
- package/dist/components/combobox/combobox.d.ts +2 -2
- package/dist/components/combobox/combobox.js +4 -1
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/command/command.cjs +76 -13
- package/dist/components/command/command.cjs.map +1 -1
- package/dist/components/command/command.d.cts +7 -1
- package/dist/components/command/command.d.ts +7 -1
- package/dist/components/command/command.js +76 -13
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/command/index.d.cts +2 -2
- package/dist/components/command/index.d.ts +2 -2
- package/dist/components/context-menu/context-menu.cjs +4 -1
- package/dist/components/context-menu/context-menu.cjs.map +1 -1
- package/dist/components/context-menu/context-menu.d.cts +2 -2
- package/dist/components/context-menu/context-menu.d.ts +2 -2
- package/dist/components/context-menu/context-menu.js +4 -1
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/date-picker/date-picker.cjs +4 -1
- package/dist/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.d.cts +2 -2
- package/dist/components/date-picker/date-picker.d.ts +2 -2
- package/dist/components/date-picker/date-picker.js +4 -1
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.cjs +4 -1
- package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.cts +2 -2
- package/dist/components/date-range-picker/date-range-picker.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker.js +4 -1
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/dialog/dialog.cjs +4 -1
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.d.cts +2 -2
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/dialog.js +4 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/download-trigger/download-trigger.cjs +25 -0
- package/dist/components/download-trigger/download-trigger.cjs.map +1 -0
- package/dist/components/download-trigger/download-trigger.d.cts +12 -0
- package/dist/components/download-trigger/download-trigger.d.ts +12 -0
- package/dist/components/download-trigger/download-trigger.js +25 -0
- package/dist/components/download-trigger/download-trigger.js.map +1 -0
- package/dist/components/download-trigger/index.d.cts +2 -0
- package/dist/components/download-trigger/index.d.ts +2 -0
- package/dist/components/drawer/drawer.cjs +4 -1
- package/dist/components/drawer/drawer.cjs.map +1 -1
- package/dist/components/drawer/drawer.d.cts +2 -2
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.js +4 -1
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/figure/figure.cjs +45 -36
- package/dist/components/figure/figure.cjs.map +1 -1
- package/dist/components/figure/figure.js +45 -36
- package/dist/components/figure/figure.js.map +1 -1
- package/dist/components/image/image.cjs +41 -32
- package/dist/components/image/image.cjs.map +1 -1
- package/dist/components/image/image.js +41 -32
- package/dist/components/image/image.js.map +1 -1
- package/dist/components/menu/menu.cjs +4 -1
- package/dist/components/menu/menu.cjs.map +1 -1
- package/dist/components/menu/menu.d.cts +2 -2
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/menu/menu.js +4 -1
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/menubar/menubar.cjs +4 -1
- package/dist/components/menubar/menubar.cjs.map +1 -1
- package/dist/components/menubar/menubar.d.cts +2 -2
- package/dist/components/menubar/menubar.d.ts +2 -2
- package/dist/components/menubar/menubar.js +4 -1
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/navigation/navigation.cjs +3 -1
- package/dist/components/navigation/navigation.cjs.map +1 -1
- package/dist/components/navigation/navigation.js +3 -1
- package/dist/components/navigation/navigation.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.cjs +4 -1
- package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.cts +2 -2
- package/dist/components/navigation-menu/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu/navigation-menu.js +4 -1
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/popover/popover.cjs +4 -1
- package/dist/components/popover/popover.cjs.map +1 -1
- package/dist/components/popover/popover.d.cts +2 -2
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/popover.js +4 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/qr-code/index.d.cts +2 -0
- package/dist/components/qr-code/index.d.ts +2 -0
- package/dist/components/qr-code/qr-code.cjs +118 -0
- package/dist/components/qr-code/qr-code.cjs.map +1 -0
- package/dist/components/qr-code/qr-code.d.cts +17 -0
- package/dist/components/qr-code/qr-code.d.ts +17 -0
- package/dist/components/qr-code/qr-code.js +116 -0
- package/dist/components/qr-code/qr-code.js.map +1 -0
- package/dist/components/select/select.cjs +4 -1
- package/dist/components/select/select.cjs.map +1 -1
- package/dist/components/select/select.d.cts +2 -2
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +4 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/sidebar/sidebar.cjs +24 -17
- package/dist/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/sidebar/sidebar.d.cts +4 -2
- package/dist/components/sidebar/sidebar.d.ts +4 -2
- package/dist/components/sidebar/sidebar.js +24 -17
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/spacer/index.d.cts +2 -0
- package/dist/components/spacer/index.d.ts +2 -0
- package/dist/components/spacer/spacer.cjs +24 -0
- package/dist/components/spacer/spacer.cjs.map +1 -0
- package/dist/components/spacer/spacer.d.cts +10 -0
- package/dist/components/spacer/spacer.d.ts +10 -0
- package/dist/components/spacer/spacer.js +24 -0
- package/dist/components/spacer/spacer.js.map +1 -0
- package/dist/components/toast/toast.cjs +4 -1
- package/dist/components/toast/toast.cjs.map +1 -1
- package/dist/components/toast/toast.d.cts +1 -1
- package/dist/components/toast/toast.d.ts +1 -1
- package/dist/components/toast/toast.js +4 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/tooltip/tooltip.cjs +4 -1
- package/dist/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/components/tooltip/tooltip.d.cts +2 -2
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/tooltip.js +4 -1
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -0
- package/dist/styled-system/recipes/carousel.cjs +48 -0
- package/dist/styled-system/recipes/carousel.cjs.map +1 -0
- package/dist/styled-system/recipes/carousel.js +48 -0
- package/dist/styled-system/recipes/carousel.js.map +1 -0
- package/dist/styled-system/recipes/code.cjs +4 -2
- package/dist/styled-system/recipes/code.cjs.map +1 -1
- package/dist/styled-system/recipes/code.js +4 -2
- package/dist/styled-system/recipes/code.js.map +1 -1
- package/dist/styled-system/recipes/color-swatch.cjs +37 -0
- package/dist/styled-system/recipes/color-swatch.cjs.map +1 -0
- package/dist/styled-system/recipes/color-swatch.js +37 -0
- package/dist/styled-system/recipes/color-swatch.js.map +1 -0
- package/dist/styled-system/recipes/command.cjs +3 -3
- package/dist/styled-system/recipes/command.cjs.map +1 -1
- package/dist/styled-system/recipes/command.js +3 -3
- package/dist/styled-system/recipes/command.js.map +1 -1
- package/dist/styled-system/recipes/download-trigger.cjs +39 -0
- package/dist/styled-system/recipes/download-trigger.cjs.map +1 -0
- package/dist/styled-system/recipes/download-trigger.js +39 -0
- package/dist/styled-system/recipes/download-trigger.js.map +1 -0
- package/dist/styled-system/recipes/figure.cjs +1 -0
- package/dist/styled-system/recipes/figure.cjs.map +1 -1
- package/dist/styled-system/recipes/figure.js +1 -0
- package/dist/styled-system/recipes/figure.js.map +1 -1
- package/dist/styled-system/recipes/image.cjs +1 -0
- package/dist/styled-system/recipes/image.cjs.map +1 -1
- package/dist/styled-system/recipes/image.js +1 -0
- package/dist/styled-system/recipes/image.js.map +1 -1
- package/dist/styled-system/recipes/layout-spacer.cjs +88 -0
- package/dist/styled-system/recipes/layout-spacer.cjs.map +1 -0
- package/dist/styled-system/recipes/layout-spacer.js +88 -0
- package/dist/styled-system/recipes/layout-spacer.js.map +1 -0
- package/dist/styled-system/recipes/qr-code.cjs +25 -0
- package/dist/styled-system/recipes/qr-code.cjs.map +1 -0
- package/dist/styled-system/recipes/qr-code.js +25 -0
- package/dist/styled-system/recipes/qr-code.js.map +1 -0
- package/dist/styles.css +662 -106
- package/dist/theme/theme-provider.cjs +46 -8
- package/dist/theme/theme-provider.cjs.map +1 -1
- package/dist/theme/theme-provider.js +46 -8
- package/dist/theme/theme-provider.js.map +1 -1
- package/dist/theme/theme-scope.cjs +21 -0
- package/dist/theme/theme-scope.cjs.map +1 -0
- package/dist/theme/theme-scope.js +19 -0
- package/dist/theme/theme-scope.js.map +1 -0
- package/package.json +10 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","names":[],"sources":["../../../src/components/command/command.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ChangeEvent, ComponentPropsWithoutRef, KeyboardEvent, ReactNode } from \"react\";\n\nimport { command } from \"../../styled-system/recipes\";\nimport { cx } from \"../../styled-system/css\";\n\nexport type CommandFilter = (value: string, search: string, keywords: readonly string[]) => boolean;\n\ninterface CommandItemRecord {\n id: string;\n value: string;\n keywords: readonly string[];\n disabled: boolean;\n groupId: string | undefined;\n onSelect: ((value: string) => void) | undefined;\n element: HTMLDivElement | null;\n}\n\ninterface CommandContextValue {\n search: string;\n setSearch: (search: string) => void;\n loading: boolean;\n shouldFilter: boolean;\n items: readonly CommandItemRecord[];\n highlighted: string | null;\n listId: string;\n matches: (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) => boolean;\n handleKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n registerItem: (item: CommandItemRecord) => () => void;\n setItemElement: (id: string, element: HTMLDivElement | null) => void;\n setHighlighted: (value: string | null) => void;\n selectItem: (id: string) => void;\n disabled: boolean;\n}\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\nconst CommandGroupContext = createContext<string | undefined>(undefined);\nconst EMPTY_KEYWORDS: readonly string[] = [];\n\nfunction useCommandContext() {\n const context = useContext(CommandContext);\n if (!context) throw new Error(\"Command parts must be rendered inside Command.Root.\");\n return context;\n}\n\nfunction defaultFilter(value: string, search: string, keywords: readonly string[]) {\n const query = search.trim().toLocaleLowerCase();\n if (!query) return true;\n return [value, ...keywords].some((candidate) => candidate.toLocaleLowerCase().includes(query));\n}\n\nexport interface CommandRootProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n search?: string;\n defaultSearch?: string;\n onSearchChange?: (search: string) => void;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loopFocus?: boolean;\n disabled?: boolean;\n loading?: boolean;\n children?: ReactNode;\n}\n\nexport const CommandRoot = forwardRef<HTMLDivElement, CommandRootProps>(function CommandRoot(\n {\n children,\n className,\n defaultSearch = \"\",\n disabled = false,\n filter = defaultFilter,\n loading = false,\n onKeyDown,\n onSearchChange,\n search: controlledSearch,\n shouldFilter = true,\n loopFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledSearch, setUncontrolledSearch] = useState(defaultSearch);\n const [highlighted, setHighlighted] = useState<string | null>(null);\n const [, setVersion] = useState(0);\n const itemsRef = useRef(new Map<string, CommandItemRecord>());\n const listId = useId();\n const search = controlledSearch ?? uncontrolledSearch;\n const styles = command();\n\n const items = Array.from(itemsRef.current.values());\n const setSearch = useCallback(\n (next: string) => {\n if (controlledSearch === undefined) setUncontrolledSearch(next);\n onSearchChange?.(next);\n },\n [controlledSearch, onSearchChange],\n );\n const matches = useCallback(\n (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) =>\n !shouldFilter || filter(item.value, search, item.keywords),\n [filter, search, shouldFilter],\n );\n const visibleItems = useMemo(\n () => items.filter((item) => !item.disabled && matches(item)),\n [items, matches],\n );\n\n const registerItem = useCallback((item: CommandItemRecord) => {\n itemsRef.current.set(item.id, item);\n setVersion((current) => current + 1);\n return () => {\n itemsRef.current.delete(item.id);\n setVersion((current) => current + 1);\n };\n }, []);\n\n const setItemElement = useCallback((id: string, element: HTMLDivElement | null) => {\n const item = itemsRef.current.get(id);\n if (item) item.element = element;\n }, []);\n\n const selectItem = useCallback(\n (id: string) => {\n const item = itemsRef.current.get(id);\n if (item && !item.disabled && matches(item)) item.onSelect?.(item.value);\n },\n [matches],\n );\n\n useEffect(() => {\n if (!visibleItems.some((item) => item.id === highlighted)) {\n setHighlighted(visibleItems[0]?.id ?? null);\n }\n }, [highlighted, visibleItems]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n onKeyDown?.(event as KeyboardEvent<HTMLDivElement>);\n if (event.defaultPrevented) return;\n if (disabled) return;\n const currentIndex = visibleItems.findIndex((item) => item.id === highlighted);\n if ((event.key === \"ArrowDown\" || event.key === \"ArrowUp\") && visibleItems.length > 0) {\n event.preventDefault();\n const direction = event.key === \"ArrowDown\" ? 1 : -1;\n let nextIndex = currentIndex + direction;\n if (loopFocus) nextIndex = (nextIndex + visibleItems.length) % visibleItems.length;\n if (nextIndex >= 0 && nextIndex < visibleItems.length) {\n setHighlighted(visibleItems[nextIndex]?.id ?? null);\n }\n } else if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setHighlighted((event.key === \"Home\" ? visibleItems[0] : visibleItems.at(-1))?.id ?? null);\n } else if (event.key === \"Enter\" && highlighted) {\n event.preventDefault();\n selectItem(highlighted);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n }\n },\n [disabled, highlighted, loopFocus, onKeyDown, selectItem, visibleItems],\n );\n\n const context = useMemo<CommandContextValue>(\n () => ({\n search,\n setSearch,\n disabled,\n handleKeyDown,\n loading,\n shouldFilter,\n items,\n highlighted,\n listId,\n matches,\n registerItem,\n setItemElement,\n setHighlighted,\n selectItem,\n }),\n [\n highlighted,\n disabled,\n handleKeyDown,\n items,\n listId,\n loading,\n matches,\n registerItem,\n search,\n selectItem,\n setItemElement,\n setSearch,\n shouldFilter,\n ],\n );\n\n return (\n <CommandContext.Provider value={context}>\n <div\n {...props}\n ref={(node) => {\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n className={cx(styles.root, className)}\n data-disabled={disabled || undefined}\n data-jaci-component=\"command\"\n data-slot=\"command\"\n aria-disabled={disabled || undefined}\n >\n {children}\n </div>\n </CommandContext.Provider>\n );\n});\n\nexport type CommandInputProps = ComponentPropsWithoutRef<\"input\">;\nexport const CommandInput = forwardRef<HTMLInputElement, CommandInputProps>(function CommandInput(\n { className, onChange, onKeyDown, ...props },\n ref,\n) {\n const { disabled, handleKeyDown, highlighted, listId, search, setHighlighted, setSearch } =\n useCommandContext();\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n const next = event.target.value;\n setHighlighted(null);\n setSearch(next);\n };\n\n return (\n <input\n {...props}\n ref={ref}\n aria-activedescendant={highlighted ?? undefined}\n aria-controls={listId}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"true\"\n className={cx(command().input, className)}\n data-slot=\"command-input\"\n disabled={disabled || props.disabled}\n onChange={(event) => {\n handleChange(event);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n handleKeyDown(event);\n }}\n value={search}\n />\n );\n});\n\nexport type CommandListProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandList = forwardRef<HTMLDivElement, CommandListProps>(function CommandList(\n { className, id, ...props },\n ref,\n) {\n const { listId } = useCommandContext();\n return (\n <div\n {...props}\n ref={ref}\n id={id ?? listId}\n className={cx(command().list, className)}\n data-slot=\"command-list\"\n role=\"listbox\"\n />\n );\n});\n\nexport interface CommandGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n heading?: ReactNode;\n}\nexport const CommandGroup = forwardRef<HTMLDivElement, CommandGroupProps>(function CommandGroup(\n { children, className, heading, ...props },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useId();\n const hasVisibleItems = context.items.some(\n (item) => item.groupId === groupId && !item.disabled && context.matches(item),\n );\n return (\n <CommandGroupContext.Provider value={groupId}>\n <div\n {...props}\n ref={ref}\n aria-hidden={!hasVisibleItems || undefined}\n className={cx(command().group, className)}\n data-slot=\"command-group\"\n hidden={!hasVisibleItems}\n >\n {heading ? (\n <div className={command().groupHeading} data-slot=\"command-group-heading\">\n {heading}\n </div>\n ) : null}\n {children}\n </div>\n </CommandGroupContext.Provider>\n );\n});\n\nexport interface CommandItemProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"onSelect\"> {\n value: string;\n keywords?: readonly string[];\n disabled?: boolean;\n onSelect?: (value: string) => void;\n}\nexport const CommandItem = forwardRef<HTMLDivElement, CommandItemProps>(function CommandItem(\n {\n children,\n className,\n disabled = false,\n keywords: itemKeywords,\n onClick,\n onMouseEnter,\n onSelect,\n value,\n ...props\n },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useContext(CommandGroupContext);\n const id = `command-item-${useId().replace(/:/g, \"\")}`;\n const keywords = itemKeywords ?? EMPTY_KEYWORDS;\n const visible = context.matches({ value, keywords });\n\n useEffect(\n () =>\n context.registerItem({\n id,\n value,\n keywords,\n disabled,\n groupId,\n onSelect,\n element: null,\n }),\n [context.registerItem, disabled, groupId, id, keywords, onSelect, value],\n );\n\n if (!visible) {\n return <div aria-hidden=\"true\" hidden ref={ref} data-slot=\"command-item\" />;\n }\n\n return (\n <div\n {...props}\n ref={(node) => {\n context.setItemElement(id, node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n aria-disabled={disabled || undefined}\n aria-selected={context.highlighted === id}\n className={cx(command().item, className)}\n data-disabled={disabled || undefined}\n data-highlighted={context.highlighted === id || undefined}\n data-slot=\"command-item\"\n id={id}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && !disabled) context.selectItem(id);\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (!disabled) context.setHighlighted(id);\n }}\n onKeyDown={(event) => {\n if ((event.key === \"Enter\" || event.key === \" \") && !disabled) {\n event.preventDefault();\n context.selectItem(id);\n }\n }}\n role=\"option\"\n tabIndex={-1}\n >\n {children}\n </div>\n );\n});\n\nexport type CommandItemIndicatorProps = ComponentPropsWithoutRef<\"span\">;\nexport const CommandItemIndicator = forwardRef<HTMLSpanElement, CommandItemIndicatorProps>(\n function CommandItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <span\n {...props}\n ref={ref}\n className={cx(command().itemIndicator, className)}\n data-slot=\"command-item-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport type CommandEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandEmpty = forwardRef<HTMLDivElement, CommandEmptyProps>(function CommandEmpty(\n { className, ...props },\n ref,\n) {\n const context = useCommandContext();\n if (context.loading || context.items.some((item) => !item.disabled && context.matches(item)))\n return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().empty, className)}\n aria-live=\"polite\"\n aria-disabled=\"true\"\n data-slot=\"command-empty\"\n role=\"option\"\n tabIndex={-1}\n />\n );\n});\n\nexport type CommandLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandLoading = forwardRef<HTMLDivElement, CommandLoadingProps>(\n function CommandLoading({ className, ...props }, ref) {\n const context = useCommandContext();\n if (!context.loading) return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().loading, className)}\n aria-live=\"polite\"\n aria-disabled=\"true\"\n data-slot=\"command-loading\"\n role=\"option\"\n tabIndex={-1}\n />\n );\n },\n);\n\nexport type CommandSeparatorProps = ComponentPropsWithoutRef<\"hr\">;\nexport const CommandSeparator = forwardRef<HTMLHRElement, CommandSeparatorProps>(\n function CommandSeparator({ className, ...props }, ref) {\n return (\n <hr\n {...props}\n ref={ref}\n role=\"presentation\"\n className={cx(command().separator, className)}\n data-slot=\"command-separator\"\n />\n );\n },\n);\n\nexport const Command = {\n Root: CommandRoot,\n Input: CommandInput,\n List: CommandList,\n Group: CommandGroup,\n Item: CommandItem,\n ItemIndicator: CommandItemIndicator,\n Empty: CommandEmpty,\n Loading: CommandLoading,\n Separator: CommandSeparator,\n};\n"],"mappings":";;;;;;AA+CA,MAAM,iBAAiB,cAA0C,IAAI;AACrE,MAAM,sBAAsB,cAAkC,KAAA,CAAS;AACvE,MAAM,iBAAoC,CAAC;AAE3C,SAAS,oBAAoB;CAC3B,MAAM,UAAU,WAAW,cAAc;CACzC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,qDAAqD;CACnF,OAAO;AACT;AAEA,SAAS,cAAc,OAAe,QAAgB,UAA6B;CACjF,MAAM,QAAQ,OAAO,KAAK,CAAC,CAAC,kBAAkB;CAC9C,IAAI,CAAC,OAAO,OAAO;CACnB,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC,MAAM,cAAc,UAAU,kBAAkB,CAAC,CAAC,SAAS,KAAK,CAAC;AAC/F;AAcA,MAAa,cAAc,WAA6C,SAAS,YAC/E,EACE,UACA,WACA,gBAAgB,IAChB,WAAW,OACX,SAAS,eACT,UAAU,OACV,WACA,gBACA,QAAQ,kBACR,eAAe,MACf,YAAY,MACZ,GAAG,SAEL,KACA;CACA,MAAM,CAAC,oBAAoB,yBAAyB,SAAS,aAAa;CAC1E,MAAM,CAAC,aAAa,kBAAkB,SAAwB,IAAI;CAClE,MAAM,GAAG,cAAc,SAAS,CAAC;CACjC,MAAM,WAAW,uBAAO,IAAI,IAA+B,CAAC;CAC5D,MAAM,SAAS,MAAM;CACrB,MAAM,SAAS,oBAAoB;CACnC,MAAM,SAAS,QAAQ;CAEvB,MAAM,QAAQ,MAA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OAAO;CACP,MAAM;CACN,OAAO;CACP,MAAM;CACN,eAAe;CACf,OAAO;CACP,SAAS;CACT,WAAW;AACb"}
|
|
1
|
+
{"version":3,"file":"command.js","names":[],"sources":["../../../src/components/command/command.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ChangeEvent, ComponentPropsWithoutRef, KeyboardEvent, ReactNode } from \"react\";\n\nimport { command } from \"../../styled-system/recipes\";\nimport { cx } from \"../../styled-system/css\";\n\nexport type CommandFilter = (value: string, search: string, keywords: readonly string[]) => boolean;\nexport type CommandMode = \"default\" | \"dropdown\";\n\ninterface CommandItemRecord {\n id: string;\n value: string;\n keywords: readonly string[];\n disabled: boolean;\n groupId: string | undefined;\n onSelect: ((value: string) => void) | undefined;\n element: HTMLDivElement | null;\n}\n\ninterface CommandContextValue {\n search: string;\n setSearch: (search: string) => void;\n loading: boolean;\n shouldFilter: boolean;\n items: readonly CommandItemRecord[];\n highlighted: string | null;\n listId: string;\n matches: (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) => boolean;\n handleKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n registerItem: (item: CommandItemRecord) => () => void;\n setItemElement: (id: string, element: HTMLDivElement | null) => void;\n setHighlighted: (value: string | null) => void;\n selectItem: (id: string) => void;\n disabled: boolean;\n mode: CommandMode;\n open: boolean;\n setOpen: (open: boolean) => void;\n closeOnSelect: boolean;\n}\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\nconst CommandGroupContext = createContext<string | undefined>(undefined);\nconst EMPTY_KEYWORDS: readonly string[] = [];\n\nfunction useCommandContext() {\n const context = useContext(CommandContext);\n if (!context) throw new Error(\"Command parts must be rendered inside Command.Root.\");\n return context;\n}\n\nfunction defaultFilter(value: string, search: string, keywords: readonly string[]) {\n const query = search.trim().toLocaleLowerCase();\n if (!query) return true;\n return [value, ...keywords].some((candidate) => candidate.toLocaleLowerCase().includes(query));\n}\n\nexport interface CommandRootProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n search?: string;\n defaultSearch?: string;\n onSearchChange?: (search: string) => void;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loopFocus?: boolean;\n disabled?: boolean;\n loading?: boolean;\n mode?: CommandMode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n closeOnSelect?: boolean;\n children?: ReactNode;\n}\n\nexport const CommandRoot = forwardRef<HTMLDivElement, CommandRootProps>(function CommandRoot(\n {\n children,\n className,\n defaultSearch = \"\",\n disabled = false,\n filter = defaultFilter,\n loading = false,\n mode = \"default\",\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n closeOnSelect = true,\n onKeyDown,\n onSearchChange,\n search: controlledSearch,\n shouldFilter = true,\n loopFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledSearch, setUncontrolledSearch] = useState(defaultSearch);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const [highlighted, setHighlighted] = useState<string | null>(null);\n const [, setVersion] = useState(0);\n const itemsRef = useRef(new Map<string, CommandItemRecord>());\n const rootElementRef = useRef<HTMLDivElement | null>(null);\n const listId = useId();\n const search = controlledSearch ?? uncontrolledSearch;\n const open = mode === \"default\" ? true : (controlledOpen ?? uncontrolledOpen);\n const styles = command({ mode });\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (mode !== \"dropdown\" || disabled) return;\n if (controlledOpen === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [controlledOpen, disabled, mode, onOpenChange],\n );\n const close = useCallback(() => setOpen(false), [setOpen]);\n\n const items = Array.from(itemsRef.current.values());\n const setSearch = useCallback(\n (next: string) => {\n if (controlledSearch === undefined) setUncontrolledSearch(next);\n onSearchChange?.(next);\n },\n [controlledSearch, onSearchChange],\n );\n const matches = useCallback(\n (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) =>\n !shouldFilter || filter(item.value, search, item.keywords),\n [filter, search, shouldFilter],\n );\n const visibleItems = useMemo(\n () => items.filter((item) => !item.disabled && matches(item)),\n [items, matches],\n );\n\n const registerItem = useCallback((item: CommandItemRecord) => {\n itemsRef.current.set(item.id, item);\n setVersion((current) => current + 1);\n return () => {\n itemsRef.current.delete(item.id);\n setVersion((current) => current + 1);\n };\n }, []);\n\n const setItemElement = useCallback((id: string, element: HTMLDivElement | null) => {\n const item = itemsRef.current.get(id);\n if (item) item.element = element;\n }, []);\n\n const selectItem = useCallback(\n (id: string) => {\n const item = itemsRef.current.get(id);\n if (item && !item.disabled && matches(item)) {\n item.onSelect?.(item.value);\n if (closeOnSelect) close();\n }\n },\n [close, closeOnSelect, matches],\n );\n\n useEffect(() => {\n if (mode !== \"dropdown\" || !open) return;\n\n const handleOutsidePress = (event: PointerEvent) => {\n const target = event.target;\n if (target instanceof Node && !rootElementRef.current?.contains(target)) close();\n };\n\n document.addEventListener(\"pointerdown\", handleOutsidePress);\n return () => document.removeEventListener(\"pointerdown\", handleOutsidePress);\n }, [close, mode, open]);\n\n useEffect(() => {\n if (!visibleItems.some((item) => item.id === highlighted)) {\n setHighlighted(visibleItems[0]?.id ?? null);\n }\n }, [highlighted, visibleItems]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n onKeyDown?.(event as KeyboardEvent<HTMLDivElement>);\n if (event.defaultPrevented) return;\n if (disabled) return;\n const currentIndex = visibleItems.findIndex((item) => item.id === highlighted);\n if ((event.key === \"ArrowDown\" || event.key === \"ArrowUp\") && visibleItems.length > 0) {\n event.preventDefault();\n const direction = event.key === \"ArrowDown\" ? 1 : -1;\n let nextIndex = currentIndex + direction;\n if (loopFocus) nextIndex = (nextIndex + visibleItems.length) % visibleItems.length;\n if (nextIndex >= 0 && nextIndex < visibleItems.length) {\n setHighlighted(visibleItems[nextIndex]?.id ?? null);\n }\n } else if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setHighlighted((event.key === \"Home\" ? visibleItems[0] : visibleItems.at(-1))?.id ?? null);\n } else if (event.key === \"Enter\" && highlighted) {\n event.preventDefault();\n selectItem(highlighted);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n }\n },\n [close, disabled, highlighted, loopFocus, onKeyDown, selectItem, visibleItems],\n );\n\n const context = useMemo<CommandContextValue>(\n () => ({\n search,\n setSearch,\n disabled,\n handleKeyDown,\n loading,\n shouldFilter,\n items,\n highlighted,\n listId,\n matches,\n registerItem,\n setItemElement,\n setHighlighted,\n selectItem,\n mode,\n open,\n setOpen,\n closeOnSelect,\n }),\n [\n highlighted,\n disabled,\n handleKeyDown,\n items,\n listId,\n loading,\n matches,\n registerItem,\n search,\n selectItem,\n setItemElement,\n setSearch,\n shouldFilter,\n mode,\n open,\n setOpen,\n closeOnSelect,\n ],\n );\n\n return (\n <CommandContext.Provider value={context}>\n <div\n {...props}\n ref={(node) => {\n rootElementRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n className={cx(styles.root, className)}\n data-disabled={disabled || undefined}\n data-jaci-component=\"command\"\n data-mode={mode}\n data-open={open || undefined}\n data-slot=\"command\"\n aria-disabled={disabled || undefined}\n >\n {children}\n </div>\n </CommandContext.Provider>\n );\n});\n\nexport type CommandInputProps = ComponentPropsWithoutRef<\"input\">;\nexport const CommandInput = forwardRef<HTMLInputElement, CommandInputProps>(function CommandInput(\n { className, onChange, onClick, onFocus, onKeyDown, ...props },\n ref,\n) {\n const {\n disabled,\n handleKeyDown,\n highlighted,\n listId,\n mode,\n open,\n search,\n setHighlighted,\n setOpen,\n setSearch,\n } = useCommandContext();\n const styles = command({ mode });\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n const next = event.target.value;\n setHighlighted(null);\n setSearch(next);\n };\n\n return (\n <input\n {...props}\n ref={ref}\n aria-activedescendant={highlighted ?? undefined}\n aria-controls={listId}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n className={cx(styles.input, className)}\n data-slot=\"command-input\"\n data-mode={mode}\n disabled={disabled || props.disabled}\n onChange={(event) => {\n handleChange(event);\n }}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && mode === \"dropdown\" && !disabled && !props.disabled)\n setOpen(true);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (!event.defaultPrevented && mode === \"dropdown\" && !disabled && !props.disabled)\n setOpen(true);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n handleKeyDown(event);\n }}\n value={search}\n />\n );\n});\n\nexport type CommandListProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandList = forwardRef<HTMLDivElement, CommandListProps>(function CommandList(\n { className, id, ...props },\n ref,\n) {\n const { listId, mode, open } = useCommandContext();\n const styles = command({ mode });\n return (\n <div\n {...props}\n ref={ref}\n id={id ?? listId}\n className={cx(styles.list, className)}\n aria-hidden={mode === \"dropdown\" && !open ? true : undefined}\n data-open={open || undefined}\n data-slot=\"command-list\"\n hidden={mode === \"dropdown\" && !open ? true : undefined}\n role=\"listbox\"\n />\n );\n});\n\nexport interface CommandGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n heading?: ReactNode;\n}\nexport const CommandGroup = forwardRef<HTMLDivElement, CommandGroupProps>(function CommandGroup(\n { children, className, heading, ...props },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useId();\n const hasVisibleItems = context.items.some(\n (item) => item.groupId === groupId && !item.disabled && context.matches(item),\n );\n return (\n <CommandGroupContext.Provider value={groupId}>\n <div\n {...props}\n ref={ref}\n aria-hidden={!hasVisibleItems || undefined}\n className={cx(command().group, className)}\n data-slot=\"command-group\"\n hidden={!hasVisibleItems}\n >\n {heading ? (\n <div className={command().groupHeading} data-slot=\"command-group-heading\">\n {heading}\n </div>\n ) : null}\n {children}\n </div>\n </CommandGroupContext.Provider>\n );\n});\n\nexport interface CommandItemProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"onSelect\"> {\n value: string;\n keywords?: readonly string[];\n disabled?: boolean;\n onSelect?: (value: string) => void;\n}\nexport const CommandItem = forwardRef<HTMLDivElement, CommandItemProps>(function CommandItem(\n {\n children,\n className,\n disabled = false,\n keywords: itemKeywords,\n onClick,\n onMouseEnter,\n onSelect,\n value,\n ...props\n },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useContext(CommandGroupContext);\n const id = `command-item-${useId().replace(/:/g, \"\")}`;\n const keywords = itemKeywords ?? EMPTY_KEYWORDS;\n const visible = context.matches({ value, keywords });\n\n useEffect(\n () =>\n context.registerItem({\n id,\n value,\n keywords,\n disabled,\n groupId,\n onSelect,\n element: null,\n }),\n [context.registerItem, disabled, groupId, id, keywords, onSelect, value],\n );\n\n if (!visible) {\n return <div aria-hidden=\"true\" hidden ref={ref} data-slot=\"command-item\" />;\n }\n\n return (\n <div\n {...props}\n ref={(node) => {\n context.setItemElement(id, node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n aria-disabled={disabled || undefined}\n aria-selected={context.highlighted === id}\n className={cx(command().item, className)}\n data-disabled={disabled || undefined}\n data-highlighted={context.highlighted === id || undefined}\n data-slot=\"command-item\"\n id={id}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && !disabled) context.selectItem(id);\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (!disabled) context.setHighlighted(id);\n }}\n onKeyDown={(event) => {\n if ((event.key === \"Enter\" || event.key === \" \") && !disabled) {\n event.preventDefault();\n context.selectItem(id);\n }\n }}\n role=\"option\"\n tabIndex={-1}\n >\n {children}\n </div>\n );\n});\n\nexport type CommandItemIndicatorProps = ComponentPropsWithoutRef<\"span\">;\nexport const CommandItemIndicator = forwardRef<HTMLSpanElement, CommandItemIndicatorProps>(\n function CommandItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <span\n {...props}\n ref={ref}\n className={cx(command().itemIndicator, className)}\n data-slot=\"command-item-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport type CommandEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandEmpty = forwardRef<HTMLDivElement, CommandEmptyProps>(function CommandEmpty(\n { className, ...props },\n ref,\n) {\n const context = useCommandContext();\n if (context.loading || context.items.some((item) => !item.disabled && context.matches(item)))\n return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().empty, className)}\n aria-live=\"polite\"\n aria-disabled=\"true\"\n data-slot=\"command-empty\"\n role=\"option\"\n tabIndex={-1}\n />\n );\n});\n\nexport type CommandLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandLoading = forwardRef<HTMLDivElement, CommandLoadingProps>(\n function CommandLoading({ className, ...props }, ref) {\n const context = useCommandContext();\n if (!context.loading) return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().loading, className)}\n aria-live=\"polite\"\n aria-disabled=\"true\"\n data-slot=\"command-loading\"\n role=\"option\"\n tabIndex={-1}\n />\n );\n },\n);\n\nexport type CommandSeparatorProps = ComponentPropsWithoutRef<\"hr\">;\nexport const CommandSeparator = forwardRef<HTMLHRElement, CommandSeparatorProps>(\n function CommandSeparator({ className, ...props }, ref) {\n return (\n <hr\n {...props}\n ref={ref}\n role=\"presentation\"\n className={cx(command().separator, className)}\n data-slot=\"command-separator\"\n />\n );\n },\n);\n\nexport const Command = {\n Root: CommandRoot,\n Input: CommandInput,\n List: CommandList,\n Group: CommandGroup,\n Item: CommandItem,\n ItemIndicator: CommandItemIndicator,\n Empty: CommandEmpty,\n Loading: CommandLoading,\n Separator: CommandSeparator,\n};\n"],"mappings":";;;;;;AAoDA,MAAM,iBAAiB,cAA0C,IAAI;AACrE,MAAM,sBAAsB,cAAkC,KAAA,CAAS;AACvE,MAAM,iBAAoC,CAAC;AAE3C,SAAS,oBAAoB;CAC3B,MAAM,UAAU,WAAW,cAAc;CACzC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,qDAAqD;CACnF,OAA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AG,SAChB,KACA;CACA,MAAM,UAAU,kBAAkB;CAClC,IAAI,QAAQ,WAAW,QAAQ,MAAM,MAAM,SAAS,CAAC,KAAK,YAAY,QAAQ,QAAQ,IAAI,CAAC,GACzF,OAAO;CACT,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,QAAQ,CAAC,CAAC,OAAO,SAAS;EACxC,aAAU;EACV,iBAAc;EACd,aAAU;EACV,MAAK;EACL,UAAU;CACX,CAAA;AAEL,CAAC;AAGD,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CAEpD,IAAI,CADY,kBACL,CAAC,CAAC,SAAS,OAAO;CAC7B,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,QAAQ,CAAC,CAAC,SAAS,SAAS;EAC1C,aAAU;EACV,iBAAc;EACd,aAAU;EACV,MAAK;EACL,UAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAAC,MAAD;EACE,GAAI;EACC;EACL,MAAK;EACL,WAAW,GAAG,QAAQ,CAAC,CAAC,WAAW,SAAS;EAC5C,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,UAAU;CACrB,MAAM;CACN,OAAO;CACP,MAAM;CACN,OAAO;CACP,MAAM;CACN,eAAe;CACf,OAAO;CACP,SAAS;CACT,WAAW;AACb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Command, CommandEmpty, CommandEmptyProps, CommandFilter, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemIndicator, CommandItemProps, CommandList, CommandListProps, CommandLoading, CommandLoadingProps, CommandRoot, CommandRootProps, CommandSeparator, CommandSeparatorProps } from "./command.cjs";
|
|
2
|
-
export { Command, CommandEmpty, type CommandEmptyProps, type CommandFilter, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, CommandItemIndicator, type CommandItemProps, CommandList, type CommandListProps, CommandLoading, type CommandLoadingProps, CommandRoot, type CommandRootProps, CommandSeparator, type CommandSeparatorProps };
|
|
1
|
+
import { Command, CommandEmpty, CommandEmptyProps, CommandFilter, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemIndicator, CommandItemProps, CommandList, CommandListProps, CommandLoading, CommandLoadingProps, CommandMode, CommandRoot, CommandRootProps, CommandSeparator, CommandSeparatorProps } from "./command.cjs";
|
|
2
|
+
export { Command, CommandEmpty, type CommandEmptyProps, type CommandFilter, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, CommandItemIndicator, type CommandItemProps, CommandList, type CommandListProps, CommandLoading, type CommandLoadingProps, type CommandMode, CommandRoot, type CommandRootProps, CommandSeparator, type CommandSeparatorProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Command, CommandEmpty, CommandEmptyProps, CommandFilter, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemIndicator, CommandItemProps, CommandList, CommandListProps, CommandLoading, CommandLoadingProps, CommandRoot, CommandRootProps, CommandSeparator, CommandSeparatorProps } from "./command.js";
|
|
2
|
-
export { Command, CommandEmpty, type CommandEmptyProps, type CommandFilter, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, CommandItemIndicator, type CommandItemProps, CommandList, type CommandListProps, CommandLoading, type CommandLoadingProps, CommandRoot, type CommandRootProps, CommandSeparator, type CommandSeparatorProps };
|
|
1
|
+
import { Command, CommandEmpty, CommandEmptyProps, CommandFilter, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemIndicator, CommandItemProps, CommandList, CommandListProps, CommandLoading, CommandLoadingProps, CommandMode, CommandRoot, CommandRootProps, CommandSeparator, CommandSeparatorProps } from "./command.js";
|
|
2
|
+
export { Command, CommandEmpty, type CommandEmptyProps, type CommandFilter, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, CommandItemIndicator, type CommandItemProps, CommandList, type CommandListProps, CommandLoading, type CommandLoadingProps, type CommandMode, CommandRoot, type CommandRootProps, CommandSeparator, type CommandSeparatorProps };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_base_ui = require("../base-ui.cjs");
|
|
3
3
|
const require_menu = require("../../styled-system/recipes/menu.cjs");
|
|
4
|
+
const require_theme_scope = require("../../theme/theme-scope.cjs");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
let _base_ui_react_context_menu = require("@base-ui/react/context-menu");
|
|
@@ -17,7 +18,9 @@ const ContextMenuTrigger = (0, react.forwardRef)(function ContextMenuTrigger({ c
|
|
|
17
18
|
"data-slot": "context-menu-trigger"
|
|
18
19
|
});
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
+
function ContextMenuPortal(props) {
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_context_menu.ContextMenu.Portal, { ...require_theme_scope.useThemePortalProps(props) });
|
|
23
|
+
}
|
|
21
24
|
const ContextMenuBackdrop = _base_ui_react_context_menu.ContextMenu.Backdrop;
|
|
22
25
|
const ContextMenuPositioner = (0, react.forwardRef)(function ContextMenuPositioner({ className, ...props }, ref) {
|
|
23
26
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_context_menu.ContextMenu.Positioner, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.cjs","names":["BaseContextMenu","withRecipeClassName","menu"],"sources":["../../../src/components/context-menu/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { ContextMenuRoot as BaseContextMenuRoot } from \"@base-ui/react/context-menu\";\n\nimport { menu } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\n/**\n * A right-click and long-press menu with Base UI's keyboard navigation,\n * focus management, submenu support, and ARIA semantics.\n */\nexport type ContextMenuRootProps = BaseContextMenuRoot.Props;\n\nexport function ContextMenuRoot(props: ContextMenuRootProps) {\n return <BaseContextMenu.Root {...props} />;\n}\n\nexport type ContextMenuTriggerProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Trigger>;\n\nexport const ContextMenuTrigger = forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Trigger\n {...props}\n ref={ref}\n className={className}\n data-jaci-component=\"context-menu\"\n data-slot=\"context-menu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuPortalProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Portal>;\nexport const ContextMenuPortal: typeof BaseContextMenu.Portal = BaseContextMenu.Portal;\n\nexport type ContextMenuBackdropProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Backdrop>;\nexport const ContextMenuBackdrop: typeof BaseContextMenu.Backdrop = BaseContextMenu.Backdrop;\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\nexport const ContextMenuPositioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().positioner, className)}\n data-slot=\"context-menu-positioner\"\n />\n );\n },\n);\n\nexport type ContextMenuPopupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Popup>;\n\nexport const ContextMenuPopup = forwardRef<HTMLDivElement, ContextMenuPopupProps>(\n function ContextMenuPopup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().popup, className)}\n data-slot=\"context-menu-popup\"\n />\n );\n },\n);\n\nexport type ContextMenuArrowProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Arrow>;\n\nexport const ContextMenuArrow = forwardRef<HTMLDivElement, ContextMenuArrowProps>(\n function ContextMenuArrow({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Arrow\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-arrow\"\n />\n );\n },\n);\n\nexport type ContextMenuItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Item>;\n\nexport const ContextMenuItem = forwardRef<HTMLElement, ContextMenuItemProps>(\n function ContextMenuItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-item\"\n />\n );\n },\n);\n\nexport type ContextMenuLinkItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.LinkItem>;\n\nexport const ContextMenuLinkItem = forwardRef<Element, ContextMenuLinkItemProps>(\n function ContextMenuLinkItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.LinkItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-link-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItem\n>;\n\nexport const ContextMenuCheckboxItem = forwardRef<HTMLElement, ContextMenuCheckboxItemProps>(\n function ContextMenuCheckboxItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-checkbox-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItemIndicator\n>;\n\nexport const ContextMenuCheckboxItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuCheckboxItemIndicatorProps\n>(function ContextMenuCheckboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-checkbox-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.CheckboxItemIndicator>\n );\n});\n\nexport type ContextMenuRadioGroupProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioGroup\n>;\nexport const ContextMenuRadioGroup: typeof BaseContextMenu.RadioGroup = BaseContextMenu.RadioGroup;\n\nexport type ContextMenuRadioItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.RadioItem>;\n\nexport const ContextMenuRadioItem = forwardRef<HTMLElement, ContextMenuRadioItemProps>(\n function ContextMenuRadioItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-radio-item\"\n />\n );\n },\n);\n\nexport type ContextMenuRadioItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioItemIndicator\n>;\n\nexport const ContextMenuRadioItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuRadioItemIndicatorProps\n>(function ContextMenuRadioItemIndicator({ children = \"•\", className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-radio-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.RadioItemIndicator>\n );\n});\n\nexport type ContextMenuSubmenuRootProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuRoot\n>;\nexport const ContextMenuSubmenuRoot: typeof BaseContextMenu.SubmenuRoot =\n BaseContextMenu.SubmenuRoot;\n\nexport type ContextMenuSubmenuTriggerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuTrigger\n>;\n\nexport const ContextMenuSubmenuTrigger = forwardRef<HTMLElement, ContextMenuSubmenuTriggerProps>(\n function ContextMenuSubmenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.SubmenuTrigger\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-submenu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Group>;\n\nexport const ContextMenuGroup = forwardRef<HTMLDivElement, ContextMenuGroupProps>(\n function ContextMenuGroup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().group, className)}\n data-slot=\"context-menu-group\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupLabelProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.GroupLabel\n>;\n\nexport const ContextMenuGroupLabel = forwardRef<HTMLDivElement, ContextMenuGroupLabelProps>(\n function ContextMenuGroupLabel({ className, ...props }, ref) {\n return (\n <BaseContextMenu.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().groupLabel, className)}\n data-slot=\"context-menu-group-label\"\n />\n );\n },\n);\n\nexport type ContextMenuSeparatorProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Separator>;\n\nexport const ContextMenuSeparator = forwardRef<HTMLDivElement, ContextMenuSeparatorProps>(\n function ContextMenuSeparator({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Separator\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().separator, className)}\n data-slot=\"context-menu-separator\"\n />\n );\n },\n);\n\nexport const ContextMenu = {\n Root: ContextMenuRoot,\n Trigger: ContextMenuTrigger,\n Portal: ContextMenuPortal,\n Backdrop: ContextMenuBackdrop,\n Positioner: ContextMenuPositioner,\n Popup: ContextMenuPopup,\n Arrow: ContextMenuArrow,\n Item: ContextMenuItem,\n LinkItem: ContextMenuLinkItem,\n CheckboxItem: ContextMenuCheckboxItem,\n CheckboxItemIndicator: ContextMenuCheckboxItemIndicator,\n RadioGroup: ContextMenuRadioGroup,\n RadioItem: ContextMenuRadioItem,\n RadioItemIndicator: ContextMenuRadioItemIndicator,\n SubmenuRoot: ContextMenuSubmenuRoot,\n SubmenuTrigger: ContextMenuSubmenuTrigger,\n Group: ContextMenuGroup,\n GroupLabel: ContextMenuGroupLabel,\n Separator: ContextMenuSeparator,\n};\n"],"mappings":";;;;;;;AAgBA,SAAgB,gBAAgB,OAA6B;CAC3D,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,sBAAA,GAAA,MAAA,WAAA,CACX,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,SAAjB;EACE,GAAI;EACC;EACM;EACX,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAmDA,4BAAAA,YAAgB;AAGhF,MAAa,sBAAuDA,4BAAAA,YAAgB;AAMpF,MAAa,yBAAA,GAAA,MAAA,WAAA,CACX,SAAS,sBAAsB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC3D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,YAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,aAAAA,KAAK,CAAC,CAAC,YAAY,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,oBAAA,GAAA,MAAA,WAAA,CACX,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,4BAAAA,YAAgB,OAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,aAAAA,KAAK,CAAC,CAAC,OAAO,SAAS;EACtD,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,oBAAA,GAAA,MAAA,WAAA,CACX,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,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,KAAK,CAAC,CAAC,YAAY,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,wBAAA,GAAA,MAAA,WAAA,CACX,SAAS,qBAAqB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,4BAAAA,YAAgB,WAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,aAAAA,KAAK,CAAC,CAAC,WAAW,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,OAAO;CACP,OAAO;CACP,MAAM;CACN,UAAU;CACV,cAAc;CACd,uBAAuB;CACvB,YAAY;CACZ,WAAW;CACX,oBAAoB;CACpB,aAAa;CACb,gBAAgB;CAChB,OAAO;CACP,YAAY;CACZ,WAAW;AACb"}
|
|
1
|
+
{"version":3,"file":"context-menu.cjs","names":["BaseContextMenu","useThemePortalProps","withRecipeClassName","menu"],"sources":["../../../src/components/context-menu/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { ContextMenuRoot as BaseContextMenuRoot } from \"@base-ui/react/context-menu\";\n\nimport { menu } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A right-click and long-press menu with Base UI's keyboard navigation,\n * focus management, submenu support, and ARIA semantics.\n */\nexport type ContextMenuRootProps = BaseContextMenuRoot.Props;\n\nexport function ContextMenuRoot(props: ContextMenuRootProps) {\n return <BaseContextMenu.Root {...props} />;\n}\n\nexport type ContextMenuTriggerProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Trigger>;\n\nexport const ContextMenuTrigger = forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Trigger\n {...props}\n ref={ref}\n className={className}\n data-jaci-component=\"context-menu\"\n data-slot=\"context-menu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuPortalProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Portal>;\nexport function ContextMenuPortal(props: ContextMenuPortalProps) {\n return <BaseContextMenu.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type ContextMenuBackdropProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Backdrop>;\nexport const ContextMenuBackdrop: typeof BaseContextMenu.Backdrop = BaseContextMenu.Backdrop;\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\nexport const ContextMenuPositioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().positioner, className)}\n data-slot=\"context-menu-positioner\"\n />\n );\n },\n);\n\nexport type ContextMenuPopupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Popup>;\n\nexport const ContextMenuPopup = forwardRef<HTMLDivElement, ContextMenuPopupProps>(\n function ContextMenuPopup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().popup, className)}\n data-slot=\"context-menu-popup\"\n />\n );\n },\n);\n\nexport type ContextMenuArrowProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Arrow>;\n\nexport const ContextMenuArrow = forwardRef<HTMLDivElement, ContextMenuArrowProps>(\n function ContextMenuArrow({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Arrow\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-arrow\"\n />\n );\n },\n);\n\nexport type ContextMenuItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Item>;\n\nexport const ContextMenuItem = forwardRef<HTMLElement, ContextMenuItemProps>(\n function ContextMenuItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-item\"\n />\n );\n },\n);\n\nexport type ContextMenuLinkItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.LinkItem>;\n\nexport const ContextMenuLinkItem = forwardRef<Element, ContextMenuLinkItemProps>(\n function ContextMenuLinkItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.LinkItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-link-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItem\n>;\n\nexport const ContextMenuCheckboxItem = forwardRef<HTMLElement, ContextMenuCheckboxItemProps>(\n function ContextMenuCheckboxItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-checkbox-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItemIndicator\n>;\n\nexport const ContextMenuCheckboxItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuCheckboxItemIndicatorProps\n>(function ContextMenuCheckboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-checkbox-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.CheckboxItemIndicator>\n );\n});\n\nexport type ContextMenuRadioGroupProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioGroup\n>;\nexport const ContextMenuRadioGroup: typeof BaseContextMenu.RadioGroup = BaseContextMenu.RadioGroup;\n\nexport type ContextMenuRadioItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.RadioItem>;\n\nexport const ContextMenuRadioItem = forwardRef<HTMLElement, ContextMenuRadioItemProps>(\n function ContextMenuRadioItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-radio-item\"\n />\n );\n },\n);\n\nexport type ContextMenuRadioItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioItemIndicator\n>;\n\nexport const ContextMenuRadioItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuRadioItemIndicatorProps\n>(function ContextMenuRadioItemIndicator({ children = \"•\", className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-radio-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.RadioItemIndicator>\n );\n});\n\nexport type ContextMenuSubmenuRootProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuRoot\n>;\nexport const ContextMenuSubmenuRoot: typeof BaseContextMenu.SubmenuRoot =\n BaseContextMenu.SubmenuRoot;\n\nexport type ContextMenuSubmenuTriggerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuTrigger\n>;\n\nexport const ContextMenuSubmenuTrigger = forwardRef<HTMLElement, ContextMenuSubmenuTriggerProps>(\n function ContextMenuSubmenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.SubmenuTrigger\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-submenu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Group>;\n\nexport const ContextMenuGroup = forwardRef<HTMLDivElement, ContextMenuGroupProps>(\n function ContextMenuGroup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().group, className)}\n data-slot=\"context-menu-group\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupLabelProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.GroupLabel\n>;\n\nexport const ContextMenuGroupLabel = forwardRef<HTMLDivElement, ContextMenuGroupLabelProps>(\n function ContextMenuGroupLabel({ className, ...props }, ref) {\n return (\n <BaseContextMenu.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().groupLabel, className)}\n data-slot=\"context-menu-group-label\"\n />\n );\n },\n);\n\nexport type ContextMenuSeparatorProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Separator>;\n\nexport const ContextMenuSeparator = forwardRef<HTMLDivElement, ContextMenuSeparatorProps>(\n function ContextMenuSeparator({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Separator\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().separator, className)}\n data-slot=\"context-menu-separator\"\n />\n );\n },\n);\n\nexport const ContextMenu = {\n Root: ContextMenuRoot,\n Trigger: ContextMenuTrigger,\n Portal: ContextMenuPortal,\n Backdrop: ContextMenuBackdrop,\n Positioner: ContextMenuPositioner,\n Popup: ContextMenuPopup,\n Arrow: ContextMenuArrow,\n Item: ContextMenuItem,\n LinkItem: ContextMenuLinkItem,\n CheckboxItem: ContextMenuCheckboxItem,\n CheckboxItemIndicator: ContextMenuCheckboxItemIndicator,\n RadioGroup: ContextMenuRadioGroup,\n RadioItem: ContextMenuRadioItem,\n RadioItemIndicator: ContextMenuRadioItemIndicator,\n SubmenuRoot: ContextMenuSubmenuRoot,\n SubmenuTrigger: ContextMenuSubmenuTrigger,\n Group: ContextMenuGroup,\n GroupLabel: ContextMenuGroupLabel,\n Separator: ContextMenuSeparator,\n};\n"],"mappings":";;;;;;;;AAiBA,SAAgB,gBAAgB,OAA6B;CAC3D,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,sBAAA,GAAA,MAAA,WAAA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CAACH,4BAAAA,YAAgB,WAAjB;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoBC,aAAAA,KAAK,CAAC,CAAC,WAAW,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,OAAO;CACP,OAAO;CACP,MAAM;CACN,UAAU;CACV,cAAc;CACd,uBAAuB;CACvB,YAAY;CACZ,WAAW;CACX,oBAAoB;CACpB,aAAa;CACb,gBAAgB;CAChB,OAAO;CACP,YAAY;CACZ,WAAW;AACb"}
|
|
@@ -10,7 +10,7 @@ declare function ContextMenuRoot$1(props: ContextMenuRootProps): import("react")
|
|
|
10
10
|
type ContextMenuTriggerProps = ComponentPropsWithoutRef<typeof ContextMenu.Trigger>;
|
|
11
11
|
declare const ContextMenuTrigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
12
|
type ContextMenuPortalProps = ComponentPropsWithoutRef<typeof ContextMenu.Portal>;
|
|
13
|
-
declare
|
|
13
|
+
declare function ContextMenuPortal(props: ContextMenuPortalProps): import("react").JSX.Element;
|
|
14
14
|
type ContextMenuBackdropProps = ComponentPropsWithoutRef<typeof ContextMenu.Backdrop>;
|
|
15
15
|
declare const ContextMenuBackdrop: typeof ContextMenu.Backdrop;
|
|
16
16
|
type ContextMenuPositionerProps = ComponentPropsWithoutRef<typeof ContextMenu.Positioner>;
|
|
@@ -46,7 +46,7 @@ declare const ContextMenuSeparator: import("react").ForwardRefExoticComponent<Om
|
|
|
46
46
|
declare const ContextMenu$1: {
|
|
47
47
|
Root: typeof ContextMenuRoot$1;
|
|
48
48
|
Trigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
-
Portal:
|
|
49
|
+
Portal: typeof ContextMenuPortal;
|
|
50
50
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
51
|
Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
52
|
Popup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -10,7 +10,7 @@ declare function ContextMenuRoot$1(props: ContextMenuRootProps): import("react")
|
|
|
10
10
|
type ContextMenuTriggerProps = ComponentPropsWithoutRef<typeof ContextMenu.Trigger>;
|
|
11
11
|
declare const ContextMenuTrigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
12
|
type ContextMenuPortalProps = ComponentPropsWithoutRef<typeof ContextMenu.Portal>;
|
|
13
|
-
declare
|
|
13
|
+
declare function ContextMenuPortal(props: ContextMenuPortalProps): import("react").JSX.Element;
|
|
14
14
|
type ContextMenuBackdropProps = ComponentPropsWithoutRef<typeof ContextMenu.Backdrop>;
|
|
15
15
|
declare const ContextMenuBackdrop: typeof ContextMenu.Backdrop;
|
|
16
16
|
type ContextMenuPositionerProps = ComponentPropsWithoutRef<typeof ContextMenu.Positioner>;
|
|
@@ -46,7 +46,7 @@ declare const ContextMenuSeparator: import("react").ForwardRefExoticComponent<Om
|
|
|
46
46
|
declare const ContextMenu$1: {
|
|
47
47
|
Root: typeof ContextMenuRoot$1;
|
|
48
48
|
Trigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
-
Portal:
|
|
49
|
+
Portal: typeof ContextMenuPortal;
|
|
50
50
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
51
|
Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
52
|
Popup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ContextMenuPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { withRecipeClassName } from "../base-ui.js";
|
|
3
3
|
import { menu } from "../../styled-system/recipes/menu.js";
|
|
4
|
+
import { useThemePortalProps } from "../../theme/theme-scope.js";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
@@ -17,7 +18,9 @@ const ContextMenuTrigger = forwardRef(function ContextMenuTrigger({ className, .
|
|
|
17
18
|
"data-slot": "context-menu-trigger"
|
|
18
19
|
});
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
+
function ContextMenuPortal(props) {
|
|
22
|
+
return /* @__PURE__ */ jsx(ContextMenu.Portal, { ...useThemePortalProps(props) });
|
|
23
|
+
}
|
|
21
24
|
const ContextMenuBackdrop = ContextMenu.Backdrop;
|
|
22
25
|
const ContextMenuPositioner = forwardRef(function ContextMenuPositioner({ className, ...props }, ref) {
|
|
23
26
|
return /* @__PURE__ */ jsx(ContextMenu.Positioner, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":["ContextMenuRoot","BaseContextMenu","ContextMenu"],"sources":["../../../src/components/context-menu/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { ContextMenuRoot as BaseContextMenuRoot } from \"@base-ui/react/context-menu\";\n\nimport { menu } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\n/**\n * A right-click and long-press menu with Base UI's keyboard navigation,\n * focus management, submenu support, and ARIA semantics.\n */\nexport type ContextMenuRootProps = BaseContextMenuRoot.Props;\n\nexport function ContextMenuRoot(props: ContextMenuRootProps) {\n return <BaseContextMenu.Root {...props} />;\n}\n\nexport type ContextMenuTriggerProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Trigger>;\n\nexport const ContextMenuTrigger = forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Trigger\n {...props}\n ref={ref}\n className={className}\n data-jaci-component=\"context-menu\"\n data-slot=\"context-menu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuPortalProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Portal>;\nexport const ContextMenuPortal: typeof BaseContextMenu.Portal = BaseContextMenu.Portal;\n\nexport type ContextMenuBackdropProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Backdrop>;\nexport const ContextMenuBackdrop: typeof BaseContextMenu.Backdrop = BaseContextMenu.Backdrop;\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\nexport const ContextMenuPositioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().positioner, className)}\n data-slot=\"context-menu-positioner\"\n />\n );\n },\n);\n\nexport type ContextMenuPopupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Popup>;\n\nexport const ContextMenuPopup = forwardRef<HTMLDivElement, ContextMenuPopupProps>(\n function ContextMenuPopup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().popup, className)}\n data-slot=\"context-menu-popup\"\n />\n );\n },\n);\n\nexport type ContextMenuArrowProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Arrow>;\n\nexport const ContextMenuArrow = forwardRef<HTMLDivElement, ContextMenuArrowProps>(\n function ContextMenuArrow({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Arrow\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-arrow\"\n />\n );\n },\n);\n\nexport type ContextMenuItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Item>;\n\nexport const ContextMenuItem = forwardRef<HTMLElement, ContextMenuItemProps>(\n function ContextMenuItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-item\"\n />\n );\n },\n);\n\nexport type ContextMenuLinkItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.LinkItem>;\n\nexport const ContextMenuLinkItem = forwardRef<Element, ContextMenuLinkItemProps>(\n function ContextMenuLinkItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.LinkItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-link-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItem\n>;\n\nexport const ContextMenuCheckboxItem = forwardRef<HTMLElement, ContextMenuCheckboxItemProps>(\n function ContextMenuCheckboxItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-checkbox-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItemIndicator\n>;\n\nexport const ContextMenuCheckboxItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuCheckboxItemIndicatorProps\n>(function ContextMenuCheckboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-checkbox-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.CheckboxItemIndicator>\n );\n});\n\nexport type ContextMenuRadioGroupProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioGroup\n>;\nexport const ContextMenuRadioGroup: typeof BaseContextMenu.RadioGroup = BaseContextMenu.RadioGroup;\n\nexport type ContextMenuRadioItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.RadioItem>;\n\nexport const ContextMenuRadioItem = forwardRef<HTMLElement, ContextMenuRadioItemProps>(\n function ContextMenuRadioItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-radio-item\"\n />\n );\n },\n);\n\nexport type ContextMenuRadioItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioItemIndicator\n>;\n\nexport const ContextMenuRadioItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuRadioItemIndicatorProps\n>(function ContextMenuRadioItemIndicator({ children = \"•\", className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-radio-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.RadioItemIndicator>\n );\n});\n\nexport type ContextMenuSubmenuRootProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuRoot\n>;\nexport const ContextMenuSubmenuRoot: typeof BaseContextMenu.SubmenuRoot =\n BaseContextMenu.SubmenuRoot;\n\nexport type ContextMenuSubmenuTriggerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuTrigger\n>;\n\nexport const ContextMenuSubmenuTrigger = forwardRef<HTMLElement, ContextMenuSubmenuTriggerProps>(\n function ContextMenuSubmenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.SubmenuTrigger\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-submenu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Group>;\n\nexport const ContextMenuGroup = forwardRef<HTMLDivElement, ContextMenuGroupProps>(\n function ContextMenuGroup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().group, className)}\n data-slot=\"context-menu-group\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupLabelProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.GroupLabel\n>;\n\nexport const ContextMenuGroupLabel = forwardRef<HTMLDivElement, ContextMenuGroupLabelProps>(\n function ContextMenuGroupLabel({ className, ...props }, ref) {\n return (\n <BaseContextMenu.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().groupLabel, className)}\n data-slot=\"context-menu-group-label\"\n />\n );\n },\n);\n\nexport type ContextMenuSeparatorProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Separator>;\n\nexport const ContextMenuSeparator = forwardRef<HTMLDivElement, ContextMenuSeparatorProps>(\n function ContextMenuSeparator({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Separator\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().separator, className)}\n data-slot=\"context-menu-separator\"\n />\n );\n },\n);\n\nexport const ContextMenu = {\n Root: ContextMenuRoot,\n Trigger: ContextMenuTrigger,\n Portal: ContextMenuPortal,\n Backdrop: ContextMenuBackdrop,\n Positioner: ContextMenuPositioner,\n Popup: ContextMenuPopup,\n Arrow: ContextMenuArrow,\n Item: ContextMenuItem,\n LinkItem: ContextMenuLinkItem,\n CheckboxItem: ContextMenuCheckboxItem,\n CheckboxItemIndicator: ContextMenuCheckboxItemIndicator,\n RadioGroup: ContextMenuRadioGroup,\n RadioItem: ContextMenuRadioItem,\n RadioItemIndicator: ContextMenuRadioItemIndicator,\n SubmenuRoot: ContextMenuSubmenuRoot,\n SubmenuTrigger: ContextMenuSubmenuTrigger,\n Group: ContextMenuGroup,\n GroupLabel: ContextMenuGroupLabel,\n Separator: ContextMenuSeparator,\n};\n"],"mappings":";;;;;;;AAgBA,SAAgBA,kBAAgB,OAA6B;CAC3D,OAAO,oBAACC,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,YAAgB,SAAjB;EACE,GAAI;EACC;EACM;EACX,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAmDA,YAAgB;AAGhF,MAAa,sBAAuDA,YAAgB;AAMpF,MAAa,wBAAwB,WACnC,SAAS,sBAAsB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC3D,OACE,oBAACA,YAAgB,YAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,KAAK,CAAC,CAAC,YAAY,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAACA,YAAgB,OAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,KAAK,CAAC,CAAC,OAAO,SAAS;EACtD,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,mBAAmB,WAC9B,SAAS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"file":"context-menu.js","names":["ContextMenuRoot","BaseContextMenu","ContextMenu"],"sources":["../../../src/components/context-menu/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { ContextMenuRoot as BaseContextMenuRoot } from \"@base-ui/react/context-menu\";\n\nimport { menu } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A right-click and long-press menu with Base UI's keyboard navigation,\n * focus management, submenu support, and ARIA semantics.\n */\nexport type ContextMenuRootProps = BaseContextMenuRoot.Props;\n\nexport function ContextMenuRoot(props: ContextMenuRootProps) {\n return <BaseContextMenu.Root {...props} />;\n}\n\nexport type ContextMenuTriggerProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Trigger>;\n\nexport const ContextMenuTrigger = forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Trigger\n {...props}\n ref={ref}\n className={className}\n data-jaci-component=\"context-menu\"\n data-slot=\"context-menu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuPortalProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Portal>;\nexport function ContextMenuPortal(props: ContextMenuPortalProps) {\n return <BaseContextMenu.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type ContextMenuBackdropProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Backdrop>;\nexport const ContextMenuBackdrop: typeof BaseContextMenu.Backdrop = BaseContextMenu.Backdrop;\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\nexport const ContextMenuPositioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().positioner, className)}\n data-slot=\"context-menu-positioner\"\n />\n );\n },\n);\n\nexport type ContextMenuPopupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Popup>;\n\nexport const ContextMenuPopup = forwardRef<HTMLDivElement, ContextMenuPopupProps>(\n function ContextMenuPopup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().popup, className)}\n data-slot=\"context-menu-popup\"\n />\n );\n },\n);\n\nexport type ContextMenuArrowProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Arrow>;\n\nexport const ContextMenuArrow = forwardRef<HTMLDivElement, ContextMenuArrowProps>(\n function ContextMenuArrow({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Arrow\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-arrow\"\n />\n );\n },\n);\n\nexport type ContextMenuItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Item>;\n\nexport const ContextMenuItem = forwardRef<HTMLElement, ContextMenuItemProps>(\n function ContextMenuItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-item\"\n />\n );\n },\n);\n\nexport type ContextMenuLinkItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.LinkItem>;\n\nexport const ContextMenuLinkItem = forwardRef<Element, ContextMenuLinkItemProps>(\n function ContextMenuLinkItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.LinkItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-link-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItem\n>;\n\nexport const ContextMenuCheckboxItem = forwardRef<HTMLElement, ContextMenuCheckboxItemProps>(\n function ContextMenuCheckboxItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-checkbox-item\"\n />\n );\n },\n);\n\nexport type ContextMenuCheckboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.CheckboxItemIndicator\n>;\n\nexport const ContextMenuCheckboxItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuCheckboxItemIndicatorProps\n>(function ContextMenuCheckboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseContextMenu.CheckboxItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-checkbox-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.CheckboxItemIndicator>\n );\n});\n\nexport type ContextMenuRadioGroupProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioGroup\n>;\nexport const ContextMenuRadioGroup: typeof BaseContextMenu.RadioGroup = BaseContextMenu.RadioGroup;\n\nexport type ContextMenuRadioItemProps = ComponentPropsWithoutRef<typeof BaseContextMenu.RadioItem>;\n\nexport const ContextMenuRadioItem = forwardRef<HTMLElement, ContextMenuRadioItemProps>(\n function ContextMenuRadioItem({ className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItem\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-radio-item\"\n />\n );\n },\n);\n\nexport type ContextMenuRadioItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.RadioItemIndicator\n>;\n\nexport const ContextMenuRadioItemIndicator = forwardRef<\n HTMLSpanElement,\n ContextMenuRadioItemIndicatorProps\n>(function ContextMenuRadioItemIndicator({ children = \"•\", className, ...props }, ref) {\n return (\n <BaseContextMenu.RadioItemIndicator\n {...props}\n ref={ref}\n className={className}\n data-slot=\"context-menu-radio-indicator\"\n aria-hidden=\"true\"\n >\n {children}\n </BaseContextMenu.RadioItemIndicator>\n );\n});\n\nexport type ContextMenuSubmenuRootProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuRoot\n>;\nexport const ContextMenuSubmenuRoot: typeof BaseContextMenu.SubmenuRoot =\n BaseContextMenu.SubmenuRoot;\n\nexport type ContextMenuSubmenuTriggerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.SubmenuTrigger\n>;\n\nexport const ContextMenuSubmenuTrigger = forwardRef<HTMLElement, ContextMenuSubmenuTriggerProps>(\n function ContextMenuSubmenuTrigger({ className, ...props }, ref) {\n return (\n <BaseContextMenu.SubmenuTrigger\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().item, className)}\n data-slot=\"context-menu-submenu-trigger\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Group>;\n\nexport const ContextMenuGroup = forwardRef<HTMLDivElement, ContextMenuGroupProps>(\n function ContextMenuGroup({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().group, className)}\n data-slot=\"context-menu-group\"\n />\n );\n },\n);\n\nexport type ContextMenuGroupLabelProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.GroupLabel\n>;\n\nexport const ContextMenuGroupLabel = forwardRef<HTMLDivElement, ContextMenuGroupLabelProps>(\n function ContextMenuGroupLabel({ className, ...props }, ref) {\n return (\n <BaseContextMenu.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().groupLabel, className)}\n data-slot=\"context-menu-group-label\"\n />\n );\n },\n);\n\nexport type ContextMenuSeparatorProps = ComponentPropsWithoutRef<typeof BaseContextMenu.Separator>;\n\nexport const ContextMenuSeparator = forwardRef<HTMLDivElement, ContextMenuSeparatorProps>(\n function ContextMenuSeparator({ className, ...props }, ref) {\n return (\n <BaseContextMenu.Separator\n {...props}\n ref={ref}\n className={withRecipeClassName(menu().separator, className)}\n data-slot=\"context-menu-separator\"\n />\n );\n },\n);\n\nexport const ContextMenu = {\n Root: ContextMenuRoot,\n Trigger: ContextMenuTrigger,\n Portal: ContextMenuPortal,\n Backdrop: ContextMenuBackdrop,\n Positioner: ContextMenuPositioner,\n Popup: ContextMenuPopup,\n Arrow: ContextMenuArrow,\n Item: ContextMenuItem,\n LinkItem: ContextMenuLinkItem,\n CheckboxItem: ContextMenuCheckboxItem,\n CheckboxItemIndicator: ContextMenuCheckboxItemIndicator,\n RadioGroup: ContextMenuRadioGroup,\n RadioItem: ContextMenuRadioItem,\n RadioItemIndicator: ContextMenuRadioItemIndicator,\n SubmenuRoot: ContextMenuSubmenuRoot,\n SubmenuTrigger: ContextMenuSubmenuTrigger,\n Group: ContextMenuGroup,\n GroupLabel: ContextMenuGroupLabel,\n Separator: ContextMenuSeparator,\n};\n"],"mappings":";;;;;;;;AAiBA,SAAgBA,kBAAgB,OAA6B;CAC3D,OAAO,oBAACC,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,YAAgB,SAAjB;EACE,GAAI;EACC;EACM;EACX,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CACF;AAGA,SAAgB,kBAAkB,OAA+B;CAC/D,OAAO,oBAACA,YAAgB,QAAjB,EAAwB,GAAI,oBAAoB,KAAK,EAAI,CAAA;AAClE;AAGA,MAAa,sBAAuDA,YAAgB;AAMpF,MAAa,wBAAwB,WACnC,SAAS,sBAAsB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC3D,OACE,oBAACA,YAAgB,YAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,KAAK,CAAC,CAAC,YAAY,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAACA,YAAgB,OAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,KAAK,CAAC,CAAC,OAAO,SA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gBAAgB;CAChB,OAAO;CACP,YAAY;CACZ,WAAW;AACb"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const require_cx = require("../../styled-system/css/cx.cjs");
|
|
3
3
|
const require_base_ui = require("../base-ui.cjs");
|
|
4
4
|
const require_date_picker = require("../../styled-system/recipes/date-picker.cjs");
|
|
5
|
+
const require_theme_scope = require("../../theme/theme-scope.cjs");
|
|
5
6
|
const require_date_utils = require("./date-utils.cjs");
|
|
6
7
|
let react = require("react");
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -331,7 +332,9 @@ const DatePickerClear = (0, react.forwardRef)(function DatePickerClear({ childre
|
|
|
331
332
|
children
|
|
332
333
|
});
|
|
333
334
|
});
|
|
334
|
-
|
|
335
|
+
function DatePickerPortal(props) {
|
|
336
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Portal, { ...require_theme_scope.useThemePortalProps(props) });
|
|
337
|
+
}
|
|
335
338
|
const DatePickerPositioner = (0, react.forwardRef)(function DatePickerPositioner({ className, ...props }, ref) {
|
|
336
339
|
const { styles } = useDatePickerContext();
|
|
337
340
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Positioner, {
|