@utilitywarehouse/hearth-react 0.30.3 → 0.31.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.
Files changed (102) hide show
  1. package/dist/chunk-52NQJSZ4.cjs +4 -0
  2. package/dist/chunk-52NQJSZ4.cjs.map +1 -0
  3. package/dist/chunk-7CV7RBFK.js +4 -0
  4. package/dist/chunk-7CV7RBFK.js.map +1 -0
  5. package/dist/chunk-DSRDXNH3.cjs +4 -0
  6. package/dist/chunk-DSRDXNH3.cjs.map +1 -0
  7. package/dist/chunk-E37ICSZV.js +4 -0
  8. package/dist/chunk-E37ICSZV.js.map +1 -0
  9. package/dist/chunk-ECA6VI7J.js +4 -0
  10. package/dist/chunk-ECA6VI7J.js.map +1 -0
  11. package/dist/chunk-EUOX7RSZ.js +4 -0
  12. package/dist/chunk-EUOX7RSZ.js.map +1 -0
  13. package/dist/chunk-GDJ3WYMP.cjs +4 -0
  14. package/dist/chunk-GDJ3WYMP.cjs.map +1 -0
  15. package/dist/chunk-NJMLALZH.js +4 -0
  16. package/dist/chunk-NJMLALZH.js.map +1 -0
  17. package/dist/chunk-OSQTRLPK.js +4 -0
  18. package/dist/chunk-OSQTRLPK.js.map +1 -0
  19. package/dist/chunk-PQPP4JZR.cjs +4 -0
  20. package/dist/chunk-PQPP4JZR.cjs.map +1 -0
  21. package/dist/chunk-UXOZQAZJ.cjs +4 -0
  22. package/dist/chunk-UXOZQAZJ.cjs.map +1 -0
  23. package/dist/chunk-WDLLAQFF.cjs +4 -0
  24. package/dist/chunk-WDLLAQFF.cjs.map +1 -0
  25. package/dist/chunk-XPPODAZP.cjs +4 -0
  26. package/dist/chunk-XPPODAZP.cjs.map +1 -0
  27. package/dist/chunk-XVV4DBFD.js +4 -0
  28. package/dist/chunk-XVV4DBFD.js.map +1 -0
  29. package/dist/components/Menu/Menu.cjs +1 -1
  30. package/dist/components/Menu/Menu.d.ts +2 -0
  31. package/dist/components/Menu/Menu.d.ts.map +1 -1
  32. package/dist/components/Menu/Menu.js +1 -1
  33. package/dist/components/Menu/Menu.props.d.ts +8 -3
  34. package/dist/components/Menu/Menu.props.d.ts.map +1 -1
  35. package/dist/components/Menu/MenuContent.cjs +1 -1
  36. package/dist/components/Menu/MenuContent.cjs.map +1 -1
  37. package/dist/components/Menu/MenuContent.d.ts +1 -1
  38. package/dist/components/Menu/MenuContent.d.ts.map +1 -1
  39. package/dist/components/Menu/MenuContent.js +1 -1
  40. package/dist/components/Menu/MenuContent.props.d.ts +21 -4
  41. package/dist/components/Menu/MenuContent.props.d.ts.map +1 -1
  42. package/dist/components/Menu/MenuItem.cjs +1 -1
  43. package/dist/components/Menu/MenuItem.cjs.map +1 -1
  44. package/dist/components/Menu/MenuItem.d.ts.map +1 -1
  45. package/dist/components/Menu/MenuItem.js +1 -1
  46. package/dist/components/Menu/MenuItem.props.d.ts +21 -4
  47. package/dist/components/Menu/MenuItem.props.d.ts.map +1 -1
  48. package/dist/components/Menu/MenuTrigger.cjs +1 -1
  49. package/dist/components/Menu/MenuTrigger.js +1 -1
  50. package/dist/components/Menu/MenuTrigger.props.d.ts +10 -3
  51. package/dist/components/Menu/MenuTrigger.props.d.ts.map +1 -1
  52. package/dist/components/SegmentedControl/SegmentedControl.cjs +4 -0
  53. package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -0
  54. package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
  55. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -0
  56. package/dist/components/SegmentedControl/SegmentedControl.js +4 -0
  57. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
  58. package/dist/components/SegmentedControl/SegmentedControl.props.cjs +4 -0
  59. package/dist/components/SegmentedControl/SegmentedControl.props.cjs.map +1 -0
  60. package/dist/components/SegmentedControl/SegmentedControl.props.d.ts +23 -0
  61. package/dist/components/SegmentedControl/SegmentedControl.props.d.ts.map +1 -0
  62. package/dist/components/SegmentedControl/SegmentedControl.props.js +4 -0
  63. package/dist/components/SegmentedControl/SegmentedControl.props.js.map +1 -0
  64. package/dist/components/SegmentedControl/SegmentedControlOption.cjs +4 -0
  65. package/dist/components/SegmentedControl/SegmentedControlOption.cjs.map +1 -0
  66. package/dist/components/SegmentedControl/SegmentedControlOption.d.ts +9 -0
  67. package/dist/components/SegmentedControl/SegmentedControlOption.d.ts.map +1 -0
  68. package/dist/components/SegmentedControl/SegmentedControlOption.js +4 -0
  69. package/dist/components/SegmentedControl/SegmentedControlOption.js.map +1 -0
  70. package/dist/components/SegmentedControl/SegmentedControlOption.props.cjs +3 -0
  71. package/dist/components/SegmentedControl/SegmentedControlOption.props.cjs.map +1 -0
  72. package/dist/components/SegmentedControl/SegmentedControlOption.props.d.ts +17 -0
  73. package/dist/components/SegmentedControl/SegmentedControlOption.props.d.ts.map +1 -0
  74. package/dist/components/SegmentedControl/SegmentedControlOption.props.js +3 -0
  75. package/dist/components/SegmentedControl/SegmentedControlOption.props.js.map +1 -0
  76. package/dist/index.cjs +1 -1
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.d.ts +4 -0
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +1 -1
  81. package/package.json +3 -3
  82. package/public/llms/components/menu.md +161 -33
  83. package/public/llms/components/segmented-control.md +295 -0
  84. package/public/llms/docs/getting-started.md +1 -1
  85. package/public/llms.txt +2 -1
  86. package/styles.css +1 -1
  87. package/dist/chunk-7BXFXDDZ.js +0 -4
  88. package/dist/chunk-7BXFXDDZ.js.map +0 -1
  89. package/dist/chunk-BCAGQPQD.cjs +0 -4
  90. package/dist/chunk-BCAGQPQD.cjs.map +0 -1
  91. package/dist/chunk-GVIVGMOJ.js +0 -4
  92. package/dist/chunk-GVIVGMOJ.js.map +0 -1
  93. package/dist/chunk-GVUQYOSO.cjs +0 -4
  94. package/dist/chunk-GVUQYOSO.cjs.map +0 -1
  95. package/dist/chunk-K3AF4B5W.cjs +0 -4
  96. package/dist/chunk-K3AF4B5W.cjs.map +0 -1
  97. package/dist/chunk-NLZMPDP5.cjs +0 -4
  98. package/dist/chunk-NLZMPDP5.cjs.map +0 -1
  99. package/dist/chunk-PRWRW3JD.js +0 -4
  100. package/dist/chunk-PRWRW3JD.js.map +0 -1
  101. package/dist/chunk-PXIOYGGU.js +0 -4
  102. package/dist/chunk-PXIOYGGU.js.map +0 -1
@@ -1,4 +0,0 @@
1
- "use client";
2
-
3
- import{a as u}from"./chunk-J3AJBV4B.js";import{b as t}from"./chunk-PDEVCIQ3.js";import{DropdownMenu as c,ScrollArea as r}from"radix-ui";import{forwardRef as R,useCallback as w,useRef as m}from"react";import{useMergedRefs as A}from"@base-ui/utils/useMergedRefs";import{jsx as n,jsxs as N}from"react/jsx-runtime";var p="MenuContent",d=t(p),S={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},h=R(({className:f,children:g,forceMount:o,placement:v="bottomLeft",...b},M)=>{let l=m(null),i=m(void 0),C=w(e=>{if(l.current=e,i.current?.(),i.current=void 0,!e||!o)return;e.hidden=e.dataset.state!=="open";let a=new MutationObserver(()=>{e.hidden=e.dataset.state!=="open"});a.observe(e,{attributes:!0,attributeFilter:["data-state"]}),i.current=()=>{a.disconnect(),e.hidden=!1}},[o]),E=A(C,M);return n(c.DropdownMenuPortal,{forceMount:o,children:n(c.DropdownMenuContent,{ref:E,forceMount:o,className:u(d,f),...b,sideOffset:4,...S[v],collisionPadding:8,onCloseAutoFocus:e=>e.preventDefault(),onInteractOutside:o?e=>{let P=e.detail?.originalEvent?.target,s=l.current?.getAttribute("aria-labelledby");(s?document.getElementById(s):null)?.contains(P)&&e.preventDefault()}:void 0,children:N(r.Root,{className:t("ScrollAreaRoot"),type:"auto",children:[n(r.Viewport,{className:t("ScrollAreaViewport"),children:n("div",{className:`${d}List`,children:g})}),n(r.Scrollbar,{className:t("ScrollAreaScrollbar"),orientation:"vertical",children:n(r.Thumb,{className:t("ScrollAreaThumb")})})]})})})});h.displayName=p;export{h as a};
4
- //# sourceMappingURL=chunk-7BXFXDDZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Menu/MenuContent.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '../../helpers/cn';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { DropdownMenu as MenuPrimitive, ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport type { MenuContentProps } from './MenuContent.props';\nimport { forwardRef, useCallback, useRef } from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport type { ComponentRef } from 'react';\n\nconst COMPONENT_NAME = 'MenuContent';\nconst componentClassName = withGlobalPrefix(COMPONENT_NAME);\n\ntype MenuContentElement = ComponentRef<'div'>;\n\nconst placementTranslation: Record<string, { side: 'bottom' | 'top'; align: 'start' | 'end' }> = {\n bottomLeft: { side: 'bottom', align: 'start' },\n bottomRight: { side: 'bottom', align: 'end' },\n topLeft: { side: 'top', align: 'start' },\n topRight: { side: 'top', align: 'end' },\n};\n\nexport const MenuContent = forwardRef<MenuContentElement, MenuContentProps>(\n ({ className, children, forceMount, placement = 'bottomLeft', ...props }, ref) => {\n const nodeRef = useRef<MenuContentElement | null>(null);\n const cleanupRef = useRef<(() => void) | undefined>(undefined);\n\n // There are times the content needs to be hidden but present in the DOM,\n // for SEO reasons. So we use forceMount.\n //\n // A callback ref is used instead of useLayoutEffect + useRef because\n // portal children's refs are not reliably attached by the time\n // useLayoutEffect fires in the parent. The callback fires exactly when the\n // DOM node is created or removed.\n const contentRef = useCallback(\n (node: MenuContentElement | null) => {\n nodeRef.current = node;\n cleanupRef.current?.();\n cleanupRef.current = undefined;\n\n if (!node || !forceMount) return;\n\n node.hidden = node.dataset.state !== 'open';\n\n const observer = new MutationObserver(() => {\n node.hidden = node.dataset.state !== 'open';\n });\n observer.observe(node, { attributes: true, attributeFilter: ['data-state'] });\n\n cleanupRef.current = () => {\n observer.disconnect();\n node.hidden = false;\n };\n },\n [forceMount]\n );\n\n const mergedRef = useMergedRefs(contentRef, ref);\n\n return (\n <MenuPrimitive.DropdownMenuPortal forceMount={forceMount}>\n <MenuPrimitive.DropdownMenuContent\n ref={mergedRef}\n forceMount={forceMount}\n className={cn(componentClassName, className)}\n {...props}\n sideOffset={4}\n {...placementTranslation[placement]}\n collisionPadding={8}\n // These are temporary UI fixes, until we have time to replace with Base UI.\n onCloseAutoFocus={e => e.preventDefault()}\n onInteractOutside={\n forceMount\n ? e => {\n // With forceMount, Radix's DismissableLayer is always mounted and fires\n // on every outside interaction — including trigger clicks. React processes\n // pointer events with flushSync, so by the time the DismissableLayer's\n // document listener fires (added via setTimeout after mount), React has\n // already committed the new open state. Checking data-state here would\n // always see 'open' and fail to prevent. Instead we check the click target:\n // if it's inside the trigger (found via aria-labelledby → trigger id),\n // we prevent the dismiss so the trigger's own toggle handler takes effect.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalEvent = (e as CustomEvent).detail?.originalEvent as\n | PointerEvent\n | undefined;\n const target = originalEvent?.target as HTMLElement | null;\n const triggerId = nodeRef.current?.getAttribute('aria-labelledby');\n const triggerEl = triggerId ? document.getElementById(triggerId) : null;\n if (triggerEl?.contains(target)) e.preventDefault();\n }\n : undefined\n }\n >\n <ScrollAreaPrimitive.Root className={withGlobalPrefix('ScrollAreaRoot')} type=\"auto\">\n <ScrollAreaPrimitive.Viewport className={withGlobalPrefix('ScrollAreaViewport')}>\n <div className={`${componentClassName}List`}>{children}</div>\n </ScrollAreaPrimitive.Viewport>\n <ScrollAreaPrimitive.Scrollbar\n className={withGlobalPrefix('ScrollAreaScrollbar')}\n orientation=\"vertical\"\n >\n <ScrollAreaPrimitive.Thumb className={withGlobalPrefix('ScrollAreaThumb')} />\n </ScrollAreaPrimitive.Scrollbar>\n </ScrollAreaPrimitive.Root>\n </MenuPrimitive.DropdownMenuContent>\n </MenuPrimitive.DropdownMenuPortal>\n );\n }\n);\n\nMenuContent.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AoBI,CAAS,EAC1C,GAAGI,EACJ,WAAY,EACX,GAAGN,EAAqBK,CAAS,EAClC,iBAAkB,EAElB,iBAAkB,GAAK,EAAE,eAAe,EACxC,kBACED,EACI,GAAK,CAaH,IAAMW,EAHiB,EAAkB,QAAQ,eAGnB,OACxBC,EAAYR,EAAQ,SAAS,aAAa,iBAAiB,GAC/CQ,EAAY,SAAS,eAAeA,CAAS,EAAI,OACpD,SAASD,CAAM,GAAG,EAAE,eAAe,CACpD,EACA,OAGN,SAAAnB,EAACN,EAAoB,KAApB,CAAyB,UAAWS,EAAiB,gBAAgB,EAAG,KAAK,OAC5E,UAAAJ,EAACL,EAAoB,SAApB,CAA6B,UAAWS,EAAiB,oBAAoB,EAC5E,SAAAJ,EAAC,OAAI,UAAW,GAAGG,CAAkB,OAAS,SAAAK,EAAS,EACzD,EACAR,EAACL,EAAoB,UAApB,CACC,UAAWS,EAAiB,qBAAqB,EACjD,YAAY,WAEZ,SAAAJ,EAACL,EAAoB,MAApB,CAA0B,UAAWS,EAAiB,iBAAiB,EAAG,EAC7E,GACF,EACF,EACF,CAEJ,CACF,EAEAE,EAAY,YAAcJ","names":["MenuPrimitive","ScrollAreaPrimitive","forwardRef","useCallback","useRef","useMergedRefs","jsx","jsxs","COMPONENT_NAME","componentClassName","withGlobalPrefix","placementTranslation","MenuContent","className","children","forceMount","placement","props","ref","nodeRef","cleanupRef","contentRef","node","observer","mergedRef","cn","target","triggerId"]}
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
- var _radixui = require('radix-ui');var _jsxruntime = require('react/jsx-runtime');var p=o=>_jsxruntime.jsx.call(void 0, _radixui.DropdownMenu.Root,{...o});p.displayName="Menu";exports.a = p;
4
- //# sourceMappingURL=chunk-BCAGQPQD.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-BCAGQPQD.cjs","../src/components/Menu/Menu.tsx"],"names":["Menu","props","jsx","MenuPrimitive"],"mappings":"AAAA,qFAAY;AACZ;ACEA,mCAA8C,+CAEJ,IAA7BA,CAAAA,CAAQC,CAAAA,EAAqBC,6BAAAA,qBAACC,CAAc,IAAA,CAAd,CAAoB,GAAGF,CAAAA,CAAO,CAAA,CAEzED,CAAAA,CAAK,WAAA,CAAc,MAAA,CAAA,cAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-BCAGQPQD.cjs","sourcesContent":[null,"'use client';\n\nimport type { MenuProps } from './Menu.props';\nimport { DropdownMenu as MenuPrimitive } from 'radix-ui';\n\nexport const Menu = (props: MenuProps) => <MenuPrimitive.Root {...props} />;\n\nMenu.displayName = 'Menu';\n"]}
@@ -1,4 +0,0 @@
1
- "use client";
2
-
3
- import{DropdownMenu as e}from"radix-ui";import{jsx as n}from"react/jsx-runtime";var p=o=>n(e.Root,{...o});p.displayName="Menu";export{p as a};
4
- //# sourceMappingURL=chunk-GVIVGMOJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Menu/Menu.tsx"],"sourcesContent":["'use client';\n\nimport type { MenuProps } from './Menu.props';\nimport { DropdownMenu as MenuPrimitive } from 'radix-ui';\n\nexport const Menu = (props: MenuProps) => <MenuPrimitive.Root {...props} />;\n\nMenu.displayName = 'Menu';\n"],"mappings":";;AAGA,OAAS,gBAAgBA,MAAqB,WAEJ,cAAAC,MAAA,oBAAnC,IAAMC,EAAQC,GAAqBF,EAACD,EAAc,KAAd,CAAoB,GAAGG,EAAO,EAEzED,EAAK,YAAc","names":["MenuPrimitive","jsx","Menu","props"]}
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
- var _chunkONNSZMWFcjs = require('./chunk-ONNSZMWF.cjs');var _chunk4Q432K4Wcjs = require('./chunk-4Q432K4W.cjs');var _react = require('react');var _radixui = require('radix-ui');var _jsxruntime = require('react/jsx-runtime');var t="MenuItem",s=_chunk4Q432K4Wcjs.b.call(void 0, t),a= exports.a =_react.forwardRef.call(void 0, ({className:m,colorScheme:n="functional",...r},p)=>_jsxruntime.jsx.call(void 0, _radixui.DropdownMenu.DropdownMenuItem,{ref:p,className:_chunkONNSZMWFcjs.a.call(void 0, s,m),"data-colorscheme":n,...r}));a.displayName=t;exports.a = a;
4
- //# sourceMappingURL=chunk-GVUQYOSO.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-GVUQYOSO.cjs","../src/components/Menu/MenuItem.tsx"],"names":["COMPONENT_NAME","componentClassName","withGlobalPrefix","MenuItem","forwardRef","className","colorScheme","props","ref","jsx","MenuPrimitive","cn"],"mappings":"AAAA,qFAAY;AACZ;AACA,wDAAwC,wDAAyC,8BCAtD,mCAGmB,+CAYxC,IARAA,CAAAA,CAAiB,UAAA,CACjBC,CAAAA,CAAqBC,iCAAAA,CAA+B,CAAA,CAI7CC,CAAAA,aAAWC,+BAAAA,CACrB,CAAE,SAAA,CAAAC,CAAAA,CAAW,WAAA,CAAAC,CAAAA,CAAc,YAAA,CAAc,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAElDC,6BAAAA,qBAACC,CAAc,gBAAA,CAAd,CACC,GAAA,CAAKF,CAAAA,CACL,SAAA,CAAWG,iCAAAA,CAAGV,CAAoBI,CAAS,CAAA,CAC3C,kBAAA,CAAkBC,CAAAA,CACjB,GAAGC,CAAAA,CACN,CAGN,CAAA,CAEAJ,CAAAA,CAAS,WAAA,CAAcH,CAAAA,CAAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-GVUQYOSO.cjs","sourcesContent":[null,"'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../helpers/cn';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { DropdownMenu as MenuPrimitive } from 'radix-ui';\nimport type { MenuItemProps } from './MenuItem.props';\nimport type { ComponentRef } from 'react';\n\nconst COMPONENT_NAME = 'MenuItem';\nconst componentClassName = withGlobalPrefix(COMPONENT_NAME);\n\ntype MenuItemElement = ComponentRef<'div'>;\n\nexport const MenuItem = forwardRef<MenuItemElement, MenuItemProps>(\n ({ className, colorScheme = 'functional', ...props }, ref) => {\n return (\n <MenuPrimitive.DropdownMenuItem\n ref={ref}\n className={cn(componentClassName, className)}\n data-colorscheme={colorScheme}\n {...props}\n />\n );\n }\n);\n\nMenuItem.displayName = COMPONENT_NAME;\n"]}
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
-
3
- var _chunkONNSZMWFcjs = require('./chunk-ONNSZMWF.cjs');var _chunk4Q432K4Wcjs = require('./chunk-4Q432K4W.cjs');var _radixui = require('radix-ui');var _react = require('react');var _useMergedRefs = require('@base-ui/utils/useMergedRefs');var _jsxruntime = require('react/jsx-runtime');var p="MenuContent",d=_chunk4Q432K4Wcjs.b.call(void 0, p),S={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},h= exports.a =_react.forwardRef.call(void 0, ({className:f,children:g,forceMount:o,placement:v="bottomLeft",...b},M)=>{let l=_react.useRef.call(void 0, null),i=_react.useRef.call(void 0, void 0),C=_react.useCallback.call(void 0, e=>{if(l.current=e,_optionalChain([i, 'access', _ => _.current, 'optionalCall', _2 => _2()]),i.current=void 0,!e||!o)return;e.hidden=e.dataset.state!=="open";let a=new MutationObserver(()=>{e.hidden=e.dataset.state!=="open"});a.observe(e,{attributes:!0,attributeFilter:["data-state"]}),i.current=()=>{a.disconnect(),e.hidden=!1}},[o]),E=_useMergedRefs.useMergedRefs.call(void 0, C,M);return _jsxruntime.jsx.call(void 0, _radixui.DropdownMenu.DropdownMenuPortal,{forceMount:o,children:_jsxruntime.jsx.call(void 0, _radixui.DropdownMenu.DropdownMenuContent,{ref:E,forceMount:o,className:_chunkONNSZMWFcjs.a.call(void 0, d,f),...b,sideOffset:4,...S[v],collisionPadding:8,onCloseAutoFocus:e=>e.preventDefault(),onInteractOutside:o?e=>{let P=_optionalChain([e, 'access', _3 => _3.detail, 'optionalAccess', _4 => _4.originalEvent, 'optionalAccess', _5 => _5.target]),s=_optionalChain([l, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8("aria-labelledby")]);_optionalChain([(s?document.getElementById(s):null), 'optionalAccess', _9 => _9.contains, 'call', _10 => _10(P)])&&e.preventDefault()}:void 0,children:_jsxruntime.jsxs.call(void 0, _radixui.ScrollArea.Root,{className:_chunk4Q432K4Wcjs.b.call(void 0, "ScrollAreaRoot"),type:"auto",children:[_jsxruntime.jsx.call(void 0, _radixui.ScrollArea.Viewport,{className:_chunk4Q432K4Wcjs.b.call(void 0, "ScrollAreaViewport"),children:_jsxruntime.jsx.call(void 0, "div",{className:`${d}List`,children:g})}),_jsxruntime.jsx.call(void 0, _radixui.ScrollArea.Scrollbar,{className:_chunk4Q432K4Wcjs.b.call(void 0, "ScrollAreaScrollbar"),orientation:"vertical",children:_jsxruntime.jsx.call(void 0, _radixui.ScrollArea.Thumb,{className:_chunk4Q432K4Wcjs.b.call(void 0, "ScrollAreaThumb")})})]})})})});h.displayName=p;exports.a = h;
4
- //# sourceMappingURL=chunk-K3AF4B5W.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-K3AF4B5W.cjs","../src/components/Menu/MenuContent.tsx"],"names":["COMPONENT_NAME","componentClassName","withGlobalPrefix","placementTranslation","MenuContent","forwardRef","className","children","forceMount","placement","props","ref","nodeRef","useRef","cleanupRef","contentRef","useCallback","node","observer","mergedRef","useMergedRefs","jsx","MenuPrimitive","cn","target","triggerId","jsxs","ScrollAreaPrimitive"],"mappings":"AAAA,ylBAAY;AACZ;AACA,wDAAwC,wDAAyC,mCCEA,8BAEjC,6DAClB,+CAuFpB,IApFJA,CAAAA,CAAiB,aAAA,CACjBC,CAAAA,CAAqBC,iCAAAA,CAA+B,CAAA,CAIpDC,CAAAA,CAA2F,CAC/F,UAAA,CAAY,CAAE,IAAA,CAAM,QAAA,CAAU,KAAA,CAAO,OAAQ,CAAA,CAC7C,WAAA,CAAa,CAAE,IAAA,CAAM,QAAA,CAAU,KAAA,CAAO,KAAM,CAAA,CAC5C,OAAA,CAAS,CAAE,IAAA,CAAM,KAAA,CAAO,KAAA,CAAO,OAAQ,CAAA,CACvC,QAAA,CAAU,CAAE,IAAA,CAAM,KAAA,CAAO,KAAA,CAAO,KAAM,CACxC,CAAA,CAEaC,CAAAA,aAAcC,+BAAAA,CACxB,CAAE,SAAA,CAAAC,CAAAA,CAAW,QAAA,CAAAC,CAAAA,CAAU,UAAA,CAAAC,CAAAA,CAAY,SAAA,CAAAC,CAAAA,CAAY,YAAA,CAAc,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAQ,CAChF,IAAMC,CAAAA,CAAUC,2BAAAA,IAAsC,CAAA,CAChDC,CAAAA,CAAaD,2BAAAA,KAAiC,CAAS,CAAA,CASvDE,CAAAA,CAAaC,gCAAAA,CAChBC,EAAoC,CAKnC,EAAA,CAJAL,CAAAA,CAAQ,OAAA,CAAUK,CAAAA,iBAClBH,CAAAA,mBAAW,OAAA,0BAAA,CAAU,GAAA,CACrBA,CAAAA,CAAW,OAAA,CAAU,KAAA,CAAA,CAEjB,CAACG,CAAAA,EAAQ,CAACT,CAAAA,CAAY,MAAA,CAE1BS,CAAAA,CAAK,MAAA,CAASA,CAAAA,CAAK,OAAA,CAA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6BACpD,QAAA,qBAASD,CAAM,GAAA,EAAG,CAAA,CAAE,cAAA,CAAe,CACpD,CAAA,CACA,KAAA,CAAA,CAGN,QAAA,CAAAE,8BAAAA,mBAACC,CAAoB,IAAA,CAApB,CAAyB,SAAA,CAAWzB,iCAAAA,gBAAiC,CAAA,CAAG,IAAA,CAAK,MAAA,CAC5E,QAAA,CAAA,CAAAmB,6BAAAA,mBAACM,CAAoB,QAAA,CAApB,CAA6B,SAAA,CAAWzB,iCAAAA,oBAAqC,CAAA,CAC5E,QAAA,CAAAmB,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAW,CAAA,EAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-K3AF4B5W.cjs","sourcesContent":[null,"'use client';\n\nimport { cn } from '../../helpers/cn';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { DropdownMenu as MenuPrimitive, ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport type { MenuContentProps } from './MenuContent.props';\nimport { forwardRef, useCallback, useRef } from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport type { ComponentRef } from 'react';\n\nconst COMPONENT_NAME = 'MenuContent';\nconst componentClassName = withGlobalPrefix(COMPONENT_NAME);\n\ntype MenuContentElement = ComponentRef<'div'>;\n\nconst placementTranslation: Record<string, { side: 'bottom' | 'top'; align: 'start' | 'end' }> = {\n bottomLeft: { side: 'bottom', align: 'start' },\n bottomRight: { side: 'bottom', align: 'end' },\n topLeft: { side: 'top', align: 'start' },\n topRight: { side: 'top', align: 'end' },\n};\n\nexport const MenuContent = forwardRef<MenuContentElement, MenuContentProps>(\n ({ className, children, forceMount, placement = 'bottomLeft', ...props }, ref) => {\n const nodeRef = useRef<MenuContentElement | null>(null);\n const cleanupRef = useRef<(() => void) | undefined>(undefined);\n\n // There are times the content needs to be hidden but present in the DOM,\n // for SEO reasons. So we use forceMount.\n //\n // A callback ref is used instead of useLayoutEffect + useRef because\n // portal children's refs are not reliably attached by the time\n // useLayoutEffect fires in the parent. The callback fires exactly when the\n // DOM node is created or removed.\n const contentRef = useCallback(\n (node: MenuContentElement | null) => {\n nodeRef.current = node;\n cleanupRef.current?.();\n cleanupRef.current = undefined;\n\n if (!node || !forceMount) return;\n\n node.hidden = node.dataset.state !== 'open';\n\n const observer = new MutationObserver(() => {\n node.hidden = node.dataset.state !== 'open';\n });\n observer.observe(node, { attributes: true, attributeFilter: ['data-state'] });\n\n cleanupRef.current = () => {\n observer.disconnect();\n node.hidden = false;\n };\n },\n [forceMount]\n );\n\n const mergedRef = useMergedRefs(contentRef, ref);\n\n return (\n <MenuPrimitive.DropdownMenuPortal forceMount={forceMount}>\n <MenuPrimitive.DropdownMenuContent\n ref={mergedRef}\n forceMount={forceMount}\n className={cn(componentClassName, className)}\n {...props}\n sideOffset={4}\n {...placementTranslation[placement]}\n collisionPadding={8}\n // These are temporary UI fixes, until we have time to replace with Base UI.\n onCloseAutoFocus={e => e.preventDefault()}\n onInteractOutside={\n forceMount\n ? e => {\n // With forceMount, Radix's DismissableLayer is always mounted and fires\n // on every outside interaction — including trigger clicks. React processes\n // pointer events with flushSync, so by the time the DismissableLayer's\n // document listener fires (added via setTimeout after mount), React has\n // already committed the new open state. Checking data-state here would\n // always see 'open' and fail to prevent. Instead we check the click target:\n // if it's inside the trigger (found via aria-labelledby → trigger id),\n // we prevent the dismiss so the trigger's own toggle handler takes effect.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalEvent = (e as CustomEvent).detail?.originalEvent as\n | PointerEvent\n | undefined;\n const target = originalEvent?.target as HTMLElement | null;\n const triggerId = nodeRef.current?.getAttribute('aria-labelledby');\n const triggerEl = triggerId ? document.getElementById(triggerId) : null;\n if (triggerEl?.contains(target)) e.preventDefault();\n }\n : undefined\n }\n >\n <ScrollAreaPrimitive.Root className={withGlobalPrefix('ScrollAreaRoot')} type=\"auto\">\n <ScrollAreaPrimitive.Viewport className={withGlobalPrefix('ScrollAreaViewport')}>\n <div className={`${componentClassName}List`}>{children}</div>\n </ScrollAreaPrimitive.Viewport>\n <ScrollAreaPrimitive.Scrollbar\n className={withGlobalPrefix('ScrollAreaScrollbar')}\n orientation=\"vertical\"\n >\n <ScrollAreaPrimitive.Thumb className={withGlobalPrefix('ScrollAreaThumb')} />\n </ScrollAreaPrimitive.Scrollbar>\n </ScrollAreaPrimitive.Root>\n </MenuPrimitive.DropdownMenuContent>\n </MenuPrimitive.DropdownMenuPortal>\n );\n }\n);\n\nMenuContent.displayName = COMPONENT_NAME;\n"]}
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
- var _chunkONNSZMWFcjs = require('./chunk-ONNSZMWF.cjs');var _chunk4Q432K4Wcjs = require('./chunk-4Q432K4W.cjs');var _react = require('react');var _radixui = require('radix-ui');var _jsxruntime = require('react/jsx-runtime');var o="MenuTrigger",g=_chunk4Q432K4Wcjs.b.call(void 0, o),s= exports.a =_react.forwardRef.call(void 0, ({className:n,...t},i)=>_jsxruntime.jsx.call(void 0, _radixui.DropdownMenu.DropdownMenuTrigger,{ref:i,className:_chunkONNSZMWFcjs.a.call(void 0, g,n),asChild:!0,...t}));s.displayName=o;exports.a = s;
4
- //# sourceMappingURL=chunk-NLZMPDP5.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/hearth/hearth/packages/react/dist/chunk-NLZMPDP5.cjs","../src/components/Menu/MenuTrigger.tsx"],"names":["COMPONENT_NAME","componentClassName","withGlobalPrefix","MenuTrigger","forwardRef","className","props","ref","jsx","MenuPrimitive","cn"],"mappings":"AAAA,qFAAY;AACZ;AACA,wDAAwC,wDAAyC,8BCAtD,mCAGmB,+CAYxC,IARAA,CAAAA,CAAiB,aAAA,CACjBC,CAAAA,CAAqBC,iCAAAA,CAA+B,CAAA,CAI7CC,CAAAA,aAAcC,+BAAAA,CACxB,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAEtBC,6BAAAA,qBAACC,CAAc,mBAAA,CAAd,CACC,GAAA,CAAKF,CAAAA,CACL,SAAA,CAAWG,iCAAAA,CAAGT,CAAoBI,CAAS,CAAA,CAC3C,OAAA,CAAO,CAAA,CAAA,CACN,GAAGC,CAAAA,CACN,CAGN,CAAA,CAEAH,CAAAA,CAAY,WAAA,CAAcH,CAAAA,CAAAA,cAAAA","file":"/home/runner/work/hearth/hearth/packages/react/dist/chunk-NLZMPDP5.cjs","sourcesContent":[null,"'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../helpers/cn';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { DropdownMenu as MenuPrimitive } from 'radix-ui';\nimport type { MenuTriggerProps } from './MenuTrigger.props';\nimport type { ComponentRef } from 'react';\n\nconst COMPONENT_NAME = 'MenuTrigger';\nconst componentClassName = withGlobalPrefix(COMPONENT_NAME);\n\ntype MenuTriggerElement = ComponentRef<'button'>;\n\nexport const MenuTrigger = forwardRef<MenuTriggerElement, MenuTriggerProps>(\n ({ className, ...props }, ref) => {\n return (\n <MenuPrimitive.DropdownMenuTrigger\n ref={ref}\n className={cn(componentClassName, className)}\n asChild\n {...props}\n />\n );\n }\n);\n\nMenuTrigger.displayName = COMPONENT_NAME;\n"]}
@@ -1,4 +0,0 @@
1
- "use client";
2
-
3
- import{a as e}from"./chunk-J3AJBV4B.js";import{b as o}from"./chunk-PDEVCIQ3.js";import{forwardRef as i}from"react";import{DropdownMenu as f}from"radix-ui";import{jsx as u}from"react/jsx-runtime";var t="MenuItem",s=o(t),a=i(({className:m,colorScheme:n="functional",...r},p)=>u(f.DropdownMenuItem,{ref:p,className:e(s,m),"data-colorscheme":n,...r}));a.displayName=t;export{a};
4
- //# sourceMappingURL=chunk-PRWRW3JD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Menu/MenuItem.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../helpers/cn';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { DropdownMenu as MenuPrimitive } from 'radix-ui';\nimport type { MenuItemProps } from './MenuItem.props';\nimport type { ComponentRef } from 'react';\n\nconst COMPONENT_NAME = 'MenuItem';\nconst componentClassName = withGlobalPrefix(COMPONENT_NAME);\n\ntype MenuItemElement = ComponentRef<'div'>;\n\nexport const MenuItem = forwardRef<MenuItemElement, MenuItemProps>(\n ({ className, colorScheme = 'functional', ...props }, ref) => {\n return (\n <MenuPrimitive.DropdownMenuItem\n ref={ref}\n className={cn(componentClassName, className)}\n data-colorscheme={colorScheme}\n {...props}\n />\n );\n }\n);\n\nMenuItem.displayName = COMPONENT_NAME;\n"],"mappings":";;gFAEA,OAAS,cAAAA,MAAkB,QAG3B,OAAS,gBAAgBC,MAAqB,WAYxC,cAAAC,MAAA,oBARN,IAAMC,EAAiB,WACjBC,EAAqBC,EAAiBF,CAAc,EAI7CG,EAAWC,EACtB,CAAC,CAAE,UAAAC,EAAW,YAAAC,EAAc,aAAc,GAAGC,CAAM,EAAGC,IAElDT,EAACD,EAAc,iBAAd,CACC,IAAKU,EACL,UAAWC,EAAGR,EAAoBI,CAAS,EAC3C,mBAAkBC,EACjB,GAAGC,EACN,CAGN,EAEAJ,EAAS,YAAcH","names":["forwardRef","MenuPrimitive","jsx","COMPONENT_NAME","componentClassName","withGlobalPrefix","MenuItem","forwardRef","className","colorScheme","props","ref","cn"]}
@@ -1,4 +0,0 @@
1
- "use client";
2
-
3
- import{a as e}from"./chunk-J3AJBV4B.js";import{b as r}from"./chunk-PDEVCIQ3.js";import{forwardRef as m}from"react";import{DropdownMenu as p}from"radix-ui";import{jsx as f}from"react/jsx-runtime";var o="MenuTrigger",g=r(o),s=m(({className:n,...t},i)=>f(p.DropdownMenuTrigger,{ref:i,className:e(g,n),asChild:!0,...t}));s.displayName=o;export{s as a};
4
- //# sourceMappingURL=chunk-PXIOYGGU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Menu/MenuTrigger.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../helpers/cn';\nimport { withGlobalPrefix } from '../../helpers/with-global-prefix';\nimport { DropdownMenu as MenuPrimitive } from 'radix-ui';\nimport type { MenuTriggerProps } from './MenuTrigger.props';\nimport type { ComponentRef } from 'react';\n\nconst COMPONENT_NAME = 'MenuTrigger';\nconst componentClassName = withGlobalPrefix(COMPONENT_NAME);\n\ntype MenuTriggerElement = ComponentRef<'button'>;\n\nexport const MenuTrigger = forwardRef<MenuTriggerElement, MenuTriggerProps>(\n ({ className, ...props }, ref) => {\n return (\n <MenuPrimitive.DropdownMenuTrigger\n ref={ref}\n className={cn(componentClassName, className)}\n asChild\n {...props}\n />\n );\n }\n);\n\nMenuTrigger.displayName = COMPONENT_NAME;\n"],"mappings":";;gFAEA,OAAS,cAAAA,MAAkB,QAG3B,OAAS,gBAAgBC,MAAqB,WAYxC,cAAAC,MAAA,oBARN,IAAMC,EAAiB,cACjBC,EAAqBC,EAAiBF,CAAc,EAI7CG,EAAcC,EACzB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAEtBR,EAACD,EAAc,oBAAd,CACC,IAAKS,EACL,UAAWC,EAAGP,EAAoBI,CAAS,EAC3C,QAAO,GACN,GAAGC,EACN,CAGN,EAEAH,EAAY,YAAcH","names":["forwardRef","MenuPrimitive","jsx","COMPONENT_NAME","componentClassName","withGlobalPrefix","MenuTrigger","forwardRef","className","props","ref","cn"]}