@spark-ui/components 18.1.1 → 18.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FormFieldRequiredIndicator-DY3STDp1.js → FormFieldRequiredIndicator-BxZgeZ9H.js} +2 -2
- package/dist/{FormFieldRequiredIndicator-DY3STDp1.js.map → FormFieldRequiredIndicator-BxZgeZ9H.js.map} +1 -1
- package/dist/{FormFieldRequiredIndicator-COKYxTNs.mjs → FormFieldRequiredIndicator-CfE6AOta.mjs} +2 -2
- package/dist/{FormFieldRequiredIndicator-COKYxTNs.mjs.map → FormFieldRequiredIndicator-CfE6AOta.mjs.map} +1 -1
- package/dist/accordion/index.js +1 -1
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +45 -50
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert-dialog/AlertDialogAction.d.ts +1 -1
- package/dist/alert-dialog/AlertDialogCancel.d.ts +1 -1
- package/dist/alert-dialog/AlertDialogTrigger.d.ts +1 -1
- package/dist/alert-dialog/index.js +1 -1
- package/dist/alert-dialog/index.js.map +1 -1
- package/dist/alert-dialog/index.mjs +53 -56
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.mjs +2 -2
- package/dist/badge/BadgeItem.styles.d.ts +1 -1
- package/dist/badge/index.js +1 -1
- package/dist/badge/index.mjs +13 -13
- package/dist/breadcrumb/index.js +1 -1
- package/dist/breadcrumb/index.mjs +1 -1
- package/dist/button/Button.styles.d.ts +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/{button-D0s-21qo.js → button-3vvMrf1L.js} +2 -2
- package/dist/{button-D0s-21qo.js.map → button-3vvMrf1L.js.map} +1 -1
- package/dist/{button-DwLTXeJX.mjs → button-DBNjh3Bi.mjs} +76 -76
- package/dist/{button-DwLTXeJX.mjs.map → button-DBNjh3Bi.mjs.map} +1 -1
- package/dist/card/Backdrop.d.ts +1 -1
- package/dist/card/Card.styles.d.ts +1 -1
- package/dist/card/Content.styles.d.ts +1 -1
- package/dist/card/Type.d.ts +1 -1
- package/dist/card/index.js +1 -1
- package/dist/card/index.mjs +53 -53
- package/dist/carousel/index.js +1 -1
- package/dist/carousel/index.mjs +2 -2
- package/dist/checkbox/CheckboxInput.styles.d.ts +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/{checkbox-uSINHQYe.mjs → checkbox-BEo9AVSB.mjs} +26 -26
- package/dist/{checkbox-uSINHQYe.mjs.map → checkbox-BEo9AVSB.mjs.map} +1 -1
- package/dist/{checkbox-Cbewcw6G.js → checkbox-Cr60_jql.js} +2 -2
- package/dist/{checkbox-Cbewcw6G.js.map → checkbox-Cr60_jql.js.map} +1 -1
- package/dist/chip/Chip.styles.d.ts +1 -1
- package/dist/chip/index.js +1 -1
- package/dist/chip/index.mjs +86 -86
- package/dist/collapsible/index.js +1 -1
- package/dist/collapsible/index.js.map +1 -1
- package/dist/collapsible/index.mjs +18 -24
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.mjs +4 -4
- package/dist/dialog/DialogClose.d.ts +1 -1
- package/dist/dialog/DialogTrigger.d.ts +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +13 -11
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/divider/index.js +1 -1
- package/dist/divider/index.mjs +26 -26
- package/dist/drawer/DrawerClose.d.ts +1 -1
- package/dist/drawer/DrawerTrigger.d.ts +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +13 -11
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown/index.js +1 -1
- package/dist/dropdown/index.mjs +2 -2
- package/dist/file-upload/index.js +1 -1
- package/dist/file-upload/index.mjs +3 -3
- package/dist/form-field/index.js +1 -1
- package/dist/form-field/index.mjs +1 -1
- package/dist/{form-field-B38U0zp8.js → form-field-DMHwopHt.js} +2 -2
- package/dist/{form-field-B38U0zp8.js.map → form-field-DMHwopHt.js.map} +1 -1
- package/dist/{form-field-DCKyhBmv.mjs → form-field-Doq4zLEX.mjs} +4 -4
- package/dist/{form-field-DCKyhBmv.mjs.map → form-field-Doq4zLEX.mjs.map} +1 -1
- package/dist/icon/Icon.styles.d.ts +1 -1
- package/dist/icon/index.js +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/icon-CfEsla9z.js +2 -0
- package/dist/{icon-DY4l9nsc.js.map → icon-CfEsla9z.js.map} +1 -1
- package/dist/{icon-Bs-39J-H.mjs → icon-VM_Ys9Xn.mjs} +11 -11
- package/dist/{icon-Bs-39J-H.mjs.map → icon-VM_Ys9Xn.mjs.map} +1 -1
- package/dist/icon-button/index.js +1 -1
- package/dist/icon-button/index.mjs +1 -1
- package/dist/icon-button-B2TM0Xby.js +2 -0
- package/dist/{icon-button-DRFf308H.js.map → icon-button-B2TM0Xby.js.map} +1 -1
- package/dist/icon-button-CexCkoV0.mjs +29 -0
- package/dist/{icon-button-C1ThqdK1.mjs.map → icon-button-CexCkoV0.mjs.map} +1 -1
- package/dist/input/index.js +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/{input-BoxJZira.js → input-CADvgFpY.js} +2 -2
- package/dist/{input-BoxJZira.js.map → input-CADvgFpY.js.map} +1 -1
- package/dist/{input-Du9YSgAt.mjs → input-CmlNZ4Bo.mjs} +2 -2
- package/dist/{input-Du9YSgAt.mjs.map → input-CmlNZ4Bo.mjs.map} +1 -1
- package/dist/label/index.js +1 -1
- package/dist/label/index.mjs +1 -1
- package/dist/{label-DO48yda7.js → label-B085X0Sg.js} +2 -2
- package/dist/{label-DO48yda7.js.map → label-B085X0Sg.js.map} +1 -1
- package/dist/{label-RKaPen31.mjs → label-BqWu-wLT.mjs} +6 -6
- package/dist/{label-RKaPen31.mjs.map → label-BqWu-wLT.mjs.map} +1 -1
- package/dist/menu/MenuItemStyles.d.ts +1 -1
- package/dist/menu/index.js +1 -1
- package/dist/menu/index.js.map +1 -1
- package/dist/menu/index.mjs +131 -140
- package/dist/menu/index.mjs.map +1 -1
- package/dist/meter/MeterTrack.styles.d.ts +1 -1
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/index.mjs +3 -3
- package/dist/popover/PopoverContent.styles.d.ts +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/{popover-DVz0JvON.js → popover-B-mcHcLF.js} +2 -2
- package/dist/{popover-DVz0JvON.js.map → popover-B-mcHcLF.js.map} +1 -1
- package/dist/{popover-CGhSHQzb.mjs → popover-COqbFikI.mjs} +17 -17
- package/dist/{popover-CGhSHQzb.mjs.map → popover-COqbFikI.mjs.map} +1 -1
- package/dist/progress/ProgressIndicator.d.ts +1 -1
- package/dist/progress-tracker/index.js +1 -1
- package/dist/progress-tracker/index.mjs +1 -1
- package/dist/radio-group/RadioIndicator.styles.d.ts +1 -1
- package/dist/radio-group/RadioInput.styles.d.ts +1 -1
- package/dist/radio-group/index.js +1 -1
- package/dist/radio-group/index.mjs +37 -37
- package/dist/rating/index.js +1 -1
- package/dist/rating/index.mjs +2 -2
- package/dist/rating-display/index.js +1 -1
- package/dist/rating-display/index.mjs +1 -1
- package/dist/scrolling-list/index.js +1 -1
- package/dist/scrolling-list/index.mjs +3 -3
- package/dist/select/index.js +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/slider/SliderThumb.styles.d.ts +1 -1
- package/dist/slider/SliderTrack.styles.d.ts +1 -1
- package/dist/slider/index.js +1 -1
- package/dist/slider/index.mjs +2 -2
- package/dist/slot/index.js +1 -1
- package/dist/slot/index.mjs +3 -3
- package/dist/spinner/Spinner.styles.d.ts +1 -1
- package/dist/spinner/index.js +1 -1
- package/dist/spinner/index.mjs +1 -1
- package/dist/{spinner-CmPypfJR.js → spinner-BAreohbs.js} +2 -2
- package/dist/{spinner-CmPypfJR.js.map → spinner-BAreohbs.js.map} +1 -1
- package/dist/{spinner-TfGcjNm3.mjs → spinner-DnrZf01S.mjs} +9 -9
- package/dist/{spinner-TfGcjNm3.mjs.map → spinner-DnrZf01S.mjs.map} +1 -1
- package/dist/stepper/index.js +1 -1
- package/dist/stepper/index.mjs +3 -3
- package/dist/switch/SwitchInput.d.ts +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +43 -44
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.js +1 -1
- package/dist/table/index.mjs +3 -3
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +144 -153
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tag/Tag.styles.d.ts +1 -1
- package/dist/tag/index.js +1 -1
- package/dist/tag/index.mjs +37 -37
- package/dist/text-link/TextLink.d.ts +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/index.mjs +1 -1
- package/dist/toast/Toast.styles.d.ts +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast/index.mjs +3 -3
- package/dist/toggle-group/index.js +1 -1
- package/dist/toggle-group/index.js.map +1 -1
- package/dist/toggle-group/index.mjs +16 -21
- package/dist/toggle-group/index.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/accordion/useRenderSlot.d.ts +0 -3
- package/dist/alert-dialog/useRenderSlot.d.ts +0 -3
- package/dist/collapsible/useRenderSlot.d.ts +0 -3
- package/dist/drawer/useRenderSlot.d.ts +0 -3
- package/dist/icon-DY4l9nsc.js +0 -2
- package/dist/icon-button-C1ThqdK1.mjs +0 -29
- package/dist/icon-button-DRFf308H.js +0 -2
- package/dist/menu/useRenderSlot.d.ts +0 -1
- package/dist/tabs/useRenderSlot.d.ts +0 -1
- package/dist/toast/useRenderSlot.d.ts +0 -3
- package/dist/toggle-group/useRenderSlot.d.ts +0 -1
- package/dist/useRenderSlot-5CPC9Lkj.mjs +0 -11
- package/dist/useRenderSlot-5CPC9Lkj.mjs.map +0 -1
- package/dist/useRenderSlot-DHV0CegV.js +0 -2
- package/dist/useRenderSlot-DHV0CegV.js.map +0 -1
package/dist/menu/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/menu/Menu.tsx","../../src/menu/MenuItemStyles.tsx","../../src/menu/useRenderSlot.tsx","../../src/menu/MenuCheckboxItem.tsx","../../src/menu/MenuGroup.tsx","../../src/menu/MenuGroupLabel.tsx","../../src/menu/MenuItem.tsx","../../src/menu/MenuLinkItem.tsx","../../src/menu/MenuPopup.tsx","../../src/menu/MenuPortal.tsx","../../src/menu/MenuSubmenuContext.tsx","../../src/menu/MenuPositioner.tsx","../../src/menu/MenuRadioGroup.tsx","../../src/menu/MenuRadioItem.tsx","../../src/menu/MenuSeparator.tsx","../../src/menu/MenuSubmenu.tsx","../../src/menu/MenuSubmenuTrigger.tsx","../../src/menu/MenuTrigger.tsx","../../src/menu/index.ts"],"sourcesContent":["import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps, type ReactNode } from 'react'\n\nexport interface MenuProps extends Omit<ComponentProps<typeof BaseMenu.Root>, 'children'> {\n /**\n * The content of the menu (trigger, portal, etc.)\n */\n children: ReactNode\n}\n\n/**\n * Root container for menu state and styling context.\n */\nexport const Menu = ({ children, ...rest }: MenuProps) => {\n return (\n <BaseMenu.Root data-spark-component=\"menu\" {...rest}>\n {children}\n </BaseMenu.Root>\n )\n}\n\nMenu.displayName = 'Menu'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nexport const menuItemStyles = cva(\n [\n 'gap-md flex w-full cursor-pointer items-center justify-start',\n 'text-left text-body-1',\n 'transition-colors duration-100',\n 'outline-none',\n 'focus-visible:u-outline focus-visible:-outline-offset-2',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-dim-3',\n 'min-h-sz-44',\n 'px-lg py-md',\n 'data-highlighted:bg-surface-hovered',\n 'data-popup-open:bg-surface-hovered',\n ],\n {\n variants: {\n intent: makeVariants<\n 'intent',\n ['surface', 'main', 'support', 'accent', 'success', 'alert', 'danger', 'info', 'neutral']\n >({\n surface: ['text-on-surface'],\n main: ['text-on-surface'],\n support: ['text-on-surface'],\n accent: ['text-on-surface'],\n success: ['text-on-surface'],\n alert: ['text-on-surface'],\n danger: ['text-on-surface'],\n info: ['text-on-surface'],\n neutral: ['text-on-surface'],\n }),\n },\n defaultVariants: {\n intent: 'surface',\n },\n }\n)\n\nexport type MenuItemStylesProps = VariantProps<typeof menuItemStyles>\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean) {\n return asChild ? ({ ...props }: object) => <Slot {...props} /> : undefined\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { Check } from '@spark-ui/icons/Check'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { menuItemStyles } from './MenuItemStyles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface MenuCheckboxItemProps extends Omit<\n ComponentProps<typeof BaseMenu.CheckboxItem>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item with checkbox functionality.\n * Can be toggled on and off, allowing multiple selections.\n * The checkbox indicator is automatically rendered on the left side.\n */\nexport const MenuCheckboxItem = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuCheckboxItemProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <BaseMenu.CheckboxItem\n ref={ref}\n data-spark-component=\"menu-checkbox-item\"\n render={renderSlot}\n className={cx(\n menuItemStyles({\n className,\n }),\n 'data-checked:font-bold'\n )}\n {...rest}\n >\n <BaseMenu.CheckboxItemIndicator\n keepMounted\n className={cx(\n 'mr-md flex shrink-0 items-center justify-center',\n 'w-sz-16 h-sz-16',\n 'transition-opacity',\n 'data-checked:opacity-100',\n 'opacity-0'\n )}\n >\n <Icon size=\"sm\" intent=\"current\">\n <Check />\n </Icon>\n </BaseMenu.CheckboxItemIndicator>\n {children}\n </BaseMenu.CheckboxItem>\n )\n}\n\nMenuCheckboxItem.displayName = 'Menu.CheckboxItem'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuGroupProps extends ComponentProps<typeof BaseMenu.Group> {}\n\n/**\n * A container for grouping related menu items together.\n * Works with Menu.GroupLabel for semantic grouping.\n */\nexport const MenuGroup = ({ children, className, ...rest }: MenuGroupProps) => {\n return (\n <BaseMenu.Group data-spark-component=\"menu-group\" className={cx('py-sm', className)} {...rest}>\n {children}\n </BaseMenu.Group>\n )\n}\n\nMenuGroup.displayName = 'Menu.Group'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface MenuGroupLabelProps extends Omit<\n ComponentProps<typeof BaseMenu.GroupLabel>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A label for a group of menu items.\n * Provides semantic context and visual separation for grouped items.\n */\nexport const MenuGroupLabel = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuGroupLabelProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <BaseMenu.GroupLabel\n ref={ref}\n data-spark-component=\"menu-group-label\"\n render={renderSlot}\n className={cx('text-on-surface/dim-1 text-body-2 font-bold', 'px-lg py-sm', className)}\n {...rest}\n >\n {children}\n </BaseMenu.GroupLabel>\n )\n}\n\nMenuGroupLabel.displayName = 'Menu.GroupLabel'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { menuItemStyles } from './MenuItemStyles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface MenuItemProps extends Omit<ComponentProps<typeof BaseMenu.Item>, 'render'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item that triggers an action when activated.\n * Renders a clickable menu option with keyboard support.\n */\nexport const MenuItem = ({ asChild = false, children, className, ref, ...rest }: MenuItemProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <BaseMenu.Item\n ref={ref}\n data-spark-component=\"menu-item\"\n render={renderSlot}\n className={menuItemStyles({\n className,\n })}\n {...rest}\n >\n {children}\n </BaseMenu.Item>\n )\n}\n\nMenuItem.displayName = 'Menu.Item'\n","import { Link } from '@spark-ui/icons/Link'\nimport { type ComponentPropsWithoutRef } from 'react'\n\nimport { Icon } from '../icon'\nimport { MenuItem } from './MenuItem'\n\nexport interface MenuLinkItemProps extends Omit<\n ComponentPropsWithoutRef<typeof MenuItem>,\n 'asChild'\n> {\n /**\n * The URL to navigate to.\n */\n href: string\n /**\n * Where to display the linked URL.\n * @default undefined\n */\n target?: string\n /**\n * The relationship between the current document and the linked document.\n * @default undefined\n */\n rel?: string\n}\n\n/**\n * A menu item that acts as a link.\n * Navigates to a URL when activated, useful for navigation menus.\n * Use with Next.js Link or React Router Link via the children prop.\n */\nexport const MenuLinkItem = ({ children, href, target, rel, ...rest }: MenuLinkItemProps) => {\n return (\n <MenuItem asChild {...rest}>\n <a href={href} target={target} rel={rel}>\n <Icon size=\"sm\" intent=\"current\" className=\"ml-auto shrink-0\">\n <Link />\n </Icon>\n <span className=\"flex-1\">{children}</span>\n </a>\n </MenuItem>\n )\n}\n\nMenuLinkItem.displayName = 'Menu.LinkItem'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface MenuPopupProps extends Omit<ComponentProps<typeof BaseMenu.Popup>, 'render'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The scrollable menu container that holds menu items.\n * Serves as the viewport for menu content with overflow handling.\n */\nexport const MenuPopup = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuPopupProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <BaseMenu.Popup\n ref={ref}\n data-spark-component=\"menu-popup\"\n render={renderSlot}\n className={cx(\n [\n 'rounded-md bg-surface shadow-lg min-w-sz-192',\n 'p-sm',\n 'overflow-auto',\n 'z-popover',\n 'data-starting-style:opacity-0',\n 'data-ending-style:opacity-0',\n 'opacity-100',\n 'transition-opacity duration-200',\n ],\n className\n )}\n {...rest}\n >\n {children}\n </BaseMenu.Popup>\n )\n}\n\nMenuPopup.displayName = 'Menu.Popup'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuPortalProps extends ComponentProps<typeof BaseMenu.Portal> {}\n\n/**\n * Portal wrapper that renders the menu in a different part of the DOM tree.\n * Useful for avoiding z-index and overflow issues.\n */\nexport const MenuPortal = ({ children, ...rest }: MenuPortalProps) => {\n return <BaseMenu.Portal {...rest}>{children}</BaseMenu.Portal>\n}\n\nMenuPortal.displayName = 'Menu.Portal'\n","import { createContext, useContext } from 'react'\n\n/**\n * Context to track if we're inside a submenu\n */\nexport const MenuSubmenuContext = createContext<boolean>(false)\n\n/**\n * Hook to check if the current menu is a submenu\n */\nexport const useIsSubmenu = () => {\n return useContext(MenuSubmenuContext)\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps } from 'react'\n\nimport { useIsSubmenu } from './MenuSubmenuContext'\n\nexport interface MenuPositionerProps extends ComponentProps<typeof BaseMenu.Positioner> {}\n\n/**\n * Positioning wrapper for the menu with collision detection.\n * Handles menu placement relative to the trigger and viewport boundaries.\n */\nexport const MenuPositioner = ({ children, sideOffset, ...rest }: MenuPositionerProps) => {\n const isSubmenu = useIsSubmenu()\n\n // Apply sideOffset of 8 for root menu, 0 for submenus (unless explicitly overridden)\n const defaultSideOffset = isSubmenu ? 0 : 8\n const finalSideOffset = sideOffset ?? defaultSideOffset\n\n return (\n <BaseMenu.Positioner sideOffset={finalSideOffset} {...rest}>\n {children}\n </BaseMenu.Positioner>\n )\n}\n\nMenuPositioner.displayName = 'Menu.Positioner'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuRadioGroupProps extends ComponentProps<typeof BaseMenu.RadioGroup> {}\n\n/**\n * A container for radio menu items where only one item can be selected at a time.\n * Manages the selection state for its radio items.\n */\nexport const MenuRadioGroup = ({ children, className, ...rest }: MenuRadioGroupProps) => {\n return (\n <BaseMenu.RadioGroup\n data-spark-component=\"menu-radio-group\"\n className={cx('py-sm', className)}\n {...rest}\n >\n {children}\n </BaseMenu.RadioGroup>\n )\n}\n\nMenuRadioGroup.displayName = 'Menu.RadioGroup'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { Check } from '@spark-ui/icons/Check'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { menuItemStyles } from './MenuItemStyles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface MenuRadioItemProps extends Omit<\n ComponentProps<typeof BaseMenu.RadioItem>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item with radio button functionality.\n * Only one radio item can be selected within its RadioGroup.\n * The radio indicator is automatically rendered on the left side.\n */\nexport const MenuRadioItem = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuRadioItemProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <BaseMenu.RadioItem\n ref={ref}\n data-spark-component=\"menu-radio-item\"\n render={renderSlot}\n className={cx(\n menuItemStyles({\n className,\n }),\n 'data-checked:font-bold'\n )}\n {...rest}\n >\n <BaseMenu.RadioItemIndicator\n keepMounted\n className={cx(\n 'mr-md flex shrink-0 items-center justify-center',\n 'w-sz-16 h-sz-16',\n 'transition-opacity',\n 'data-checked:opacity-100',\n 'opacity-0'\n )}\n >\n <Icon size=\"sm\" intent=\"current\">\n <Check />\n </Icon>\n </BaseMenu.RadioItemIndicator>\n {children}\n </BaseMenu.RadioItem>\n )\n}\n\nMenuRadioItem.displayName = 'Menu.RadioItem'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuSeparatorProps extends ComponentProps<typeof BaseMenu.Separator> {}\n\n/**\n * A visual divider between menu items or groups.\n * Creates clear separation between different sections of the menu.\n */\nexport const MenuSeparator = ({ className, ...rest }: MenuSeparatorProps) => {\n return (\n <BaseMenu.Separator\n data-spark-component=\"menu-separator\"\n className={cx('my-sm h-px bg-outline/dim-2', className)}\n {...rest}\n />\n )\n}\n\nMenuSeparator.displayName = 'Menu.Separator'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps, type ReactNode } from 'react'\n\nimport { MenuSubmenuContext } from './MenuSubmenuContext'\n\nexport interface MenuSubmenuProps extends Omit<\n ComponentProps<typeof BaseMenu.SubmenuRoot>,\n 'children'\n> {\n /**\n * The content of the submenu (trigger, positioner, popup, etc.)\n */\n children: ReactNode\n}\n\n/**\n * A nested submenu that appears when its trigger is activated.\n * Inherits styling context from the parent menu.\n */\nexport const MenuSubmenu = ({ children, ...rest }: MenuSubmenuProps) => {\n return (\n <BaseMenu.SubmenuRoot data-spark-component=\"menu-submenu\" {...rest}>\n <MenuSubmenuContext value={true}>{children}</MenuSubmenuContext>\n </BaseMenu.SubmenuRoot>\n )\n}\n\nMenuSubmenu.displayName = 'Menu.Submenu'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { menuItemStyles } from './MenuItemStyles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface MenuSubmenuTriggerProps extends Omit<\n ComponentProps<typeof BaseMenu.SubmenuTrigger>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item that opens a submenu when activated.\n * Displays an arrow indicator to show submenu availability.\n */\nexport const MenuSubmenuTrigger = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuSubmenuTriggerProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <BaseMenu.SubmenuTrigger\n ref={ref}\n data-spark-component=\"menu-submenu-trigger\"\n render={renderSlot}\n className={menuItemStyles({\n className,\n })}\n {...rest}\n >\n <span className=\"flex-1\">{children}</span>\n <Icon size=\"sm\" intent=\"current\" className=\"ml-auto shrink-0\">\n <ArrowVerticalRight />\n </Icon>\n </BaseMenu.SubmenuTrigger>\n )\n}\n\nMenuSubmenuTrigger.displayName = 'Menu.SubmenuTrigger'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { ArrowHorizontalDown } from '@spark-ui/icons/ArrowHorizontalDown'\nimport { cx } from 'class-variance-authority'\nimport {\n cloneElement,\n isValidElement,\n type ComponentProps,\n type ReactElement,\n type Ref,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface MenuTriggerProps extends Omit<ComponentProps<typeof BaseMenu.Trigger>, 'render'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * The button that toggles the menu.\n * Renders a <button> element by default, or uses asChild for custom elements.\n * When used with asChild and a Button component, automatically adds an ArrowHorizontalDown icon.\n * Button components should use design=\"outlined\" and intent=\"support\".\n */\nexport const MenuTrigger = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuTriggerProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n // When asChild is used with a Button, enhance it with the arrow icon\n const enhancedChildren =\n asChild && isValidElement(children)\n ? cloneElement(\n children as ReactElement,\n {\n design: (children.props as { design?: string }).design ?? 'outlined',\n intent: (children.props as { intent?: string }).intent ?? 'support',\n children: (\n <>\n {(children.props as { children: React.ReactNode }).children}\n <Icon size=\"sm\" intent=\"current\" className=\"shrink-0\">\n <ArrowHorizontalDown />\n </Icon>\n </>\n ),\n } as Partial<unknown>\n )\n : children\n\n return (\n <BaseMenu.Trigger\n ref={ref}\n data-spark-component=\"menu-trigger\"\n render={renderSlot}\n className={cx(\n 'inline-flex items-center justify-center',\n 'focus-visible:u-outline',\n className\n )}\n {...rest}\n >\n {enhancedChildren}\n </BaseMenu.Trigger>\n )\n}\n\nMenuTrigger.displayName = 'Menu.Trigger'\n","import { Menu as Root } from './Menu'\nimport { MenuCheckboxItem } from './MenuCheckboxItem'\nimport { MenuGroup } from './MenuGroup'\nimport { MenuGroupLabel } from './MenuGroupLabel'\nimport { MenuItem } from './MenuItem'\nimport { MenuLinkItem } from './MenuLinkItem'\nimport { MenuPopup } from './MenuPopup'\nimport { MenuPortal } from './MenuPortal'\nimport { MenuPositioner } from './MenuPositioner'\nimport { MenuRadioGroup } from './MenuRadioGroup'\nimport { MenuRadioItem } from './MenuRadioItem'\nimport { MenuSeparator } from './MenuSeparator'\nimport { MenuSubmenu } from './MenuSubmenu'\nimport { MenuSubmenuTrigger } from './MenuSubmenuTrigger'\nimport { MenuTrigger } from './MenuTrigger'\n\n/**\n * A menu component that enables users to select options from a dropdown menu triggered by a button or other interactive element.\n */\nexport const Menu: typeof Root & {\n Trigger: typeof MenuTrigger\n Portal: typeof MenuPortal\n Positioner: typeof MenuPositioner\n Popup: typeof MenuPopup\n Item: typeof MenuItem\n LinkItem: typeof MenuLinkItem\n Submenu: typeof MenuSubmenu\n SubmenuTrigger: typeof MenuSubmenuTrigger\n Group: typeof MenuGroup\n GroupLabel: typeof MenuGroupLabel\n RadioGroup: typeof MenuRadioGroup\n RadioItem: typeof MenuRadioItem\n CheckboxItem: typeof MenuCheckboxItem\n Separator: typeof MenuSeparator\n} = Object.assign(Root, {\n Trigger: MenuTrigger,\n Portal: MenuPortal,\n Positioner: MenuPositioner,\n Popup: MenuPopup,\n Item: MenuItem,\n LinkItem: MenuLinkItem,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n Group: MenuGroup,\n GroupLabel: MenuGroupLabel,\n RadioGroup: MenuRadioGroup,\n RadioItem: MenuRadioItem,\n CheckboxItem: MenuCheckboxItem,\n Separator: MenuSeparator,\n})\n\nMenu.displayName = 'Menu'\nMenuTrigger.displayName = 'Menu.Trigger'\nMenuPortal.displayName = 'Menu.Portal'\nMenuPositioner.displayName = 'Menu.Positioner'\nMenuPopup.displayName = 'Menu.Popup'\nMenuItem.displayName = 'Menu.Item'\nMenuLinkItem.displayName = 'Menu.LinkItem'\nMenuSubmenu.displayName = 'Menu.Submenu'\nMenuSubmenuTrigger.displayName = 'Menu.SubmenuTrigger'\nMenuGroup.displayName = 'Menu.Group'\nMenuGroupLabel.displayName = 'Menu.GroupLabel'\nMenuRadioGroup.displayName = 'Menu.RadioGroup'\nMenuRadioItem.displayName = 'Menu.RadioItem'\nMenuCheckboxItem.displayName = 'Menu.CheckboxItem'\nMenuSeparator.displayName = 'Menu.Separator'\n\nexport { type MenuProps } from './Menu'\nexport { type MenuTriggerProps } from './MenuTrigger'\nexport { type MenuPortalProps } from './MenuPortal'\nexport { type MenuPositionerProps } from './MenuPositioner'\nexport { type MenuPopupProps } from './MenuPopup'\nexport { type MenuItemProps } from './MenuItem'\nexport { type MenuLinkItemProps } from './MenuLinkItem'\nexport { type MenuSubmenuProps } from './MenuSubmenu'\nexport { type MenuSubmenuTriggerProps } from './MenuSubmenuTrigger'\nexport { type MenuGroupProps } from './MenuGroup'\nexport { type MenuGroupLabelProps } from './MenuGroupLabel'\nexport { type MenuRadioGroupProps } from './MenuRadioGroup'\nexport { type MenuRadioItemProps } from './MenuRadioItem'\nexport { type MenuCheckboxItemProps } from './MenuCheckboxItem'\nexport { type MenuSeparatorProps } from './MenuSeparator'\n"],"mappings":"idAaA,IAAa,GAAQ,CAAE,WAAU,GAAG,MAEhC,EAAA,EAAA,IAAA,CAAC,EAAA,KAAS,KAAV,CAAe,uBAAqB,OAAO,GAAI,EAC5C,UACY,CAAA,EAInB,EAAK,YAAc,OClBnB,IAAa,GAAA,EAAA,EAAA,IAAA,CACX,CACE,+DACA,wBACA,iCACA,eACA,0DACA,+DACA,cACA,cACA,sCACA,oCACF,EACA,CACE,SAAU,CACR,QAAA,EAAA,EAAA,aAAA,CAGE,CACA,QAAS,CAAC,iBAAiB,EAC3B,KAAM,CAAC,iBAAiB,EACxB,QAAS,CAAC,iBAAiB,EAC3B,OAAQ,CAAC,iBAAiB,EAC1B,QAAS,CAAC,iBAAiB,EAC3B,MAAO,CAAC,iBAAiB,EACzB,OAAQ,CAAC,iBAAiB,EAC1B,KAAM,CAAC,iBAAiB,EACxB,QAAS,CAAC,iBAAiB,CAC7B,CAAC,CACH,EACA,gBAAiB,CACf,OAAQ,SACV,CACF,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,CACO,MACL,uBAAqB,eACrB,OAAQ,EACR,WAAA,EAAA,EAAA,GAAA,CACE,0CACA,0BACA,CACF,EACA,GAAI,WAEH,CACe,CAAA,CAEtB,EAEA,EAAY,YAAc,eCzD1B,IAAa,EAeT,OAAO,OAAO,EAAM,CACtB,QAAS,EACT,OAAQ,EACR,WAAY,EACZ,MAAO,EACP,KAAM,EACN,SAAU,EACV,QAAS,EACT,eAAgB,EAChB,MAAO,EACP,WAAY,EACZ,WAAY,EACZ,UAAW,EACX,aAAc,EACd,UAAW,CACb,CAAC,EAED,EAAK,YAAc,OACnB,EAAY,YAAc,eAC1B,EAAW,YAAc,cACzB,EAAe,YAAc,kBAC7B,EAAU,YAAc,aACxB,EAAS,YAAc,YACvB,EAAa,YAAc,gBAC3B,EAAY,YAAc,eAC1B,EAAmB,YAAc,sBACjC,EAAU,YAAc,aACxB,EAAe,YAAc,kBAC7B,EAAe,YAAc,kBAC7B,EAAc,YAAc,iBAC5B,EAAiB,YAAc,oBAC/B,EAAc,YAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/menu/Menu.tsx","../../src/menu/MenuItemStyles.tsx","../../src/menu/MenuCheckboxItem.tsx","../../src/menu/MenuGroup.tsx","../../src/menu/MenuGroupLabel.tsx","../../src/menu/MenuItem.tsx","../../src/menu/MenuLinkItem.tsx","../../src/menu/MenuPopup.tsx","../../src/menu/MenuPortal.tsx","../../src/menu/MenuSubmenuContext.tsx","../../src/menu/MenuPositioner.tsx","../../src/menu/MenuRadioGroup.tsx","../../src/menu/MenuRadioItem.tsx","../../src/menu/MenuSeparator.tsx","../../src/menu/MenuSubmenu.tsx","../../src/menu/MenuSubmenuTrigger.tsx","../../src/menu/MenuTrigger.tsx","../../src/menu/index.ts"],"sourcesContent":["import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps, type ReactNode } from 'react'\n\nexport interface MenuProps extends Omit<ComponentProps<typeof BaseMenu.Root>, 'children'> {\n /**\n * The content of the menu (trigger, portal, etc.)\n */\n children: ReactNode\n}\n\n/**\n * Root container for menu state and styling context.\n */\nexport const Menu = ({ children, ...rest }: MenuProps) => {\n return (\n <BaseMenu.Root data-spark-component=\"menu\" {...rest}>\n {children}\n </BaseMenu.Root>\n )\n}\n\nMenu.displayName = 'Menu'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nexport const menuItemStyles = cva(\n [\n 'gap-md flex w-full cursor-pointer items-center justify-start',\n 'text-left text-body-1',\n 'transition-colors duration-100',\n 'outline-none',\n 'focus-visible:u-outline focus-visible:-outline-offset-2',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-dim-3',\n 'min-h-sz-44',\n 'px-lg py-md',\n 'data-highlighted:bg-surface-hovered',\n 'data-popup-open:bg-surface-hovered',\n ],\n {\n variants: {\n intent: makeVariants<\n 'intent',\n ['surface', 'main', 'support', 'accent', 'success', 'alert', 'danger', 'info', 'neutral']\n >({\n surface: ['text-on-surface'],\n main: ['text-on-surface'],\n support: ['text-on-surface'],\n accent: ['text-on-surface'],\n success: ['text-on-surface'],\n alert: ['text-on-surface'],\n danger: ['text-on-surface'],\n info: ['text-on-surface'],\n neutral: ['text-on-surface'],\n }),\n },\n defaultVariants: {\n intent: 'surface',\n },\n }\n)\n\nexport type MenuItemStylesProps = VariantProps<typeof menuItemStyles>\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { Check } from '@spark-ui/icons/Check'\nimport { createRenderSlot } from '@spark-ui/internal-utils'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { menuItemStyles } from './MenuItemStyles'\n\nexport interface MenuCheckboxItemProps extends Omit<\n ComponentProps<typeof BaseMenu.CheckboxItem>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item with checkbox functionality.\n * Can be toggled on and off, allowing multiple selections.\n * The checkbox indicator is automatically rendered on the left side.\n */\nexport const MenuCheckboxItem = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuCheckboxItemProps) => {\n const { renderProp, innerChildren } = createRenderSlot(asChild, children)\n\n return (\n <BaseMenu.CheckboxItem\n ref={ref}\n data-spark-component=\"menu-checkbox-item\"\n render={renderProp}\n className={cx(\n menuItemStyles({\n className,\n }),\n 'data-checked:font-bold'\n )}\n {...rest}\n >\n <BaseMenu.CheckboxItemIndicator\n keepMounted\n className={cx(\n 'mr-md flex shrink-0 items-center justify-center',\n 'w-sz-16 h-sz-16',\n 'transition-opacity',\n 'data-checked:opacity-100',\n 'opacity-0'\n )}\n >\n <Icon size=\"sm\" intent=\"current\">\n <Check />\n </Icon>\n </BaseMenu.CheckboxItemIndicator>\n {innerChildren}\n </BaseMenu.CheckboxItem>\n )\n}\n\nMenuCheckboxItem.displayName = 'Menu.CheckboxItem'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuGroupProps extends ComponentProps<typeof BaseMenu.Group> {}\n\n/**\n * A container for grouping related menu items together.\n * Works with Menu.GroupLabel for semantic grouping.\n */\nexport const MenuGroup = ({ children, className, ...rest }: MenuGroupProps) => {\n return (\n <BaseMenu.Group data-spark-component=\"menu-group\" className={cx('py-sm', className)} {...rest}>\n {children}\n </BaseMenu.Group>\n )\n}\n\nMenuGroup.displayName = 'Menu.Group'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { createRenderSlot } from '@spark-ui/internal-utils'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nexport interface MenuGroupLabelProps extends Omit<\n ComponentProps<typeof BaseMenu.GroupLabel>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A label for a group of menu items.\n * Provides semantic context and visual separation for grouped items.\n */\nexport const MenuGroupLabel = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuGroupLabelProps) => {\n const { renderProp, innerChildren } = createRenderSlot(asChild, children)\n\n return (\n <BaseMenu.GroupLabel\n ref={ref}\n data-spark-component=\"menu-group-label\"\n render={renderProp}\n className={cx('text-on-surface/dim-1 text-body-2 font-bold', 'px-lg py-sm', className)}\n {...rest}\n >\n {innerChildren}\n </BaseMenu.GroupLabel>\n )\n}\n\nMenuGroupLabel.displayName = 'Menu.GroupLabel'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { createRenderSlot } from '@spark-ui/internal-utils'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { menuItemStyles } from './MenuItemStyles'\n\nexport interface MenuItemProps extends Omit<ComponentProps<typeof BaseMenu.Item>, 'render'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item that triggers an action when activated.\n * Renders a clickable menu option with keyboard support.\n */\nexport const MenuItem = ({ asChild = false, children, className, ref, ...rest }: MenuItemProps) => {\n const { renderProp, innerChildren } = createRenderSlot(asChild, children)\n\n return (\n <BaseMenu.Item\n ref={ref}\n data-spark-component=\"menu-item\"\n render={renderProp}\n className={menuItemStyles({\n className,\n })}\n {...rest}\n >\n {innerChildren}\n </BaseMenu.Item>\n )\n}\n\nMenuItem.displayName = 'Menu.Item'\n","import { Link } from '@spark-ui/icons/Link'\nimport { type ComponentPropsWithoutRef } from 'react'\n\nimport { Icon } from '../icon'\nimport { MenuItem } from './MenuItem'\n\nexport interface MenuLinkItemProps extends Omit<\n ComponentPropsWithoutRef<typeof MenuItem>,\n 'asChild'\n> {\n /**\n * The URL to navigate to.\n */\n href: string\n /**\n * Where to display the linked URL.\n * @default undefined\n */\n target?: string\n /**\n * The relationship between the current document and the linked document.\n * @default undefined\n */\n rel?: string\n}\n\n/**\n * A menu item that acts as a link.\n * Navigates to a URL when activated, useful for navigation menus.\n * Use with Next.js Link or React Router Link via the children prop.\n */\nexport const MenuLinkItem = ({ children, href, target, rel, ...rest }: MenuLinkItemProps) => {\n return (\n <MenuItem asChild {...rest}>\n <a href={href} target={target} rel={rel}>\n <Icon size=\"sm\" intent=\"current\" className=\"ml-auto shrink-0\">\n <Link />\n </Icon>\n <span className=\"flex-1\">{children}</span>\n </a>\n </MenuItem>\n )\n}\n\nMenuLinkItem.displayName = 'Menu.LinkItem'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { createRenderSlot } from '@spark-ui/internal-utils'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nexport interface MenuPopupProps extends Omit<ComponentProps<typeof BaseMenu.Popup>, 'render'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The scrollable menu container that holds menu items.\n * Serves as the viewport for menu content with overflow handling.\n */\nexport const MenuPopup = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuPopupProps) => {\n const { renderProp, innerChildren } = createRenderSlot(asChild, children)\n\n return (\n <BaseMenu.Popup\n ref={ref}\n data-spark-component=\"menu-popup\"\n render={renderProp}\n className={cx(\n [\n 'rounded-md bg-surface shadow-lg min-w-sz-192',\n 'p-sm',\n 'overflow-auto',\n 'z-popover',\n 'data-starting-style:opacity-0',\n 'data-ending-style:opacity-0',\n 'opacity-100',\n 'transition-opacity duration-200',\n ],\n className\n )}\n {...rest}\n >\n {innerChildren}\n </BaseMenu.Popup>\n )\n}\n\nMenuPopup.displayName = 'Menu.Popup'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuPortalProps extends ComponentProps<typeof BaseMenu.Portal> {}\n\n/**\n * Portal wrapper that renders the menu in a different part of the DOM tree.\n * Useful for avoiding z-index and overflow issues.\n */\nexport const MenuPortal = ({ children, ...rest }: MenuPortalProps) => {\n return <BaseMenu.Portal {...rest}>{children}</BaseMenu.Portal>\n}\n\nMenuPortal.displayName = 'Menu.Portal'\n","import { createContext, useContext } from 'react'\n\n/**\n * Context to track if we're inside a submenu\n */\nexport const MenuSubmenuContext = createContext<boolean>(false)\n\n/**\n * Hook to check if the current menu is a submenu\n */\nexport const useIsSubmenu = () => {\n return useContext(MenuSubmenuContext)\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps } from 'react'\n\nimport { useIsSubmenu } from './MenuSubmenuContext'\n\nexport interface MenuPositionerProps extends ComponentProps<typeof BaseMenu.Positioner> {}\n\n/**\n * Positioning wrapper for the menu with collision detection.\n * Handles menu placement relative to the trigger and viewport boundaries.\n */\nexport const MenuPositioner = ({ children, sideOffset, ...rest }: MenuPositionerProps) => {\n const isSubmenu = useIsSubmenu()\n\n // Apply sideOffset of 8 for root menu, 0 for submenus (unless explicitly overridden)\n const defaultSideOffset = isSubmenu ? 0 : 8\n const finalSideOffset = sideOffset ?? defaultSideOffset\n\n return (\n <BaseMenu.Positioner sideOffset={finalSideOffset} {...rest}>\n {children}\n </BaseMenu.Positioner>\n )\n}\n\nMenuPositioner.displayName = 'Menu.Positioner'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuRadioGroupProps extends ComponentProps<typeof BaseMenu.RadioGroup> {}\n\n/**\n * A container for radio menu items where only one item can be selected at a time.\n * Manages the selection state for its radio items.\n */\nexport const MenuRadioGroup = ({ children, className, ...rest }: MenuRadioGroupProps) => {\n return (\n <BaseMenu.RadioGroup\n data-spark-component=\"menu-radio-group\"\n className={cx('py-sm', className)}\n {...rest}\n >\n {children}\n </BaseMenu.RadioGroup>\n )\n}\n\nMenuRadioGroup.displayName = 'Menu.RadioGroup'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { Check } from '@spark-ui/icons/Check'\nimport { createRenderSlot } from '@spark-ui/internal-utils'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { menuItemStyles } from './MenuItemStyles'\n\nexport interface MenuRadioItemProps extends Omit<\n ComponentProps<typeof BaseMenu.RadioItem>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item with radio button functionality.\n * Only one radio item can be selected within its RadioGroup.\n * The radio indicator is automatically rendered on the left side.\n */\nexport const MenuRadioItem = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuRadioItemProps) => {\n const { renderProp, innerChildren } = createRenderSlot(asChild, children)\n\n return (\n <BaseMenu.RadioItem\n ref={ref}\n data-spark-component=\"menu-radio-item\"\n render={renderProp}\n className={cx(\n menuItemStyles({\n className,\n }),\n 'data-checked:font-bold'\n )}\n {...rest}\n >\n <BaseMenu.RadioItemIndicator\n keepMounted\n className={cx(\n 'mr-md flex shrink-0 items-center justify-center',\n 'w-sz-16 h-sz-16',\n 'transition-opacity',\n 'data-checked:opacity-100',\n 'opacity-0'\n )}\n >\n <Icon size=\"sm\" intent=\"current\">\n <Check />\n </Icon>\n </BaseMenu.RadioItemIndicator>\n {innerChildren}\n </BaseMenu.RadioItem>\n )\n}\n\nMenuRadioItem.displayName = 'Menu.RadioItem'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentProps } from 'react'\n\nexport interface MenuSeparatorProps extends ComponentProps<typeof BaseMenu.Separator> {}\n\n/**\n * A visual divider between menu items or groups.\n * Creates clear separation between different sections of the menu.\n */\nexport const MenuSeparator = ({ className, ...rest }: MenuSeparatorProps) => {\n return (\n <BaseMenu.Separator\n data-spark-component=\"menu-separator\"\n className={cx('my-sm h-px bg-outline/dim-2', className)}\n {...rest}\n />\n )\n}\n\nMenuSeparator.displayName = 'Menu.Separator'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { type ComponentProps, type ReactNode } from 'react'\n\nimport { MenuSubmenuContext } from './MenuSubmenuContext'\n\nexport interface MenuSubmenuProps extends Omit<\n ComponentProps<typeof BaseMenu.SubmenuRoot>,\n 'children'\n> {\n /**\n * The content of the submenu (trigger, positioner, popup, etc.)\n */\n children: ReactNode\n}\n\n/**\n * A nested submenu that appears when its trigger is activated.\n * Inherits styling context from the parent menu.\n */\nexport const MenuSubmenu = ({ children, ...rest }: MenuSubmenuProps) => {\n return (\n <BaseMenu.SubmenuRoot data-spark-component=\"menu-submenu\" {...rest}>\n <MenuSubmenuContext value={true}>{children}</MenuSubmenuContext>\n </BaseMenu.SubmenuRoot>\n )\n}\n\nMenuSubmenu.displayName = 'Menu.Submenu'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { createRenderSlot } from '@spark-ui/internal-utils'\nimport { type ComponentProps, type Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { menuItemStyles } from './MenuItemStyles'\n\nexport interface MenuSubmenuTriggerProps extends Omit<\n ComponentProps<typeof BaseMenu.SubmenuTrigger>,\n 'render'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * A menu item that opens a submenu when activated.\n * Displays an arrow indicator to show submenu availability.\n */\nexport const MenuSubmenuTrigger = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuSubmenuTriggerProps) => {\n const { renderProp, innerChildren } = createRenderSlot(asChild, children)\n\n return (\n <BaseMenu.SubmenuTrigger\n ref={ref}\n data-spark-component=\"menu-submenu-trigger\"\n render={renderProp}\n className={menuItemStyles({\n className,\n })}\n {...rest}\n >\n <span className=\"flex-1\">{innerChildren}</span>\n <Icon size=\"sm\" intent=\"current\" className=\"ml-auto shrink-0\">\n <ArrowVerticalRight />\n </Icon>\n </BaseMenu.SubmenuTrigger>\n )\n}\n\nMenuSubmenuTrigger.displayName = 'Menu.SubmenuTrigger'\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { ArrowHorizontalDown } from '@spark-ui/icons/ArrowHorizontalDown'\nimport { createRenderSlot } from '@spark-ui/internal-utils'\nimport { cx } from 'class-variance-authority'\nimport {\n cloneElement,\n isValidElement,\n type ComponentProps,\n type ReactElement,\n type Ref,\n} from 'react'\n\nimport { Icon } from '../icon'\n\nexport interface MenuTriggerProps extends Omit<ComponentProps<typeof BaseMenu.Trigger>, 'render'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * The button that toggles the menu.\n * Renders a <button> element by default, or uses asChild for custom elements.\n * When used with asChild and a Button component, automatically adds an ArrowHorizontalDown icon.\n * Button components should use design=\"outlined\" and intent=\"support\".\n */\nexport const MenuTrigger = ({\n asChild = false,\n children,\n className,\n ref,\n ...rest\n}: MenuTriggerProps) => {\n // When asChild is used with a Button, enhance it with the arrow icon\n const enhancedChildren =\n asChild && isValidElement(children)\n ? cloneElement(\n children as ReactElement,\n {\n design: (children.props as { design?: string }).design ?? 'outlined',\n intent: (children.props as { intent?: string }).intent ?? 'support',\n children: (\n <>\n {(children.props as { children: React.ReactNode }).children}\n <Icon size=\"sm\" intent=\"current\" className=\"shrink-0\">\n <ArrowHorizontalDown />\n </Icon>\n </>\n ),\n } as Partial<unknown>\n )\n : children\n\n const { renderProp, innerChildren } = createRenderSlot(asChild, enhancedChildren)\n\n return (\n <BaseMenu.Trigger\n ref={ref}\n data-spark-component=\"menu-trigger\"\n render={renderProp}\n className={cx(\n 'inline-flex items-center justify-center',\n 'focus-visible:u-outline',\n className\n )}\n {...rest}\n >\n {innerChildren}\n </BaseMenu.Trigger>\n )\n}\n\nMenuTrigger.displayName = 'Menu.Trigger'\n","import { Menu as Root } from './Menu'\nimport { MenuCheckboxItem } from './MenuCheckboxItem'\nimport { MenuGroup } from './MenuGroup'\nimport { MenuGroupLabel } from './MenuGroupLabel'\nimport { MenuItem } from './MenuItem'\nimport { MenuLinkItem } from './MenuLinkItem'\nimport { MenuPopup } from './MenuPopup'\nimport { MenuPortal } from './MenuPortal'\nimport { MenuPositioner } from './MenuPositioner'\nimport { MenuRadioGroup } from './MenuRadioGroup'\nimport { MenuRadioItem } from './MenuRadioItem'\nimport { MenuSeparator } from './MenuSeparator'\nimport { MenuSubmenu } from './MenuSubmenu'\nimport { MenuSubmenuTrigger } from './MenuSubmenuTrigger'\nimport { MenuTrigger } from './MenuTrigger'\n\n/**\n * A menu component that enables users to select options from a dropdown menu triggered by a button or other interactive element.\n */\nexport const Menu: typeof Root & {\n Trigger: typeof MenuTrigger\n Portal: typeof MenuPortal\n Positioner: typeof MenuPositioner\n Popup: typeof MenuPopup\n Item: typeof MenuItem\n LinkItem: typeof MenuLinkItem\n Submenu: typeof MenuSubmenu\n SubmenuTrigger: typeof MenuSubmenuTrigger\n Group: typeof MenuGroup\n GroupLabel: typeof MenuGroupLabel\n RadioGroup: typeof MenuRadioGroup\n RadioItem: typeof MenuRadioItem\n CheckboxItem: typeof MenuCheckboxItem\n Separator: typeof MenuSeparator\n} = Object.assign(Root, {\n Trigger: MenuTrigger,\n Portal: MenuPortal,\n Positioner: MenuPositioner,\n Popup: MenuPopup,\n Item: MenuItem,\n LinkItem: MenuLinkItem,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n Group: MenuGroup,\n GroupLabel: MenuGroupLabel,\n RadioGroup: MenuRadioGroup,\n RadioItem: MenuRadioItem,\n CheckboxItem: MenuCheckboxItem,\n Separator: MenuSeparator,\n})\n\nMenu.displayName = 'Menu'\nMenuTrigger.displayName = 'Menu.Trigger'\nMenuPortal.displayName = 'Menu.Portal'\nMenuPositioner.displayName = 'Menu.Positioner'\nMenuPopup.displayName = 'Menu.Popup'\nMenuItem.displayName = 'Menu.Item'\nMenuLinkItem.displayName = 'Menu.LinkItem'\nMenuSubmenu.displayName = 'Menu.Submenu'\nMenuSubmenuTrigger.displayName = 'Menu.SubmenuTrigger'\nMenuGroup.displayName = 'Menu.Group'\nMenuGroupLabel.displayName = 'Menu.GroupLabel'\nMenuRadioGroup.displayName = 'Menu.RadioGroup'\nMenuRadioItem.displayName = 'Menu.RadioItem'\nMenuCheckboxItem.displayName = 'Menu.CheckboxItem'\nMenuSeparator.displayName = 'Menu.Separator'\n\nexport { type MenuProps } from './Menu'\nexport { type MenuTriggerProps } from './MenuTrigger'\nexport { type MenuPortalProps } from './MenuPortal'\nexport { type MenuPositionerProps } from './MenuPositioner'\nexport { type MenuPopupProps } from './MenuPopup'\nexport { type MenuItemProps } from './MenuItem'\nexport { type MenuLinkItemProps } from './MenuLinkItem'\nexport { type MenuSubmenuProps } from './MenuSubmenu'\nexport { type MenuSubmenuTriggerProps } from './MenuSubmenuTrigger'\nexport { type MenuGroupProps } from './MenuGroup'\nexport { type MenuGroupLabelProps } from './MenuGroupLabel'\nexport { type MenuRadioGroupProps } from './MenuRadioGroup'\nexport { type MenuRadioItemProps } from './MenuRadioItem'\nexport { type MenuCheckboxItemProps } from './MenuCheckboxItem'\nexport { type MenuSeparatorProps } from './MenuSeparator'\n"],"mappings":"mbAaA,IAAa,GAAQ,CAAE,WAAU,GAAG,MAEhC,EAAA,EAAA,IAAA,CAAC,EAAA,KAAS,KAAV,CAAe,uBAAqB,OAAO,GAAI,EAC5C,UACY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AAc,YAAc"}
|
package/dist/menu/index.mjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cloneElement as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { ArrowHorizontalDown as
|
|
7
|
-
import { makeVariants as f } from "@spark-ui/internal-utils";
|
|
1
|
+
import { t as e } from "../icon-VM_Ys9Xn.mjs";
|
|
2
|
+
import { createRenderSlot as t, makeVariants as n } from "@spark-ui/internal-utils";
|
|
3
|
+
import { cva as r, cx as i } from "class-variance-authority";
|
|
4
|
+
import { cloneElement as a, createContext as o, isValidElement as s, useContext as c } from "react";
|
|
5
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
|
+
import { ArrowHorizontalDown as f } from "@spark-ui/icons/ArrowHorizontalDown";
|
|
8
7
|
import { ArrowVerticalRight as p } from "@spark-ui/icons/ArrowVerticalRight";
|
|
9
8
|
import { Check as m } from "@spark-ui/icons/Check";
|
|
10
9
|
import { Menu as h } from "@base-ui/react/menu";
|
|
11
10
|
import { Link as g } from "@spark-ui/icons/Link";
|
|
12
11
|
//#region src/menu/Menu.tsx
|
|
13
|
-
var _ = ({ children: e, ...t }) => /* @__PURE__ */
|
|
12
|
+
var _ = ({ children: e, ...t }) => /* @__PURE__ */ u(h.Root, {
|
|
14
13
|
"data-spark-component": "menu",
|
|
15
14
|
...t,
|
|
16
15
|
children: e
|
|
@@ -18,7 +17,7 @@ var _ = ({ children: e, ...t }) => /* @__PURE__ */ l(h.Root, {
|
|
|
18
17
|
_.displayName = "Menu";
|
|
19
18
|
//#endregion
|
|
20
19
|
//#region src/menu/MenuItemStyles.tsx
|
|
21
|
-
var v =
|
|
20
|
+
var v = r([
|
|
22
21
|
"gap-md flex w-full cursor-pointer items-center justify-start",
|
|
23
22
|
"text-left text-body-1",
|
|
24
23
|
"transition-colors duration-100",
|
|
@@ -30,7 +29,7 @@ var v = n([
|
|
|
30
29
|
"data-highlighted:bg-surface-hovered",
|
|
31
30
|
"data-popup-open:bg-surface-hovered"
|
|
32
31
|
], {
|
|
33
|
-
variants: { intent:
|
|
32
|
+
variants: { intent: n({
|
|
34
33
|
surface: ["text-on-surface"],
|
|
35
34
|
main: ["text-on-surface"],
|
|
36
35
|
support: ["text-on-surface"],
|
|
@@ -42,101 +41,93 @@ var v = n([
|
|
|
42
41
|
neutral: ["text-on-surface"]
|
|
43
42
|
}) },
|
|
44
43
|
defaultVariants: { intent: "surface" }
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return t ? ({ ...t }) => /* @__PURE__ */ l(e, { ...t }) : void 0;
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/menu/MenuCheckboxItem.tsx
|
|
53
|
-
var b = ({ asChild: e = !1, children: n, className: i, ref: a, ...o }) => {
|
|
54
|
-
let s = y(e);
|
|
55
|
-
return /* @__PURE__ */ u(h.CheckboxItem, {
|
|
56
|
-
ref: a,
|
|
44
|
+
}), y = ({ asChild: n = !1, children: r, className: a, ref: o, ...s }) => {
|
|
45
|
+
let { renderProp: c, innerChildren: l } = t(n, r);
|
|
46
|
+
return /* @__PURE__ */ d(h.CheckboxItem, {
|
|
47
|
+
ref: o,
|
|
57
48
|
"data-spark-component": "menu-checkbox-item",
|
|
58
|
-
render:
|
|
59
|
-
className:
|
|
60
|
-
...
|
|
61
|
-
children: [/* @__PURE__ */
|
|
49
|
+
render: c,
|
|
50
|
+
className: i(v({ className: a }), "data-checked:font-bold"),
|
|
51
|
+
...s,
|
|
52
|
+
children: [/* @__PURE__ */ u(h.CheckboxItemIndicator, {
|
|
62
53
|
keepMounted: !0,
|
|
63
|
-
className:
|
|
64
|
-
children: /* @__PURE__ */
|
|
54
|
+
className: i("mr-md flex shrink-0 items-center justify-center", "w-sz-16 h-sz-16", "transition-opacity", "data-checked:opacity-100", "opacity-0"),
|
|
55
|
+
children: /* @__PURE__ */ u(e, {
|
|
65
56
|
size: "sm",
|
|
66
57
|
intent: "current",
|
|
67
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ u(m, {})
|
|
68
59
|
})
|
|
69
|
-
}),
|
|
60
|
+
}), l]
|
|
70
61
|
});
|
|
71
62
|
};
|
|
72
|
-
|
|
63
|
+
y.displayName = "Menu.CheckboxItem";
|
|
73
64
|
//#endregion
|
|
74
65
|
//#region src/menu/MenuGroup.tsx
|
|
75
|
-
var
|
|
66
|
+
var b = ({ children: e, className: t, ...n }) => /* @__PURE__ */ u(h.Group, {
|
|
76
67
|
"data-spark-component": "menu-group",
|
|
77
|
-
className:
|
|
68
|
+
className: i("py-sm", t),
|
|
78
69
|
...n,
|
|
79
70
|
children: e
|
|
80
71
|
});
|
|
81
|
-
|
|
72
|
+
b.displayName = "Menu.Group";
|
|
82
73
|
//#endregion
|
|
83
74
|
//#region src/menu/MenuGroupLabel.tsx
|
|
84
|
-
var
|
|
85
|
-
let
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
ref:
|
|
75
|
+
var x = ({ asChild: e = !1, children: n, className: r, ref: a, ...o }) => {
|
|
76
|
+
let { renderProp: s, innerChildren: c } = t(e, n);
|
|
77
|
+
return /* @__PURE__ */ u(h.GroupLabel, {
|
|
78
|
+
ref: a,
|
|
88
79
|
"data-spark-component": "menu-group-label",
|
|
89
|
-
render:
|
|
90
|
-
className:
|
|
91
|
-
...
|
|
92
|
-
children:
|
|
80
|
+
render: s,
|
|
81
|
+
className: i("text-on-surface/dim-1 text-body-2 font-bold", "px-lg py-sm", r),
|
|
82
|
+
...o,
|
|
83
|
+
children: c
|
|
93
84
|
});
|
|
94
85
|
};
|
|
95
|
-
|
|
86
|
+
x.displayName = "Menu.GroupLabel";
|
|
96
87
|
//#endregion
|
|
97
88
|
//#region src/menu/MenuItem.tsx
|
|
98
|
-
var
|
|
99
|
-
let
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
ref:
|
|
89
|
+
var S = ({ asChild: e = !1, children: n, className: r, ref: i, ...a }) => {
|
|
90
|
+
let { renderProp: o, innerChildren: s } = t(e, n);
|
|
91
|
+
return /* @__PURE__ */ u(h.Item, {
|
|
92
|
+
ref: i,
|
|
102
93
|
"data-spark-component": "menu-item",
|
|
103
|
-
render:
|
|
104
|
-
className: v({ className:
|
|
105
|
-
...
|
|
106
|
-
children:
|
|
94
|
+
render: o,
|
|
95
|
+
className: v({ className: r }),
|
|
96
|
+
...a,
|
|
97
|
+
children: s
|
|
107
98
|
});
|
|
108
99
|
};
|
|
109
|
-
|
|
100
|
+
S.displayName = "Menu.Item";
|
|
110
101
|
//#endregion
|
|
111
102
|
//#region src/menu/MenuLinkItem.tsx
|
|
112
|
-
var
|
|
103
|
+
var C = ({ children: t, href: n, target: r, rel: i, ...a }) => /* @__PURE__ */ u(S, {
|
|
113
104
|
asChild: !0,
|
|
114
105
|
...a,
|
|
115
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ d("a", {
|
|
116
107
|
href: n,
|
|
117
108
|
target: r,
|
|
118
109
|
rel: i,
|
|
119
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ u(e, {
|
|
120
111
|
size: "sm",
|
|
121
112
|
intent: "current",
|
|
122
113
|
className: "ml-auto shrink-0",
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
-
}), /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ u(g, {})
|
|
115
|
+
}), /* @__PURE__ */ u("span", {
|
|
125
116
|
className: "flex-1",
|
|
126
|
-
children:
|
|
117
|
+
children: t
|
|
127
118
|
})]
|
|
128
119
|
})
|
|
129
120
|
});
|
|
130
|
-
|
|
121
|
+
C.displayName = "Menu.LinkItem";
|
|
131
122
|
//#endregion
|
|
132
123
|
//#region src/menu/MenuPopup.tsx
|
|
133
|
-
var
|
|
134
|
-
let
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
ref:
|
|
124
|
+
var w = ({ asChild: e = !1, children: n, className: r, ref: a, ...o }) => {
|
|
125
|
+
let { renderProp: s, innerChildren: c } = t(e, n);
|
|
126
|
+
return /* @__PURE__ */ u(h.Popup, {
|
|
127
|
+
ref: a,
|
|
137
128
|
"data-spark-component": "menu-popup",
|
|
138
|
-
render:
|
|
139
|
-
className:
|
|
129
|
+
render: s,
|
|
130
|
+
className: i([
|
|
140
131
|
"rounded-md bg-surface shadow-lg min-w-sz-192",
|
|
141
132
|
"p-sm",
|
|
142
133
|
"overflow-auto",
|
|
@@ -145,145 +136,145 @@ var T = ({ asChild: e = !1, children: t, className: n, ref: i, ...a }) => {
|
|
|
145
136
|
"data-ending-style:opacity-0",
|
|
146
137
|
"opacity-100",
|
|
147
138
|
"transition-opacity duration-200"
|
|
148
|
-
],
|
|
149
|
-
...
|
|
150
|
-
children:
|
|
139
|
+
], r),
|
|
140
|
+
...o,
|
|
141
|
+
children: c
|
|
151
142
|
});
|
|
152
143
|
};
|
|
153
|
-
|
|
144
|
+
w.displayName = "Menu.Popup";
|
|
154
145
|
//#endregion
|
|
155
146
|
//#region src/menu/MenuPortal.tsx
|
|
156
|
-
var
|
|
147
|
+
var T = ({ children: e, ...t }) => /* @__PURE__ */ u(h.Portal, {
|
|
157
148
|
...t,
|
|
158
149
|
children: e
|
|
159
150
|
});
|
|
160
|
-
|
|
151
|
+
T.displayName = "Menu.Portal";
|
|
161
152
|
//#endregion
|
|
162
153
|
//#region src/menu/MenuSubmenuContext.tsx
|
|
163
|
-
var
|
|
164
|
-
let r =
|
|
165
|
-
return /* @__PURE__ */
|
|
154
|
+
var E = o(!1), D = () => c(E), O = ({ children: e, sideOffset: t, ...n }) => {
|
|
155
|
+
let r = D() ? 0 : 8, i = t ?? r;
|
|
156
|
+
return /* @__PURE__ */ u(h.Positioner, {
|
|
166
157
|
sideOffset: i,
|
|
167
158
|
...n,
|
|
168
159
|
children: e
|
|
169
160
|
});
|
|
170
161
|
};
|
|
171
|
-
|
|
162
|
+
O.displayName = "Menu.Positioner";
|
|
172
163
|
//#endregion
|
|
173
164
|
//#region src/menu/MenuRadioGroup.tsx
|
|
174
|
-
var
|
|
165
|
+
var k = ({ children: e, className: t, ...n }) => /* @__PURE__ */ u(h.RadioGroup, {
|
|
175
166
|
"data-spark-component": "menu-radio-group",
|
|
176
|
-
className:
|
|
167
|
+
className: i("py-sm", t),
|
|
177
168
|
...n,
|
|
178
169
|
children: e
|
|
179
170
|
});
|
|
180
|
-
|
|
171
|
+
k.displayName = "Menu.RadioGroup";
|
|
181
172
|
//#endregion
|
|
182
173
|
//#region src/menu/MenuRadioItem.tsx
|
|
183
|
-
var
|
|
184
|
-
let
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
ref:
|
|
174
|
+
var A = ({ asChild: n = !1, children: r, className: a, ref: o, ...s }) => {
|
|
175
|
+
let { renderProp: c, innerChildren: l } = t(n, r);
|
|
176
|
+
return /* @__PURE__ */ d(h.RadioItem, {
|
|
177
|
+
ref: o,
|
|
187
178
|
"data-spark-component": "menu-radio-item",
|
|
188
|
-
render:
|
|
189
|
-
className:
|
|
190
|
-
...
|
|
191
|
-
children: [/* @__PURE__ */
|
|
179
|
+
render: c,
|
|
180
|
+
className: i(v({ className: a }), "data-checked:font-bold"),
|
|
181
|
+
...s,
|
|
182
|
+
children: [/* @__PURE__ */ u(h.RadioItemIndicator, {
|
|
192
183
|
keepMounted: !0,
|
|
193
|
-
className:
|
|
194
|
-
children: /* @__PURE__ */
|
|
184
|
+
className: i("mr-md flex shrink-0 items-center justify-center", "w-sz-16 h-sz-16", "transition-opacity", "data-checked:opacity-100", "opacity-0"),
|
|
185
|
+
children: /* @__PURE__ */ u(e, {
|
|
195
186
|
size: "sm",
|
|
196
187
|
intent: "current",
|
|
197
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ u(m, {})
|
|
198
189
|
})
|
|
199
|
-
}),
|
|
190
|
+
}), l]
|
|
200
191
|
});
|
|
201
192
|
};
|
|
202
|
-
|
|
193
|
+
A.displayName = "Menu.RadioItem";
|
|
203
194
|
//#endregion
|
|
204
195
|
//#region src/menu/MenuSeparator.tsx
|
|
205
|
-
var
|
|
196
|
+
var j = ({ className: e, ...t }) => /* @__PURE__ */ u(h.Separator, {
|
|
206
197
|
"data-spark-component": "menu-separator",
|
|
207
|
-
className:
|
|
198
|
+
className: i("my-sm h-px bg-outline/dim-2", e),
|
|
208
199
|
...t
|
|
209
200
|
});
|
|
210
|
-
|
|
201
|
+
j.displayName = "Menu.Separator";
|
|
211
202
|
//#endregion
|
|
212
203
|
//#region src/menu/MenuSubmenu.tsx
|
|
213
|
-
var
|
|
204
|
+
var M = ({ children: e, ...t }) => /* @__PURE__ */ u(h.SubmenuRoot, {
|
|
214
205
|
"data-spark-component": "menu-submenu",
|
|
215
206
|
...t,
|
|
216
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ u(E, {
|
|
217
208
|
value: !0,
|
|
218
209
|
children: e
|
|
219
210
|
})
|
|
220
211
|
});
|
|
221
|
-
|
|
212
|
+
M.displayName = "Menu.Submenu";
|
|
222
213
|
//#endregion
|
|
223
214
|
//#region src/menu/MenuSubmenuTrigger.tsx
|
|
224
|
-
var
|
|
225
|
-
let
|
|
226
|
-
return /* @__PURE__ */
|
|
227
|
-
ref:
|
|
215
|
+
var N = ({ asChild: n = !1, children: r, className: i, ref: a, ...o }) => {
|
|
216
|
+
let { renderProp: s, innerChildren: c } = t(n, r);
|
|
217
|
+
return /* @__PURE__ */ d(h.SubmenuTrigger, {
|
|
218
|
+
ref: a,
|
|
228
219
|
"data-spark-component": "menu-submenu-trigger",
|
|
229
|
-
render:
|
|
230
|
-
className: v({ className:
|
|
231
|
-
...
|
|
232
|
-
children: [/* @__PURE__ */
|
|
220
|
+
render: s,
|
|
221
|
+
className: v({ className: i }),
|
|
222
|
+
...o,
|
|
223
|
+
children: [/* @__PURE__ */ u("span", {
|
|
233
224
|
className: "flex-1",
|
|
234
|
-
children:
|
|
235
|
-
}), /* @__PURE__ */
|
|
225
|
+
children: c
|
|
226
|
+
}), /* @__PURE__ */ u(e, {
|
|
236
227
|
size: "sm",
|
|
237
228
|
intent: "current",
|
|
238
229
|
className: "ml-auto shrink-0",
|
|
239
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ u(p, {})
|
|
240
231
|
})]
|
|
241
232
|
});
|
|
242
233
|
};
|
|
243
|
-
|
|
234
|
+
N.displayName = "Menu.SubmenuTrigger";
|
|
244
235
|
//#endregion
|
|
245
236
|
//#region src/menu/MenuTrigger.tsx
|
|
246
|
-
var
|
|
247
|
-
let
|
|
248
|
-
design:
|
|
249
|
-
intent:
|
|
250
|
-
children: /* @__PURE__ */
|
|
237
|
+
var P = ({ asChild: n = !1, children: r, className: o, ref: c, ...p }) => {
|
|
238
|
+
let { renderProp: m, innerChildren: g } = t(n, n && s(r) ? a(r, {
|
|
239
|
+
design: r.props.design ?? "outlined",
|
|
240
|
+
intent: r.props.intent ?? "support",
|
|
241
|
+
children: /* @__PURE__ */ d(l, { children: [r.props.children, /* @__PURE__ */ u(e, {
|
|
251
242
|
size: "sm",
|
|
252
243
|
intent: "current",
|
|
253
244
|
className: "shrink-0",
|
|
254
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ u(f, {})
|
|
255
246
|
})] })
|
|
256
|
-
}) :
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
ref:
|
|
247
|
+
}) : r);
|
|
248
|
+
return /* @__PURE__ */ u(h.Trigger, {
|
|
249
|
+
ref: c,
|
|
259
250
|
"data-spark-component": "menu-trigger",
|
|
260
|
-
render:
|
|
261
|
-
className:
|
|
262
|
-
...
|
|
263
|
-
children:
|
|
251
|
+
render: m,
|
|
252
|
+
className: i("inline-flex items-center justify-center", "focus-visible:u-outline", o),
|
|
253
|
+
...p,
|
|
254
|
+
children: g
|
|
264
255
|
});
|
|
265
256
|
};
|
|
266
|
-
|
|
257
|
+
P.displayName = "Menu.Trigger";
|
|
267
258
|
//#endregion
|
|
268
259
|
//#region src/menu/index.ts
|
|
269
|
-
var
|
|
270
|
-
Trigger:
|
|
271
|
-
Portal:
|
|
272
|
-
Positioner:
|
|
273
|
-
Popup:
|
|
274
|
-
Item:
|
|
275
|
-
LinkItem:
|
|
276
|
-
Submenu:
|
|
277
|
-
SubmenuTrigger:
|
|
278
|
-
Group:
|
|
279
|
-
GroupLabel:
|
|
280
|
-
RadioGroup:
|
|
281
|
-
RadioItem:
|
|
282
|
-
CheckboxItem:
|
|
283
|
-
Separator:
|
|
260
|
+
var F = Object.assign(_, {
|
|
261
|
+
Trigger: P,
|
|
262
|
+
Portal: T,
|
|
263
|
+
Positioner: O,
|
|
264
|
+
Popup: w,
|
|
265
|
+
Item: S,
|
|
266
|
+
LinkItem: C,
|
|
267
|
+
Submenu: M,
|
|
268
|
+
SubmenuTrigger: N,
|
|
269
|
+
Group: b,
|
|
270
|
+
GroupLabel: x,
|
|
271
|
+
RadioGroup: k,
|
|
272
|
+
RadioItem: A,
|
|
273
|
+
CheckboxItem: y,
|
|
274
|
+
Separator: j
|
|
284
275
|
});
|
|
285
|
-
|
|
276
|
+
F.displayName = "Menu", P.displayName = "Menu.Trigger", T.displayName = "Menu.Portal", O.displayName = "Menu.Positioner", w.displayName = "Menu.Popup", S.displayName = "Menu.Item", C.displayName = "Menu.LinkItem", M.displayName = "Menu.Submenu", N.displayName = "Menu.SubmenuTrigger", b.displayName = "Menu.Group", x.displayName = "Menu.GroupLabel", k.displayName = "Menu.RadioGroup", A.displayName = "Menu.RadioItem", y.displayName = "Menu.CheckboxItem", j.displayName = "Menu.Separator";
|
|
286
277
|
//#endregion
|
|
287
|
-
export {
|
|
278
|
+
export { F as Menu };
|
|
288
279
|
|
|
289
280
|
//# sourceMappingURL=index.mjs.map
|