@ryuzaki13/react-foundation-ui 3.4.3 → 3.5.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 (168) hide show
  1. package/dist/badge/index.js +65 -2
  2. package/dist/badge/index.js.map +1 -0
  3. package/dist/barcode-scanner/index.js +18 -18
  4. package/dist/base-table/index.js +2 -2
  5. package/dist/button/index.js +1 -1
  6. package/dist/check-box/index.js +1 -1
  7. package/dist/chunks/{CalendarView-Dm55k0bN.js → CalendarView-CwbPJG2Y.js} +86 -86
  8. package/dist/chunks/{CalendarView-Dm55k0bN.js.map → CalendarView-CwbPJG2Y.js.map} +1 -1
  9. package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js → ImageViewerRuntime-DZpgxzF1.js} +25 -25
  10. package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js.map → ImageViewerRuntime-DZpgxzF1.js.map} +1 -1
  11. package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js → TextEditorLexicalClient-BRp8jHId.js} +354 -354
  12. package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js.map → TextEditorLexicalClient-BRp8jHId.js.map} +1 -1
  13. package/dist/chunks/{base-table-BWvKfI2W.js → base-table-BHmboNzl.js} +138 -138
  14. package/dist/chunks/{base-table-BWvKfI2W.js.map → base-table-BHmboNzl.js.map} +1 -1
  15. package/dist/chunks/{button-DF21yxVp.js → button-D7GAU2Wa.js} +20 -20
  16. package/dist/chunks/{button-DF21yxVp.js.map → button-D7GAU2Wa.js.map} +1 -1
  17. package/dist/chunks/{check-box-CZyhzmR0.js → check-box-D_Y6iIWv.js} +19 -19
  18. package/dist/chunks/{check-box-CZyhzmR0.js.map → check-box-D_Y6iIWv.js.map} +1 -1
  19. package/dist/chunks/{context-menu-DgvXGCuI.js → context-menu-BQePxRpu.js} +159 -159
  20. package/dist/chunks/{context-menu-DgvXGCuI.js.map → context-menu-BQePxRpu.js.map} +1 -1
  21. package/dist/chunks/{date-input-D7aBsPJc.js → date-input-Crijdmmq.js} +67 -67
  22. package/dist/chunks/{date-input-D7aBsPJc.js.map → date-input-Crijdmmq.js.map} +1 -1
  23. package/dist/chunks/{date-range-preset-select-BLnY47cv.js → date-range-preset-select-CyzGMvVp.js} +6 -6
  24. package/dist/chunks/{date-range-preset-select-BLnY47cv.js.map → date-range-preset-select-CyzGMvVp.js.map} +1 -1
  25. package/dist/chunks/{dialog-1Z1zCNCe.js → dialog-BcQGVNbu.js} +13 -13
  26. package/dist/chunks/{dialog-1Z1zCNCe.js.map → dialog-BcQGVNbu.js.map} +1 -1
  27. package/dist/chunks/{flex-C7njxZ74.js → flex-DtXK7OM4.js} +29 -29
  28. package/dist/chunks/{flex-C7njxZ74.js.map → flex-DtXK7OM4.js.map} +1 -1
  29. package/dist/chunks/{floating-arrow-DPKwJfww.js → floating-arrow-DKUKx2ZQ.js} +7 -7
  30. package/dist/chunks/{floating-arrow-DPKwJfww.js.map → floating-arrow-DKUKx2ZQ.js.map} +1 -1
  31. package/dist/chunks/{input-DSPKgiCK.js → input-CuRK9Vbz.js} +78 -78
  32. package/dist/chunks/{input-DSPKgiCK.js.map → input-CuRK9Vbz.js.map} +1 -1
  33. package/dist/chunks/{input-files-tIS17-zX.js → input-files-B8j6Pb_M.js} +31 -31
  34. package/dist/chunks/{input-files-tIS17-zX.js.map → input-files-B8j6Pb_M.js.map} +1 -1
  35. package/dist/chunks/{misc-DeGboAt-.js → misc-CGQOXXCy.js} +110 -110
  36. package/dist/chunks/{misc-DeGboAt-.js.map → misc-CGQOXXCy.js.map} +1 -1
  37. package/dist/chunks/{modal-dplfAaER.js → modal-febBsMyR.js} +58 -58
  38. package/dist/chunks/{modal-dplfAaER.js.map → modal-febBsMyR.js.map} +1 -1
  39. package/dist/chunks/{picker-lvm82d0A.js → picker-BA6okKnz.js} +91 -91
  40. package/dist/chunks/{picker-lvm82d0A.js.map → picker-BA6okKnz.js.map} +1 -1
  41. package/dist/chunks/popover-yl5DVe06.js +245 -0
  42. package/dist/chunks/{popover-Bne-Ljbs.js.map → popover-yl5DVe06.js.map} +1 -1
  43. package/dist/chunks/radio-group-CW-K1n9c.js +125 -0
  44. package/dist/chunks/{radio-group-sSnlYjAX.js.map → radio-group-CW-K1n9c.js.map} +1 -1
  45. package/dist/chunks/select-DblNSc5H.js +363 -0
  46. package/dist/chunks/{select-aTGupQan.js.map → select-DblNSc5H.js.map} +1 -1
  47. package/dist/chunks/{separator-B72Aq-6a.js → separator-CIqnk2z9.js} +2 -2
  48. package/dist/chunks/{separator-B72Aq-6a.js.map → separator-CIqnk2z9.js.map} +1 -1
  49. package/dist/chunks/{sortable-BKIwlqhI.js → sortable-CQmMHAF8.js} +38 -38
  50. package/dist/chunks/{sortable-BKIwlqhI.js.map → sortable-CQmMHAF8.js.map} +1 -1
  51. package/dist/chunks/{table-DxoSOvQK.js → table-BnvjPaE1.js} +18 -18
  52. package/dist/chunks/{table-DxoSOvQK.js.map → table-BnvjPaE1.js.map} +1 -1
  53. package/dist/chunks/{table-column-interactions-DzEvVuXe.js → table-column-interactions-Do8LFtiv.js} +20 -20
  54. package/dist/chunks/{table-column-interactions-DzEvVuXe.js.map → table-column-interactions-Do8LFtiv.js.map} +1 -1
  55. package/dist/chunks/{types-D9Wj9wrg.js → types-CxXyru6U.js} +21 -21
  56. package/dist/chunks/{types-D9Wj9wrg.js.map → types-CxXyru6U.js.map} +1 -1
  57. package/dist/chunks/{useODataSelectBase-DR4PrY1j.js → useODataSelectBase-DwR4Lfv-.js} +5 -5
  58. package/dist/chunks/{useODataSelectBase-DR4PrY1j.js.map → useODataSelectBase-DwR4Lfv-.js.map} +1 -1
  59. package/dist/chunks/{wheel-picker-FS58cRsQ.js → wheel-picker-DUHGy7wE.js} +23 -23
  60. package/dist/chunks/{wheel-picker-FS58cRsQ.js.map → wheel-picker-DUHGy7wE.js.map} +1 -1
  61. package/dist/context-menu/index.js +1 -1
  62. package/dist/date-input/index.js +2 -2
  63. package/dist/date-range-preset-select/index.js +1 -1
  64. package/dist/date-time-input/index.js +122 -122
  65. package/dist/date-time-input/index.js.map +1 -1
  66. package/dist/detail/index.js +22 -22
  67. package/dist/dialog/index.js +1 -1
  68. package/dist/disclosure/index.js +9 -9
  69. package/dist/drop-zone/index.js +21 -21
  70. package/dist/errors/index.js +50 -50
  71. package/dist/expandable-action-panel/index.js +24 -24
  72. package/dist/flex/index.js +1 -1
  73. package/dist/flex/useFlexClasses.d.ts +1 -1
  74. package/dist/floating-arrow/index.js +1 -1
  75. package/dist/fullscreen-portal/index.js +8 -8
  76. package/dist/image/index.js +119 -119
  77. package/dist/input/index.js +1 -1
  78. package/dist/input-date-time/index.js +55 -55
  79. package/dist/input-file/index.js +16 -16
  80. package/dist/input-files/index.js +1 -1
  81. package/dist/input-image/index.js +17 -17
  82. package/dist/input-search/index.js +30 -2
  83. package/dist/input-search/index.js.map +1 -0
  84. package/dist/layout-picker/index.js +93 -93
  85. package/dist/layout-picker/index.js.map +1 -1
  86. package/dist/list/index.js +39 -39
  87. package/dist/listbox/index.js +33 -33
  88. package/dist/misc/index.js +1 -1
  89. package/dist/modal/index.js +1 -1
  90. package/dist/multi-select/index.js +466 -2
  91. package/dist/multi-select/index.js.map +1 -0
  92. package/dist/notifications/index.js +45 -45
  93. package/dist/option/index.js +30 -30
  94. package/dist/period-select/index.js +7 -7
  95. package/dist/picker/index.js +1 -1
  96. package/dist/popover/index.js +1 -1
  97. package/dist/preset-range-date-input/index.js +10 -10
  98. package/dist/preset-select/index.js +1 -1
  99. package/dist/radio-button/index.js +9 -9
  100. package/dist/radio-group/index.js +1 -1
  101. package/dist/select/index.js +1 -1
  102. package/dist/separator/index.js +1 -1
  103. package/dist/simple-table/index.js +5 -5
  104. package/dist/slider/index.js +82 -82
  105. package/dist/slider/index.js.map +1 -1
  106. package/dist/sortable/index.js +1 -1
  107. package/dist/splitter/index.js +55 -55
  108. package/dist/state-select/index.js +17 -17
  109. package/dist/styles.css +1 -1
  110. package/dist/switch/index.js +18 -18
  111. package/dist/table/index.js +1 -1
  112. package/dist/table-column-interactions/index.js +1 -1
  113. package/dist/table-editor/index.js +99 -99
  114. package/dist/table-sorting/index.js +13 -13
  115. package/dist/tabs/index.js +83 -83
  116. package/dist/tag-input/index.js +58 -58
  117. package/dist/tag-input/index.js.map +1 -1
  118. package/dist/text/index.js +18 -18
  119. package/dist/text-editor/index.js +3 -3
  120. package/dist/textarea/index.js +1 -1
  121. package/dist/three-scene/index.js +7 -7
  122. package/dist/toggle/index.js +20 -20
  123. package/dist/toolbar/index.js +16 -16
  124. package/dist/tree/index.js +24 -24
  125. package/dist/tree-select/index.js +189 -189
  126. package/dist/tree-select/index.js.map +1 -1
  127. package/dist/tree-table/index.js +33 -33
  128. package/dist/tree-table/index.js.map +1 -1
  129. package/dist/wheel-picker/index.js +1 -1
  130. package/package.json +1 -5
  131. package/storybook-static/project.json +1 -1
  132. package/dist/advanced-search/index.d.ts +0 -3
  133. package/dist/advanced-search/index.d.ts.map +0 -1
  134. package/dist/advanced-search/index.js +0 -399
  135. package/dist/advanced-search/index.js.map +0 -1
  136. package/dist/advanced-search/lib/index.d.ts +0 -2
  137. package/dist/advanced-search/lib/index.d.ts.map +0 -1
  138. package/dist/advanced-search/lib/searchParts.d.ts +0 -3
  139. package/dist/advanced-search/lib/searchParts.d.ts.map +0 -1
  140. package/dist/advanced-search/model/index.d.ts +0 -5
  141. package/dist/advanced-search/model/index.d.ts.map +0 -1
  142. package/dist/advanced-search/model/types.d.ts +0 -55
  143. package/dist/advanced-search/model/types.d.ts.map +0 -1
  144. package/dist/advanced-search/model/useAdvancedSearch.d.ts +0 -11
  145. package/dist/advanced-search/model/useAdvancedSearch.d.ts.map +0 -1
  146. package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts +0 -6
  147. package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts.map +0 -1
  148. package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +0 -13
  149. package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +0 -1
  150. package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +0 -23
  151. package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +0 -1
  152. package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +0 -16
  153. package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +0 -1
  154. package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts +0 -9
  155. package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +0 -1
  156. package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts +0 -9
  157. package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts.map +0 -1
  158. package/dist/advanced-search/ui/index.d.ts +0 -2
  159. package/dist/advanced-search/ui/index.d.ts.map +0 -1
  160. package/dist/chunks/badge-6mXO9BWP.js +0 -65
  161. package/dist/chunks/badge-6mXO9BWP.js.map +0 -1
  162. package/dist/chunks/input-search-Cat4c7SM.js +0 -30
  163. package/dist/chunks/input-search-Cat4c7SM.js.map +0 -1
  164. package/dist/chunks/multi-select-BZ9N6Dal.js +0 -466
  165. package/dist/chunks/multi-select-BZ9N6Dal.js.map +0 -1
  166. package/dist/chunks/popover-Bne-Ljbs.js +0 -245
  167. package/dist/chunks/radio-group-sSnlYjAX.js +0 -125
  168. package/dist/chunks/select-aTGupQan.js +0 -363
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu-DgvXGCuI.js","names":[],"sources":["../../src/context-menu/components/helpers.ts","../../src/context-menu/components/MenuContext.tsx","../../src/context-menu/components/ContextMenuTrigger.tsx","../../src/context-menu/ContextMenu.module.scss","../../src/context-menu/components/MenuContent.tsx","../../src/context-menu/components/MenuGroupLabel.tsx","../../src/context-menu/components/MenuItem.tsx","../../src/context-menu/components/MenuRoot.tsx","../../src/context-menu/components/MenuSeparator.tsx","../../src/context-menu/components/RadialMenuContent.tsx","../../src/context-menu/components/RadialMenuItem.tsx","../../src/context-menu/components/ContextMenu.tsx","../../src/context-menu/components/DropdownMenuTrigger.tsx","../../src/context-menu/components/DropdownMenu.tsx"],"sourcesContent":["import React from \"react\";\n\nexport function assignRef<T>(ref: React.Ref<T> | undefined, value: T) {\n\tif (!ref) return;\n\n\tif (typeof ref === \"function\") {\n\t\tref(value);\n\t\treturn;\n\t}\n\n\t(ref as React.MutableRefObject<T>).current = value;\n}\n\nexport function composeMouseHandlers<T extends HTMLElement>(\n\tuserHandler: ((event: React.MouseEvent<T>) => void) | undefined,\n\tlibraryHandler: (event: React.MouseEvent<T>) => void\n) {\n\treturn (event: React.MouseEvent<T>) => {\n\t\tuserHandler?.(event);\n\t\tif (event.defaultPrevented) return;\n\t\tlibraryHandler(event);\n\t};\n}\n\nexport function composeKeyboardHandlers<T extends HTMLElement>(\n\tuserHandler: ((event: React.KeyboardEvent<T>) => void) | undefined,\n\tlibraryHandler: (event: React.KeyboardEvent<T>) => void\n) {\n\treturn (event: React.KeyboardEvent<T>) => {\n\t\tuserHandler?.(event);\n\t\tif (event.defaultPrevented) return;\n\t\tlibraryHandler(event);\n\t};\n}\n","import { createContext, useContext } from \"react\";\n\nimport { createMissingContextError } from \"@ryuzaki13/react-foundation-lib/error\";\n\nimport type { MenuOpenSource, MenuPoint } from \"@ryuzaki13/react-foundation-lib/context-menu\";\n\nexport type MenuTriggerMode = \"click\" | \"contextmenu\";\n\ninterface MenuContextValue {\n\tmode: MenuTriggerMode;\n\topen: boolean;\n\topenSource: MenuOpenSource | null;\n\tanchorPoint: MenuPoint | null;\n\tfloatingStyles: React.CSSProperties;\n\tfloatingRef: React.RefObject<HTMLElement | null>;\n\ttriggerRef: React.RefObject<HTMLElement | null>;\n\tsetFloating: (node: HTMLElement | null) => void;\n\tregisterTriggerElement: (node: HTMLElement | null) => void;\n\tonTriggerClick: (event: React.MouseEvent<HTMLElement>) => void;\n\tonTriggerContextMenu: (event: React.MouseEvent<HTMLElement>, triggerElement?: HTMLElement) => void;\n\tonTriggerKeyDown: (event: React.KeyboardEvent<HTMLElement>, triggerElement?: HTMLElement) => void;\n\tcloseMenu: () => void;\n}\n\nexport const MenuContext = createContext<MenuContextValue | null>(null);\n\nexport function useMenuContext() {\n\tconst context = useContext(MenuContext);\n\tif (!context) {\n\t\tthrow createMissingContextError({\n\t\t\thookName: \"useMenuContext\",\n\t\t\tproviderName: \"MenuRoot\"\n\t\t});\n\t}\n\treturn context;\n}\n","import React, { cloneElement } from \"react\";\n\nimport { assignRef } from \"./helpers\";\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface ContextMenuTriggerProps {\n\tchildren: React.ReactElement<React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> }>;\n\t/** Позволяет одному ContextMenu обслуживать множество вложенных целей без отдельного floating-ui runtime на каждую строку или ячейку. */\n\tresolveTrigger?: (eventTarget: EventTarget | null) => HTMLElement | null;\n}\n\nexport const ContextMenuTrigger: React.FC<ContextMenuTriggerProps> = ({ children, resolveTrigger }) => {\n\tconst { mode, open, registerTriggerElement, onTriggerContextMenu, onTriggerKeyDown } = useMenuContext();\n\n\tif (mode !== \"contextmenu\") {\n\t\tthrow new Error(\"ContextMenu.Trigger must be used within <ContextMenu>\");\n\t}\n\n\treturn cloneElement(children, {\n\t\tref: (node: HTMLElement | null) => {\n\t\t\tconst childRef = (children.props as { ref?: React.Ref<HTMLElement> }).ref;\n\t\t\tassignRef(childRef, node);\n\t\t\tregisterTriggerElement(node);\n\t\t},\n\t\t\"aria-haspopup\": \"menu\",\n\t\t\"aria-expanded\": open,\n\t\tonContextMenu: (event: React.MouseEvent<HTMLElement>) => {\n\t\t\tchildren.props.onContextMenu?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\t\t\tconst triggerElement = resolveTrigger ? resolveTrigger(event.target) : event.currentTarget;\n\t\t\tif (triggerElement) onTriggerContextMenu(event, triggerElement);\n\t\t},\n\t\tonKeyDown: (event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\tchildren.props.onKeyDown?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\t\t\tconst triggerElement = resolveTrigger ? resolveTrigger(event.target) : event.currentTarget;\n\t\t\tif (triggerElement) onTriggerKeyDown(event, triggerElement);\n\t\t}\n\t});\n};\n","@use \"@/styles/mixins\" as *;\n\n.menuPositioner {\n\tz-index: var(--z-dropdown);\n\toutline: none;\n}\n\n.menuOptions {\n\t--menu-max-height: calc(100dvh - var(--space-xl));\n\t--menu-min-width: 14em;\n\t--menu-max-width: min(24em, calc(100dvw - var(--space-xl)));\n\n\tmin-width: var(--menu-min-width);\n\tmax-width: var(--menu-max-width);\n\tmax-height: var(--menu-max-height);\n}\n\n.radialPanel {\n\tposition: fixed;\n\twidth: var(--radial-panel-size);\n\theight: var(--radial-panel-size);\n\tz-index: var(--z-context-menu, var(--z-dropdown));\n\toutline: none;\n\tpointer-events: none;\n}\n\n.radialRing {\n\tposition: absolute;\n\tinset: calc(var(--radial-item-size) / 2);\n\tborder: var(--border);\n\tborder-radius: 50%;\n\tbackground:\n\t\tradial-gradient(circle, color-mix(in srgb, var(--surface-0) 96%, transparent) 0 36%, transparent 37%),\n\t\tcolor-mix(in srgb, var(--surface-0) 88%, transparent);\n\tbox-shadow: var(--shadow-md);\n\tpointer-events: none;\n}\n\n.radialCenterButton {\n\tposition: absolute;\n\tleft: 50%;\n\ttop: 50%;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: calc(var(--radial-item-size) * 0.72);\n\theight: calc(var(--radial-item-size) * 0.72);\n\tpadding: var(--space-xs);\n\ttransform: translate(-50%, -50%);\n\tborder: var(--border);\n\tborder-radius: 50%;\n\tbackground-color: var(--surface-0);\n\tcolor: var(--content-0);\n\tbox-shadow: var(--shadow-sm);\n\tpointer-events: auto;\n\ttransition:\n\t\tbackground-color var(--transition-fast) ease,\n\t\tborder-color var(--transition-fast) ease,\n\t\tcolor var(--transition-fast) ease,\n\t\ttransform var(--transition-fast) ease;\n\n\t&:focus {\n\t\tbackground-color: var(--surface-1);\n\t\tborder-color: var(--border-1);\n\t}\n\n\t@include hover(true) {\n\t\tbackground-color: var(--accent-fill);\n\t\tcolor: var(--accent-text);\n\t\tcursor: pointer;\n\t\ttransform: translate(-50%, -50%) scale(1.06);\n\t}\n}\n\n.radialCenterButtonText {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tfont-size: var(--font-size-sm);\n\tline-height: 1.1;\n}\n\n.radialItems {\n\tposition: absolute;\n\tinset: 0;\n\tpointer-events: none;\n}\n\n.radialItemSlot {\n\tposition: absolute;\n\tleft: 50%;\n\ttop: 50%;\n\twidth: var(--radial-item-size);\n\theight: var(--radial-item-size);\n\ttransform: rotate(var(--radial-item-angle)) translate(var(--radial-radius)) rotate(calc(var(--radial-item-angle) * -1))\n\t\ttranslate(-50%, -50%);\n\tpointer-events: none;\n}\n\n.radialItem {\n\tdisplay: grid;\n\tgrid-template-rows: 1fr auto;\n\talign-items: center;\n\tjustify-items: center;\n\tgap: 0.15rem;\n\twidth: 100%;\n\theight: 100%;\n\tpadding: var(--space-xs);\n\tborder: var(--border);\n\tborder-radius: 50%;\n\tbackground-color: var(--surface-0);\n\tcolor: var(--content-0);\n\tbox-shadow: var(--shadow-sm);\n\tpointer-events: auto;\n\ttransition:\n\t\tbackground-color var(--transition-fast) ease,\n\t\tborder-color var(--transition-fast) ease,\n\t\tcolor var(--transition-fast) ease,\n\t\ttransform var(--transition-fast) ease;\n\n\t&:focus {\n\t\tbackground-color: var(--surface-1);\n\t\tborder-color: var(--border-1);\n\t}\n\n\t&:disabled,\n\t&[aria-disabled=\"true\"] {\n\t\tcursor: default;\n\t\tcolor: var(--content-2);\n\t\topacity: 0.52;\n\t\tpointer-events: none;\n\t}\n\n\t@include hover(true) {\n\t\tbackground-color: var(--accent-fill);\n\t\tcolor: var(--accent-text);\n\t\tcursor: pointer;\n\t\ttransform: scale(1.06);\n\t}\n}\n\n.radialItemIcon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmin-width: var(--space-md);\n\tmin-height: var(--space-md);\n\n\t> svg {\n\t\twidth: var(--space-md);\n\t\theight: var(--space-md);\n\t}\n}\n\n.radialItemText {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tfont-size: var(--font-size-sm);\n}\n","import React, { useCallback } from \"react\";\n\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { PickerOptions } from \"../../picker\";\nimport styles from \"../ContextMenu.module.scss\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface MenuContentProps {\n\tchildren: React.ReactNode | ((ctx: { closeMenu: () => void }) => React.ReactNode);\n\tclassName?: string;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\trestoreFocus?: boolean;\n}\n\nexport const MenuContent: React.FC<MenuContentProps> = ({\n\tchildren,\n\tclassName,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\trestoreFocus = true\n}) => {\n\tconst { open, floatingStyles, floatingRef, triggerRef, setFloating, closeMenu } = useMenuContext();\n\n\tconst getNavigableItems = useCallback(() => {\n\t\tconst floatingElement = floatingRef.current;\n\t\tif (!floatingElement) return [];\n\n\t\treturn Array.from(floatingElement.querySelectorAll<HTMLElement>('[data-menu-item=\"true\"]:not([data-disabled=\"true\"])'));\n\t}, [floatingRef]);\n\n\tuseOverlayFocus<HTMLElement>({\n\t\tactive: open,\n\t\tinitialFocus: (container) => getNavigableItems()[0] ?? container,\n\t\trestoreFocus,\n\t\trestoreFocusTarget: () => triggerRef.current,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: closeMenu,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) {\n\t\t\tcloseMenu();\n\t\t}\n\t}, [open, disableOutsideClick, closeOnOutside, closeMenu]);\n\n\tuseClickOutside([floatingRef as React.RefObject<HTMLElement>, triggerRef as React.RefObject<HTMLElement>], outsideClose);\n\n\tconst onMenuKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\tconst items = getNavigableItems();\n\t\t\tif (items.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst activeElement = document.activeElement as HTMLElement | null;\n\t\t\tconst currentIndex = activeElement ? items.indexOf(activeElement) : -1;\n\n\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex + 1) % items.length : 0;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex - 1 + items.length) % items.length : items.length - 1;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Home\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[0]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"End\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[items.length - 1]?.focus();\n\t\t\t}\n\t\t},\n\t\t[getNavigableItems]\n\t);\n\n\tif (typeof document === \"undefined\") return null;\n\n\treturn createPortal(\n\t\t<AnimatePresence>\n\t\t\t{open && (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={setFloating}\n\t\t\t\t\tstyle={floatingStyles}\n\t\t\t\t\trole=\"menu\"\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\tclassName={styles.menuPositioner}\n\t\t\t\t\tonKeyDown={onMenuKeyDown}\n\t\t\t\t\tinitial={{ opacity: 0, scale: 0.96, y: -2 }}\n\t\t\t\t\tanimate={{ opacity: 1, scale: 1, y: 0 }}\n\t\t\t\t\texit={{ opacity: 0, scale: 0.96, y: -2 }}\n\t\t\t\t\ttransition={{ duration: 0.14, ease: \"easeOut\" }}>\n\t\t\t\t\t<PickerOptions className={cn(styles.menuOptions, className)}>\n\t\t\t\t\t\t{typeof children === \"function\" ? children({ closeMenu }) : children}\n\t\t\t\t\t</PickerOptions>\n\t\t\t\t</motion.div>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tdocument.body\n\t);\n};\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../../ui.module.scss\";\n\nexport interface MenuGroupLabelProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const MenuGroupLabel: React.FC<MenuGroupLabelProps> = ({ children, className }) => {\n\treturn <div className={cn(uiStyles.uiPopupGroupLabel, className)}>{children}</div>;\n};\n","import { type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode, useCallback } from \"react\";\n\nimport { Option, OptionButton, OptionLink } from \"../../option\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface MenuItemProps {\n\tchildren: string;\n\ticon?: ReactNode;\n\thotKey?: string;\n\tclassName?: string;\n\tdisabled?: boolean;\n\thref?: string;\n\ttarget?: HTMLAttributeAnchorTarget;\n\trel?: string;\n\tcloseOnSelect?: boolean;\n\tonSelect?: (event: MouseEvent<HTMLElement>) => void;\n}\n\nexport function MenuItem({\n\tchildren,\n\ticon,\n\thotKey,\n\tclassName,\n\tdisabled,\n\thref,\n\ttarget,\n\trel,\n\tcloseOnSelect = true,\n\tonSelect\n}: MenuItemProps) {\n\tconst { closeMenu } = useMenuContext();\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonSelect?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (closeOnSelect) {\n\t\t\t\tcloseMenu();\n\t\t\t}\n\t\t},\n\t\t[disabled, onSelect, closeOnSelect, closeMenu]\n\t);\n\n\tif (href) {\n\t\treturn (\n\t\t\t<Option disabled={disabled} className={className}>\n\t\t\t\t<OptionLink\n\t\t\t\t\ticon={icon}\n\t\t\t\t\thotkey={hotKey}\n\t\t\t\t\ttext={children}\n\t\t\t\t\thref={href}\n\t\t\t\t\ttarget={target}\n\t\t\t\t\trel={rel}\n\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\taria-disabled={disabled}\n\t\t\t\t\tdata-menu-item=\"true\"\n\t\t\t\t\tdata-disabled={disabled ? \"true\" : undefined}\n\t\t\t\t\tdata-ui=\"context-menu-item\"\n\t\t\t\t\tdata-action=\"select-context-menu-item\"\n\t\t\t\t\tonClick={handleClick as React.MouseEventHandler<HTMLAnchorElement>}\n\t\t\t\t/>\n\t\t\t</Option>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Option disabled={disabled} className={className}>\n\t\t\t<OptionButton\n\t\t\t\ticon={icon}\n\t\t\t\thotkey={hotKey}\n\t\t\t\ttext={children}\n\t\t\t\trole=\"menuitem\"\n\t\t\t\ttabIndex={-1}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tdata-menu-item=\"true\"\n\t\t\t\tdata-disabled={disabled ? \"true\" : undefined}\n\t\t\t\tdata-ui=\"context-menu-item\"\n\t\t\t\tdata-action=\"select-context-menu-item\"\n\t\t\t\tonClick={handleClick as React.MouseEventHandler<HTMLButtonElement>}\n\t\t\t/>\n\t\t</Option>\n\t);\n}\n","import React, { useCallback, useMemo, useRef, useState } from \"react\";\n\nimport { autoUpdate, flip, offset, Placement, shift, useFloating } from \"@floating-ui/react\";\nimport {\n\tcloseMenu,\n\tcreateVirtualAnchor,\n\tgetMenuPointFromEvent,\n\tgetMenuPointFromRect,\n\tinitialMenuState,\n\topenMenu\n} from \"@ryuzaki13/react-foundation-lib/context-menu\";\n\nimport { MenuContext, MenuTriggerMode } from \"./MenuContext\";\n\ninterface MenuRootProps {\n\tchildren: React.ReactNode;\n\tmode: MenuTriggerMode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nexport function MenuRoot({\n\tchildren,\n\tmode,\n\tplacement = mode === \"click\" ? \"bottom-start\" : \"right-start\",\n\topen: controlledOpen,\n\tdefaultOpen,\n\tonOpenChange\n}: MenuRootProps) {\n\tconst [menuState, setMenuState] = useState(initialMenuState);\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst triggerElementRef = useRef<HTMLElement | null>(null);\n\tconst registeredTriggerElementRef = useRef<HTMLElement | null>(null);\n\n\tconst { refs, floatingStyles, update } = useFloating({\n\t\tplacement,\n\t\tstrategy: mode === \"contextmenu\" ? \"fixed\" : \"absolute\",\n\t\ttransform: false,\n\t\tmiddleware: [offset(6), flip({ padding: 8 }), shift({ padding: 8 })],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\tconst setOpen = useCallback(\n\t\t(nextOpen: boolean) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledOpen(nextOpen);\n\t\t\t}\n\t\t\tonOpenChange?.(nextOpen);\n\t\t\tif (!nextOpen) {\n\t\t\t\tsetMenuState((state) => closeMenu(state));\n\t\t\t}\n\t\t},\n\t\t[isControlled, onOpenChange]\n\t);\n\n\tconst closeMenuHandler = useCallback(() => {\n\t\tsetOpen(false);\n\t}, [setOpen]);\n\n\tconst openAtElement = useCallback(\n\t\t(element: HTMLElement, source: \"click\" | \"keyboard\") => {\n\t\t\trefs.setReference(element);\n\t\t\tsetMenuState(\n\t\t\t\topenMenu({\n\t\t\t\t\tsource,\n\t\t\t\t\tanchor: {\n\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\telement\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t\tsetOpen(true);\n\t\t},\n\t\t[refs, setOpen]\n\t);\n\n\tconst openAtPoint = useCallback(\n\t\t(point: { x: number; y: number }, source: \"contextmenu\" | \"keyboard\", contextElement?: HTMLElement | null) => {\n\t\t\trefs.setReference(createVirtualAnchor(point, contextElement));\n\t\t\tsetMenuState(\n\t\t\t\topenMenu({\n\t\t\t\t\tsource,\n\t\t\t\t\tanchor: {\n\t\t\t\t\t\ttype: \"point\",\n\t\t\t\t\t\tpoint,\n\t\t\t\t\t\tcontextElement\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t\tsetOpen(true);\n\t\t\tupdate();\n\t\t},\n\t\t[refs, setOpen, update]\n\t);\n\n\tconst registerTriggerElement = useCallback(\n\t\t(node: HTMLElement | null) => {\n\t\t\tconst previous = registeredTriggerElementRef.current;\n\t\t\tregisteredTriggerElementRef.current = node;\n\t\t\t// Повторный ref-callback общего контейнера не должен заменить делегированную цель,\n\t\t\t// иначе после закрытия фокус вернётся на всю таблицу вместо исходной ячейки.\n\t\t\tif (triggerElementRef.current === null || triggerElementRef.current === previous) {\n\t\t\t\ttriggerElementRef.current = node;\n\t\t\t}\n\t\t\tif (mode === \"click\") {\n\t\t\t\trefs.setReference(node);\n\t\t\t}\n\t\t},\n\t\t[mode, refs]\n\t);\n\n\tconst onTriggerClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLElement>) => {\n\t\t\tif (mode !== \"click\") return;\n\t\t\tconst element = event.currentTarget;\n\n\t\t\tif (open && menuState.anchor?.type === \"element\" && menuState.anchor.element === element) {\n\t\t\t\tcloseMenuHandler();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\topenAtElement(element, \"click\");\n\t\t},\n\t\t[mode, open, menuState.anchor, closeMenuHandler, openAtElement]\n\t);\n\n\tconst onTriggerContextMenu = useCallback(\n\t\t(event: React.MouseEvent<HTMLElement>, triggerElement = event.currentTarget) => {\n\t\t\tif (mode !== \"contextmenu\") return;\n\t\t\tevent.preventDefault();\n\n\t\t\tconst point = getMenuPointFromEvent(event);\n\t\t\ttriggerElementRef.current = triggerElement;\n\t\t\topenAtPoint(point, \"contextmenu\", triggerElement);\n\t\t},\n\t\t[mode, openAtPoint]\n\t);\n\n\tconst onTriggerKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent<HTMLElement>, triggerElement = event.currentTarget) => {\n\t\t\tconst isContextMenuKeyboardOpen = event.key === \"ContextMenu\" || (event.shiftKey && event.key === \"F10\");\n\t\t\tif (!isContextMenuKeyboardOpen) return;\n\n\t\t\tevent.preventDefault();\n\t\t\ttriggerElementRef.current = triggerElement;\n\n\t\t\tif (mode === \"click\") {\n\t\t\t\topenAtElement(triggerElement, \"keyboard\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst point = getMenuPointFromRect(triggerElement.getBoundingClientRect());\n\t\t\topenAtPoint(point, \"keyboard\", triggerElement);\n\t\t},\n\t\t[mode, openAtElement, openAtPoint]\n\t);\n\n\tconst visible = open && menuState.anchor !== null;\n\tconst anchorPoint = useMemo(() => {\n\t\tif (!menuState.anchor) return null;\n\n\t\tif (menuState.anchor.type === \"point\") {\n\t\t\treturn menuState.anchor.point;\n\t\t}\n\n\t\tconst rect = menuState.anchor.element.getBoundingClientRect();\n\t\treturn getMenuPointFromRect(rect);\n\t}, [menuState.anchor]);\n\n\tconst value = useMemo(\n\t\t() => ({\n\t\t\tmode,\n\t\t\topen: visible,\n\t\t\topenSource: menuState.source,\n\t\t\tanchorPoint,\n\t\t\tfloatingStyles,\n\t\t\tfloatingRef: refs.floating,\n\t\t\ttriggerRef: triggerElementRef,\n\t\t\tsetFloating: refs.setFloating,\n\t\t\tregisterTriggerElement,\n\t\t\tonTriggerClick,\n\t\t\tonTriggerContextMenu,\n\t\t\tonTriggerKeyDown,\n\t\t\tcloseMenu: closeMenuHandler\n\t\t}),\n\t\t[\n\t\t\tmode,\n\t\t\tvisible,\n\t\t\tmenuState.source,\n\t\t\tanchorPoint,\n\t\t\tfloatingStyles,\n\t\t\trefs.floating,\n\t\t\trefs.setFloating,\n\t\t\tregisterTriggerElement,\n\t\t\tonTriggerClick,\n\t\t\tonTriggerContextMenu,\n\t\t\tonTriggerKeyDown,\n\t\t\tcloseMenuHandler\n\t\t]\n\t);\n\n\treturn <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../../ui.module.scss\";\n\nexport interface MenuSeparatorProps {\n\tclassName?: string;\n}\n\nexport const MenuSeparator: React.FC<MenuSeparatorProps> = ({ className }) => {\n\treturn <div role=\"separator\" className={cn(uiStyles.uiPopupOptionSeparator, className)} />;\n};\n","import React, { Children, useCallback, useEffect, useMemo } from \"react\";\n\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport styles from \"../ContextMenu.module.scss\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface RadialMenuContentProps {\n\tchildren: React.ReactNode | ((ctx: { closeMenu: () => void }) => React.ReactNode);\n\tclassName?: string;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\trestoreFocus?: boolean;\n\tradius?: number;\n\titemSize?: number;\n\tcloseLabel?: string;\n}\n\nfunction clamp(value: number, min: number, max: number) {\n\tif (max < min) return min;\n\treturn Math.min(Math.max(value, min), max);\n}\n\nexport const RadialMenuContent: React.FC<RadialMenuContentProps> = ({\n\tchildren,\n\tclassName,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\trestoreFocus = true,\n\tradius = 76,\n\titemSize = 64,\n\tcloseLabel = \"Закрыть\"\n}) => {\n\tconst { open, anchorPoint, floatingRef, triggerRef, setFloating, closeMenu } = useMenuContext();\n\n\tconst resolvedChildren = typeof children === \"function\" ? children({ closeMenu }) : children;\n\tconst itemNodes = useMemo(() => Children.toArray(resolvedChildren), [resolvedChildren]);\n\tconst itemCount = itemNodes.length;\n\tconst panelSize = radius * 2 + itemSize;\n\n\tconst panelPoint = useMemo(() => {\n\t\tif (typeof window === \"undefined\" || !anchorPoint) return null;\n\n\t\t// Радиальное меню центрируется на точке вызова, но не выходит за границы viewport.\n\t\tconst safeOffset = panelSize / 2 + 8;\n\t\treturn {\n\t\t\tx: clamp(anchorPoint.x, safeOffset, window.innerWidth - safeOffset),\n\t\t\ty: clamp(anchorPoint.y, safeOffset, window.innerHeight - safeOffset)\n\t\t};\n\t}, [anchorPoint, panelSize]);\n\n\tconst getNavigableItems = useCallback(() => {\n\t\tconst floatingElement = floatingRef.current;\n\t\tif (!floatingElement) return [];\n\n\t\treturn Array.from(floatingElement.querySelectorAll<HTMLElement>('[data-menu-item=\"true\"]:not([data-disabled=\"true\"])'));\n\t}, [floatingRef]);\n\n\tuseOverlayFocus<HTMLElement>({\n\t\tactive: open,\n\t\tinitialFocus: (container) => getNavigableItems()[0] ?? container,\n\t\trestoreFocus,\n\t\trestoreFocusTarget: () => triggerRef.current,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (!open || !anchorPoint) return;\n\n\t\tlet rafId = 0;\n\n\t\t/**\n\t\t * Повторный правый клик при уже открытом меню меняет только якорь, поэтому общий\n\t\t * эффект начального фокуса не перезапускается. Возвращаем фокус в меню явно.\n\t\t */\n\t\tconst focusMenuOnReposition = () => {\n\t\t\tconst focusTarget = getNavigableItems()[0] ?? floatingRef.current;\n\t\t\tfocusTarget?.focus();\n\t\t};\n\n\t\trafId = window.requestAnimationFrame(focusMenuOnReposition);\n\t\treturn () => window.cancelAnimationFrame(rafId);\n\t}, [open, anchorPoint, getNavigableItems, floatingRef]);\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: closeMenu,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) {\n\t\t\tcloseMenu();\n\t\t}\n\t}, [open, disableOutsideClick, closeOnOutside, closeMenu]);\n\n\tuseClickOutside([floatingRef as React.RefObject<HTMLElement>, triggerRef as React.RefObject<HTMLElement>], outsideClose);\n\n\tconst onMenuKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\tconst items = getNavigableItems();\n\t\t\tif (items.length === 0) return;\n\n\t\t\tconst activeElement = document.activeElement as HTMLElement | null;\n\t\t\tconst currentIndex = activeElement ? items.indexOf(activeElement) : -1;\n\n\t\t\tif (event.key === \"ArrowRight\" || event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex + 1) % items.length : 0;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"ArrowLeft\" || event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex - 1 + items.length) % items.length : items.length - 1;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Home\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[0]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"End\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[items.length - 1]?.focus();\n\t\t\t}\n\t\t},\n\t\t[getNavigableItems]\n\t);\n\n\tif (typeof document === \"undefined\") return null;\n\n\treturn createPortal(\n\t\t<AnimatePresence>\n\t\t\t{open && panelPoint && (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={setFloating}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--radial-panel-size\": `${panelSize}px`,\n\t\t\t\t\t\t\t\"--radial-radius\": `${radius}px`,\n\t\t\t\t\t\t\t\"--radial-item-size\": `${itemSize}px`,\n\t\t\t\t\t\t\tleft: panelPoint.x - panelSize / 2,\n\t\t\t\t\t\t\ttop: panelPoint.y - panelSize / 2,\n\t\t\t\t\t\t\ttransformOrigin: \"center\"\n\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t}\n\t\t\t\t\trole=\"menu\"\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\tclassName={cn(styles.radialPanel, className)}\n\t\t\t\t\tonKeyDown={onMenuKeyDown}\n\t\t\t\t\tinitial={{ opacity: 0, scale: 0.78 }}\n\t\t\t\t\tanimate={{ opacity: 1, scale: 1 }}\n\t\t\t\t\texit={{ opacity: 0, scale: 0.78 }}\n\t\t\t\t\ttransition={{ duration: 0.16, ease: \"easeOut\" }}>\n\t\t\t\t\t<div className={styles.radialRing} aria-hidden=\"true\" />\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\tclassName={styles.radialCenterButton}\n\t\t\t\t\t\taria-label={closeLabel}\n\t\t\t\t\t\tdata-menu-item=\"true\"\n\t\t\t\t\t\tdata-radial-close=\"true\"\n\t\t\t\t\t\tonClick={closeMenu}>\n\t\t\t\t\t\t<span className={styles.radialCenterButtonText}>{closeLabel}</span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div className={styles.radialItems}>\n\t\t\t\t\t\t{itemNodes.map((item, index) => {\n\t\t\t\t\t\t\tconst angle = itemCount > 0 ? -90 + (360 / itemCount) * index : -90;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t// Индекс допустим: порядок пунктов полностью задает геометрию кольца.\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\tclassName={styles.radialItemSlot}\n\t\t\t\t\t\t\t\t\tstyle={{ \"--radial-item-angle\": `${angle}deg` } as React.CSSProperties}>\n\t\t\t\t\t\t\t\t\t{item}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t</motion.div>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tdocument.body\n\t);\n};\n","import React, { useCallback } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"../ContextMenu.module.scss\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface RadialMenuItemProps {\n\tchildren: React.ReactNode;\n\ticon?: React.ReactNode;\n\tclassName?: string;\n\tdisabled?: boolean;\n\tcloseOnSelect?: boolean;\n\tonSelect?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nexport const RadialMenuItem: React.FC<RadialMenuItemProps> = ({ children, icon, className, disabled, closeOnSelect = true, onSelect }) => {\n\tconst { closeMenu } = useMenuContext();\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonSelect?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (closeOnSelect) {\n\t\t\t\tcloseMenu();\n\t\t\t}\n\t\t},\n\t\t[disabled, onSelect, closeOnSelect, closeMenu]\n\t);\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\trole=\"menuitem\"\n\t\t\ttabIndex={-1}\n\t\t\tdisabled={disabled}\n\t\t\taria-disabled={disabled}\n\t\t\tdata-menu-item=\"true\"\n\t\t\tdata-disabled={disabled ? \"true\" : undefined}\n\t\t\tdata-ui=\"radial-menu-item\"\n\t\t\tdata-action=\"select-radial-menu-item\"\n\t\t\tclassName={cn(styles.radialItem, className)}\n\t\t\tonClick={handleClick}>\n\t\t\t{icon && <span className={styles.radialItemIcon}>{icon}</span>}\n\t\t\t<span className={styles.radialItemText}>{children}</span>\n\t\t</button>\n\t);\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React from \"react\";\n\nimport { Placement } from \"@floating-ui/react\";\n\nimport { ContextMenuTrigger } from \"./ContextMenuTrigger\";\nimport { MenuContent } from \"./MenuContent\";\nimport { MenuGroupLabel } from \"./MenuGroupLabel\";\nimport { MenuItem } from \"./MenuItem\";\nimport { MenuRoot } from \"./MenuRoot\";\nimport { MenuSeparator } from \"./MenuSeparator\";\nimport { RadialMenuContent } from \"./RadialMenuContent\";\nimport { RadialMenuItem } from \"./RadialMenuItem\";\n\nexport interface ContextMenuProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nconst ContextMenuRoot: React.FC<ContextMenuProps> = ({ children, placement, open, defaultOpen, onOpenChange }) => {\n\treturn (\n\t\t<MenuRoot mode=\"contextmenu\" placement={placement} open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n\t\t\t{children}\n\t\t</MenuRoot>\n\t);\n};\n\nexport const ContextMenu = Object.assign(ContextMenuRoot, {\n\tTrigger: ContextMenuTrigger,\n\tContent: MenuContent,\n\tRadialContent: RadialMenuContent,\n\tItem: MenuItem,\n\tRadialItem: RadialMenuItem,\n\tSeparator: MenuSeparator,\n\tGroupLabel: MenuGroupLabel\n});\n","import React, { cloneElement } from \"react\";\n\nimport { assignRef, composeKeyboardHandlers, composeMouseHandlers } from \"./helpers\";\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface DropdownMenuTriggerProps {\n\tchildren: React.ReactElement<React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> }>;\n}\n\nexport const DropdownMenuTrigger: React.FC<DropdownMenuTriggerProps> = ({ children }) => {\n\tconst { mode, open, registerTriggerElement, onTriggerClick, onTriggerKeyDown } = useMenuContext();\n\n\tif (mode !== \"click\") {\n\t\tthrow new Error(\"DropdownMenu.Trigger must be used within <DropdownMenu>\");\n\t}\n\n\treturn cloneElement(children, {\n\t\tref: (node: HTMLElement | null) => {\n\t\t\tconst childRef = (children.props as { ref?: React.Ref<HTMLElement> }).ref;\n\t\t\tassignRef(childRef, node);\n\t\t\tregisterTriggerElement(node);\n\t\t},\n\t\t\"aria-haspopup\": \"menu\",\n\t\t\"aria-expanded\": open,\n\t\tonClick: composeMouseHandlers(children.props.onClick, onTriggerClick),\n\t\tonKeyDown: composeKeyboardHandlers(children.props.onKeyDown, onTriggerKeyDown)\n\t});\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React from \"react\";\n\nimport { Placement } from \"@floating-ui/react\";\n\nimport { DropdownMenuTrigger } from \"./DropdownMenuTrigger\";\nimport { MenuContent } from \"./MenuContent\";\nimport { MenuGroupLabel } from \"./MenuGroupLabel\";\nimport { MenuItem } from \"./MenuItem\";\nimport { MenuRoot } from \"./MenuRoot\";\nimport { MenuSeparator } from \"./MenuSeparator\";\n\nexport interface DropdownMenuProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nconst DropdownMenuRoot: React.FC<DropdownMenuProps> = ({ children, placement, open, defaultOpen, onOpenChange }) => {\n\treturn (\n\t\t<MenuRoot mode=\"click\" placement={placement} open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n\t\t\t{children}\n\t\t</MenuRoot>\n\t);\n};\n\nexport const DropdownMenu = Object.assign(DropdownMenuRoot, {\n\tTrigger: DropdownMenuTrigger,\n\tContent: MenuContent,\n\tItem: MenuItem,\n\tSeparator: MenuSeparator,\n\tGroupLabel: MenuGroupLabel\n});\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAgB,EAAa,GAA+B,GAAU;CAChE,OAEL;MAAI,OAAO,KAAQ,YAAY;GAC9B,EAAI,CAAK;GACT;EACD;EAEA,EAAmC,UAAU;CAF7C;AAGD;AAEA,SAAgB,EACf,GACA,GACC;CACD,QAAQ,MAA+B;EACtC,IAAc,CAAK,GACf,GAAM,oBACV,EAAe,CAAK;CACrB;AACD;AAEA,SAAgB,EACf,GACA,GACC;CACD,QAAQ,MAAkC;EACzC,IAAc,CAAK,GACf,GAAM,oBACV,EAAe,CAAK;CACrB;AACD;;;ACTA,IAAa,IAAc,EAAuC,IAAI;AAEtE,SAAgB,IAAiB;CAChC,IAAM,IAAU,EAAW,CAAW;CACtC,IAAI,CAAC,GACJ,MAAM,EAA0B;EAC/B,UAAU;EACV,cAAc;CACf,CAAC;CAEF,OAAO;AACR;;;ACxBA,IAAa,KAAyD,EAAE,aAAU,wBAAqB;CACtG,IAAM,EAAE,SAAM,SAAM,2BAAwB,yBAAsB,wBAAqB,EAAe;CAEtG,IAAI,MAAS,eACZ,MAAU,MAAM,uDAAuD;CAGxE,OAAO,EAAa,GAAU;EAC7B,MAAM,MAA6B;GAClC,IAAM,IAAY,EAAS,MAA2C;GAEtE,AADA,EAAU,GAAU,CAAI,GACxB,EAAuB,CAAI;EAC5B;EACA,iBAAiB;EACjB,iBAAiB;EACjB,gBAAgB,MAAyC;GAExD,IADA,EAAS,MAAM,gBAAgB,CAAK,GAChC,EAAM,kBAAkB;GAC5B,IAAM,IAAiB,IAAiB,EAAe,EAAM,MAAM,IAAI,EAAM;GAC7E,AAAI,KAAgB,EAAqB,GAAO,CAAc;EAC/D;EACA,YAAY,MAA4C;GAEvD,IADA,EAAS,MAAM,YAAY,CAAK,GAC5B,E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O;IAAiB;GAAe,CAAA,CACjD;;CAEV;CCnBC,WAAW;CACX,YAAY;AACb,CAAC,GEVY,IAAe,OAAO,QARoB,EAAE,aAAU,cAAW,SAAM,gBAAa,sBAE/F,kBAAC,GAAD;CAAU,MAAK;CAAmB;CAAiB;CAAmB;CAA2B;CAC/F;AACQ,CAAA,GAIgD;CAC3D,UDpBuE,EAAE,kBAAe;EACxF,IAAM,EAAE,SAAM,SAAM,2BAAwB,mBAAgB,wBAAqB,EAAe;EAEhG,IAAI,MAAS,SACZ,MAAU,MAAM,yDAAyD;EAG1E,OAAO,EAAa,GAAU;GAC7B,MAAM,MAA6B;IAClC,IAAM,IAAY,EAAS,MAA2C;IAEtE,AADA,EAAU,GAAU,CAAI,GACxB,EAAuB,CAAI;GAC5B;GACA,iBAAiB;GACjB,iBAAiB;GACjB,SAAS,EAAqB,EAAS,MAAM,SAAS,CAAc;GACpE,WAAW,EAAwB,EAAS,MAAM,WAAW,CAAgB;EAC9E,CAAC;CACF;CCGC,SAAS;CACT,MAAM;CACN,WAAW;CACX,YAAY;AACb,CAAC"}
1
+ {"version":3,"file":"context-menu-BQePxRpu.js","names":[],"sources":["../../src/context-menu/components/helpers.ts","../../src/context-menu/components/MenuContext.tsx","../../src/context-menu/components/ContextMenuTrigger.tsx","../../src/context-menu/ContextMenu.module.scss","../../src/context-menu/components/MenuContent.tsx","../../src/context-menu/components/MenuGroupLabel.tsx","../../src/context-menu/components/MenuItem.tsx","../../src/context-menu/components/MenuRoot.tsx","../../src/context-menu/components/MenuSeparator.tsx","../../src/context-menu/components/RadialMenuContent.tsx","../../src/context-menu/components/RadialMenuItem.tsx","../../src/context-menu/components/ContextMenu.tsx","../../src/context-menu/components/DropdownMenuTrigger.tsx","../../src/context-menu/components/DropdownMenu.tsx"],"sourcesContent":["import React from \"react\";\n\nexport function assignRef<T>(ref: React.Ref<T> | undefined, value: T) {\n\tif (!ref) return;\n\n\tif (typeof ref === \"function\") {\n\t\tref(value);\n\t\treturn;\n\t}\n\n\t(ref as React.MutableRefObject<T>).current = value;\n}\n\nexport function composeMouseHandlers<T extends HTMLElement>(\n\tuserHandler: ((event: React.MouseEvent<T>) => void) | undefined,\n\tlibraryHandler: (event: React.MouseEvent<T>) => void\n) {\n\treturn (event: React.MouseEvent<T>) => {\n\t\tuserHandler?.(event);\n\t\tif (event.defaultPrevented) return;\n\t\tlibraryHandler(event);\n\t};\n}\n\nexport function composeKeyboardHandlers<T extends HTMLElement>(\n\tuserHandler: ((event: React.KeyboardEvent<T>) => void) | undefined,\n\tlibraryHandler: (event: React.KeyboardEvent<T>) => void\n) {\n\treturn (event: React.KeyboardEvent<T>) => {\n\t\tuserHandler?.(event);\n\t\tif (event.defaultPrevented) return;\n\t\tlibraryHandler(event);\n\t};\n}\n","import { createContext, useContext } from \"react\";\n\nimport { createMissingContextError } from \"@ryuzaki13/react-foundation-lib/error\";\n\nimport type { MenuOpenSource, MenuPoint } from \"@ryuzaki13/react-foundation-lib/context-menu\";\n\nexport type MenuTriggerMode = \"click\" | \"contextmenu\";\n\ninterface MenuContextValue {\n\tmode: MenuTriggerMode;\n\topen: boolean;\n\topenSource: MenuOpenSource | null;\n\tanchorPoint: MenuPoint | null;\n\tfloatingStyles: React.CSSProperties;\n\tfloatingRef: React.RefObject<HTMLElement | null>;\n\ttriggerRef: React.RefObject<HTMLElement | null>;\n\tsetFloating: (node: HTMLElement | null) => void;\n\tregisterTriggerElement: (node: HTMLElement | null) => void;\n\tonTriggerClick: (event: React.MouseEvent<HTMLElement>) => void;\n\tonTriggerContextMenu: (event: React.MouseEvent<HTMLElement>, triggerElement?: HTMLElement) => void;\n\tonTriggerKeyDown: (event: React.KeyboardEvent<HTMLElement>, triggerElement?: HTMLElement) => void;\n\tcloseMenu: () => void;\n}\n\nexport const MenuContext = createContext<MenuContextValue | null>(null);\n\nexport function useMenuContext() {\n\tconst context = useContext(MenuContext);\n\tif (!context) {\n\t\tthrow createMissingContextError({\n\t\t\thookName: \"useMenuContext\",\n\t\t\tproviderName: \"MenuRoot\"\n\t\t});\n\t}\n\treturn context;\n}\n","import React, { cloneElement } from \"react\";\n\nimport { assignRef } from \"./helpers\";\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface ContextMenuTriggerProps {\n\tchildren: React.ReactElement<React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> }>;\n\t/** Позволяет одному ContextMenu обслуживать множество вложенных целей без отдельного floating-ui runtime на каждую строку или ячейку. */\n\tresolveTrigger?: (eventTarget: EventTarget | null) => HTMLElement | null;\n}\n\nexport const ContextMenuTrigger: React.FC<ContextMenuTriggerProps> = ({ children, resolveTrigger }) => {\n\tconst { mode, open, registerTriggerElement, onTriggerContextMenu, onTriggerKeyDown } = useMenuContext();\n\n\tif (mode !== \"contextmenu\") {\n\t\tthrow new Error(\"ContextMenu.Trigger must be used within <ContextMenu>\");\n\t}\n\n\treturn cloneElement(children, {\n\t\tref: (node: HTMLElement | null) => {\n\t\t\tconst childRef = (children.props as { ref?: React.Ref<HTMLElement> }).ref;\n\t\t\tassignRef(childRef, node);\n\t\t\tregisterTriggerElement(node);\n\t\t},\n\t\t\"aria-haspopup\": \"menu\",\n\t\t\"aria-expanded\": open,\n\t\tonContextMenu: (event: React.MouseEvent<HTMLElement>) => {\n\t\t\tchildren.props.onContextMenu?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\t\t\tconst triggerElement = resolveTrigger ? resolveTrigger(event.target) : event.currentTarget;\n\t\t\tif (triggerElement) onTriggerContextMenu(event, triggerElement);\n\t\t},\n\t\tonKeyDown: (event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\tchildren.props.onKeyDown?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\t\t\tconst triggerElement = resolveTrigger ? resolveTrigger(event.target) : event.currentTarget;\n\t\t\tif (triggerElement) onTriggerKeyDown(event, triggerElement);\n\t\t}\n\t});\n};\n","@use \"@/styles/mixins\" as *;\n\n.menuPositioner {\n\tz-index: var(--z-dropdown);\n\toutline: none;\n}\n\n.menuOptions {\n\t--menu-max-height: calc(100dvh - var(--space-xl));\n\t--menu-min-width: 14em;\n\t--menu-max-width: min(24em, calc(100dvw - var(--space-xl)));\n\n\tmin-width: var(--menu-min-width);\n\tmax-width: var(--menu-max-width);\n\tmax-height: var(--menu-max-height);\n}\n\n.radialPanel {\n\tposition: fixed;\n\twidth: var(--radial-panel-size);\n\theight: var(--radial-panel-size);\n\tz-index: var(--z-context-menu, var(--z-dropdown));\n\toutline: none;\n\tpointer-events: none;\n}\n\n.radialRing {\n\tposition: absolute;\n\tinset: calc(var(--radial-item-size) / 2);\n\tborder: var(--border);\n\tborder-radius: 50%;\n\tbackground:\n\t\tradial-gradient(circle, color-mix(in srgb, var(--surface-0) 96%, transparent) 0 36%, transparent 37%),\n\t\tcolor-mix(in srgb, var(--surface-0) 88%, transparent);\n\tbox-shadow: var(--shadow-md);\n\tpointer-events: none;\n}\n\n.radialCenterButton {\n\tposition: absolute;\n\tleft: 50%;\n\ttop: 50%;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: calc(var(--radial-item-size) * 0.72);\n\theight: calc(var(--radial-item-size) * 0.72);\n\tpadding: var(--space-xs);\n\ttransform: translate(-50%, -50%);\n\tborder: var(--border);\n\tborder-radius: 50%;\n\tbackground-color: var(--surface-0);\n\tcolor: var(--content-0);\n\tbox-shadow: var(--shadow-sm);\n\tpointer-events: auto;\n\ttransition:\n\t\tbackground-color var(--transition-fast) ease,\n\t\tborder-color var(--transition-fast) ease,\n\t\tcolor var(--transition-fast) ease,\n\t\ttransform var(--transition-fast) ease;\n\n\t&:focus {\n\t\tbackground-color: var(--surface-1);\n\t\tborder-color: var(--border-1);\n\t}\n\n\t@include hover(true) {\n\t\tbackground-color: var(--accent-fill);\n\t\tcolor: var(--accent-text);\n\t\tcursor: pointer;\n\t\ttransform: translate(-50%, -50%) scale(1.06);\n\t}\n}\n\n.radialCenterButtonText {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tfont-size: var(--font-size-sm);\n\tline-height: 1.1;\n}\n\n.radialItems {\n\tposition: absolute;\n\tinset: 0;\n\tpointer-events: none;\n}\n\n.radialItemSlot {\n\tposition: absolute;\n\tleft: 50%;\n\ttop: 50%;\n\twidth: var(--radial-item-size);\n\theight: var(--radial-item-size);\n\ttransform: rotate(var(--radial-item-angle)) translate(var(--radial-radius)) rotate(calc(var(--radial-item-angle) * -1))\n\t\ttranslate(-50%, -50%);\n\tpointer-events: none;\n}\n\n.radialItem {\n\tdisplay: grid;\n\tgrid-template-rows: 1fr auto;\n\talign-items: center;\n\tjustify-items: center;\n\tgap: 0.15rem;\n\twidth: 100%;\n\theight: 100%;\n\tpadding: var(--space-xs);\n\tborder: var(--border);\n\tborder-radius: 50%;\n\tbackground-color: var(--surface-0);\n\tcolor: var(--content-0);\n\tbox-shadow: var(--shadow-sm);\n\tpointer-events: auto;\n\ttransition:\n\t\tbackground-color var(--transition-fast) ease,\n\t\tborder-color var(--transition-fast) ease,\n\t\tcolor var(--transition-fast) ease,\n\t\ttransform var(--transition-fast) ease;\n\n\t&:focus {\n\t\tbackground-color: var(--surface-1);\n\t\tborder-color: var(--border-1);\n\t}\n\n\t&:disabled,\n\t&[aria-disabled=\"true\"] {\n\t\tcursor: default;\n\t\tcolor: var(--content-2);\n\t\topacity: 0.52;\n\t\tpointer-events: none;\n\t}\n\n\t@include hover(true) {\n\t\tbackground-color: var(--accent-fill);\n\t\tcolor: var(--accent-text);\n\t\tcursor: pointer;\n\t\ttransform: scale(1.06);\n\t}\n}\n\n.radialItemIcon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmin-width: var(--space-md);\n\tmin-height: var(--space-md);\n\n\t> svg {\n\t\twidth: var(--space-md);\n\t\theight: var(--space-md);\n\t}\n}\n\n.radialItemText {\n\tmax-width: 100%;\n\toverflow: hidden;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tfont-size: var(--font-size-sm);\n}\n","import React, { useCallback } from \"react\";\n\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { PickerOptions } from \"../../picker\";\nimport styles from \"../ContextMenu.module.scss\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface MenuContentProps {\n\tchildren: React.ReactNode | ((ctx: { closeMenu: () => void }) => React.ReactNode);\n\tclassName?: string;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\trestoreFocus?: boolean;\n}\n\nexport const MenuContent: React.FC<MenuContentProps> = ({\n\tchildren,\n\tclassName,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\trestoreFocus = true\n}) => {\n\tconst { open, floatingStyles, floatingRef, triggerRef, setFloating, closeMenu } = useMenuContext();\n\n\tconst getNavigableItems = useCallback(() => {\n\t\tconst floatingElement = floatingRef.current;\n\t\tif (!floatingElement) return [];\n\n\t\treturn Array.from(floatingElement.querySelectorAll<HTMLElement>('[data-menu-item=\"true\"]:not([data-disabled=\"true\"])'));\n\t}, [floatingRef]);\n\n\tuseOverlayFocus<HTMLElement>({\n\t\tactive: open,\n\t\tinitialFocus: (container) => getNavigableItems()[0] ?? container,\n\t\trestoreFocus,\n\t\trestoreFocusTarget: () => triggerRef.current,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: closeMenu,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) {\n\t\t\tcloseMenu();\n\t\t}\n\t}, [open, disableOutsideClick, closeOnOutside, closeMenu]);\n\n\tuseClickOutside([floatingRef as React.RefObject<HTMLElement>, triggerRef as React.RefObject<HTMLElement>], outsideClose);\n\n\tconst onMenuKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\tconst items = getNavigableItems();\n\t\t\tif (items.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst activeElement = document.activeElement as HTMLElement | null;\n\t\t\tconst currentIndex = activeElement ? items.indexOf(activeElement) : -1;\n\n\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex + 1) % items.length : 0;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex - 1 + items.length) % items.length : items.length - 1;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Home\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[0]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"End\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[items.length - 1]?.focus();\n\t\t\t}\n\t\t},\n\t\t[getNavigableItems]\n\t);\n\n\tif (typeof document === \"undefined\") return null;\n\n\treturn createPortal(\n\t\t<AnimatePresence>\n\t\t\t{open && (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={setFloating}\n\t\t\t\t\tstyle={floatingStyles}\n\t\t\t\t\trole=\"menu\"\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\tclassName={styles.menuPositioner}\n\t\t\t\t\tonKeyDown={onMenuKeyDown}\n\t\t\t\t\tinitial={{ opacity: 0, scale: 0.96, y: -2 }}\n\t\t\t\t\tanimate={{ opacity: 1, scale: 1, y: 0 }}\n\t\t\t\t\texit={{ opacity: 0, scale: 0.96, y: -2 }}\n\t\t\t\t\ttransition={{ duration: 0.14, ease: \"easeOut\" }}>\n\t\t\t\t\t<PickerOptions className={cn(styles.menuOptions, className)}>\n\t\t\t\t\t\t{typeof children === \"function\" ? children({ closeMenu }) : children}\n\t\t\t\t\t</PickerOptions>\n\t\t\t\t</motion.div>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tdocument.body\n\t);\n};\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../../ui.module.scss\";\n\nexport interface MenuGroupLabelProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const MenuGroupLabel: React.FC<MenuGroupLabelProps> = ({ children, className }) => {\n\treturn <div className={cn(uiStyles.uiPopupGroupLabel, className)}>{children}</div>;\n};\n","import { type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode, useCallback } from \"react\";\n\nimport { Option, OptionButton, OptionLink } from \"../../option\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface MenuItemProps {\n\tchildren: string;\n\ticon?: ReactNode;\n\thotKey?: string;\n\tclassName?: string;\n\tdisabled?: boolean;\n\thref?: string;\n\ttarget?: HTMLAttributeAnchorTarget;\n\trel?: string;\n\tcloseOnSelect?: boolean;\n\tonSelect?: (event: MouseEvent<HTMLElement>) => void;\n}\n\nexport function MenuItem({\n\tchildren,\n\ticon,\n\thotKey,\n\tclassName,\n\tdisabled,\n\thref,\n\ttarget,\n\trel,\n\tcloseOnSelect = true,\n\tonSelect\n}: MenuItemProps) {\n\tconst { closeMenu } = useMenuContext();\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonSelect?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (closeOnSelect) {\n\t\t\t\tcloseMenu();\n\t\t\t}\n\t\t},\n\t\t[disabled, onSelect, closeOnSelect, closeMenu]\n\t);\n\n\tif (href) {\n\t\treturn (\n\t\t\t<Option disabled={disabled} className={className}>\n\t\t\t\t<OptionLink\n\t\t\t\t\ticon={icon}\n\t\t\t\t\thotkey={hotKey}\n\t\t\t\t\ttext={children}\n\t\t\t\t\thref={href}\n\t\t\t\t\ttarget={target}\n\t\t\t\t\trel={rel}\n\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\taria-disabled={disabled}\n\t\t\t\t\tdata-menu-item=\"true\"\n\t\t\t\t\tdata-disabled={disabled ? \"true\" : undefined}\n\t\t\t\t\tdata-ui=\"context-menu-item\"\n\t\t\t\t\tdata-action=\"select-context-menu-item\"\n\t\t\t\t\tonClick={handleClick as React.MouseEventHandler<HTMLAnchorElement>}\n\t\t\t\t/>\n\t\t\t</Option>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Option disabled={disabled} className={className}>\n\t\t\t<OptionButton\n\t\t\t\ticon={icon}\n\t\t\t\thotkey={hotKey}\n\t\t\t\ttext={children}\n\t\t\t\trole=\"menuitem\"\n\t\t\t\ttabIndex={-1}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tdata-menu-item=\"true\"\n\t\t\t\tdata-disabled={disabled ? \"true\" : undefined}\n\t\t\t\tdata-ui=\"context-menu-item\"\n\t\t\t\tdata-action=\"select-context-menu-item\"\n\t\t\t\tonClick={handleClick as React.MouseEventHandler<HTMLButtonElement>}\n\t\t\t/>\n\t\t</Option>\n\t);\n}\n","import React, { useCallback, useMemo, useRef, useState } from \"react\";\n\nimport { autoUpdate, flip, offset, Placement, shift, useFloating } from \"@floating-ui/react\";\nimport {\n\tcloseMenu,\n\tcreateVirtualAnchor,\n\tgetMenuPointFromEvent,\n\tgetMenuPointFromRect,\n\tinitialMenuState,\n\topenMenu\n} from \"@ryuzaki13/react-foundation-lib/context-menu\";\n\nimport { MenuContext, MenuTriggerMode } from \"./MenuContext\";\n\ninterface MenuRootProps {\n\tchildren: React.ReactNode;\n\tmode: MenuTriggerMode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nexport function MenuRoot({\n\tchildren,\n\tmode,\n\tplacement = mode === \"click\" ? \"bottom-start\" : \"right-start\",\n\topen: controlledOpen,\n\tdefaultOpen,\n\tonOpenChange\n}: MenuRootProps) {\n\tconst [menuState, setMenuState] = useState(initialMenuState);\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst triggerElementRef = useRef<HTMLElement | null>(null);\n\tconst registeredTriggerElementRef = useRef<HTMLElement | null>(null);\n\n\tconst { refs, floatingStyles, update } = useFloating({\n\t\tplacement,\n\t\tstrategy: mode === \"contextmenu\" ? \"fixed\" : \"absolute\",\n\t\ttransform: false,\n\t\tmiddleware: [offset(6), flip({ padding: 8 }), shift({ padding: 8 })],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\tconst setOpen = useCallback(\n\t\t(nextOpen: boolean) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledOpen(nextOpen);\n\t\t\t}\n\t\t\tonOpenChange?.(nextOpen);\n\t\t\tif (!nextOpen) {\n\t\t\t\tsetMenuState((state) => closeMenu(state));\n\t\t\t}\n\t\t},\n\t\t[isControlled, onOpenChange]\n\t);\n\n\tconst closeMenuHandler = useCallback(() => {\n\t\tsetOpen(false);\n\t}, [setOpen]);\n\n\tconst openAtElement = useCallback(\n\t\t(element: HTMLElement, source: \"click\" | \"keyboard\") => {\n\t\t\trefs.setReference(element);\n\t\t\tsetMenuState(\n\t\t\t\topenMenu({\n\t\t\t\t\tsource,\n\t\t\t\t\tanchor: {\n\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\telement\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t\tsetOpen(true);\n\t\t},\n\t\t[refs, setOpen]\n\t);\n\n\tconst openAtPoint = useCallback(\n\t\t(point: { x: number; y: number }, source: \"contextmenu\" | \"keyboard\", contextElement?: HTMLElement | null) => {\n\t\t\trefs.setReference(createVirtualAnchor(point, contextElement));\n\t\t\tsetMenuState(\n\t\t\t\topenMenu({\n\t\t\t\t\tsource,\n\t\t\t\t\tanchor: {\n\t\t\t\t\t\ttype: \"point\",\n\t\t\t\t\t\tpoint,\n\t\t\t\t\t\tcontextElement\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t\tsetOpen(true);\n\t\t\tupdate();\n\t\t},\n\t\t[refs, setOpen, update]\n\t);\n\n\tconst registerTriggerElement = useCallback(\n\t\t(node: HTMLElement | null) => {\n\t\t\tconst previous = registeredTriggerElementRef.current;\n\t\t\tregisteredTriggerElementRef.current = node;\n\t\t\t// Повторный ref-callback общего контейнера не должен заменить делегированную цель,\n\t\t\t// иначе после закрытия фокус вернётся на всю таблицу вместо исходной ячейки.\n\t\t\tif (triggerElementRef.current === null || triggerElementRef.current === previous) {\n\t\t\t\ttriggerElementRef.current = node;\n\t\t\t}\n\t\t\tif (mode === \"click\") {\n\t\t\t\trefs.setReference(node);\n\t\t\t}\n\t\t},\n\t\t[mode, refs]\n\t);\n\n\tconst onTriggerClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLElement>) => {\n\t\t\tif (mode !== \"click\") return;\n\t\t\tconst element = event.currentTarget;\n\n\t\t\tif (open && menuState.anchor?.type === \"element\" && menuState.anchor.element === element) {\n\t\t\t\tcloseMenuHandler();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\topenAtElement(element, \"click\");\n\t\t},\n\t\t[mode, open, menuState.anchor, closeMenuHandler, openAtElement]\n\t);\n\n\tconst onTriggerContextMenu = useCallback(\n\t\t(event: React.MouseEvent<HTMLElement>, triggerElement = event.currentTarget) => {\n\t\t\tif (mode !== \"contextmenu\") return;\n\t\t\tevent.preventDefault();\n\n\t\t\tconst point = getMenuPointFromEvent(event);\n\t\t\ttriggerElementRef.current = triggerElement;\n\t\t\topenAtPoint(point, \"contextmenu\", triggerElement);\n\t\t},\n\t\t[mode, openAtPoint]\n\t);\n\n\tconst onTriggerKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent<HTMLElement>, triggerElement = event.currentTarget) => {\n\t\t\tconst isContextMenuKeyboardOpen = event.key === \"ContextMenu\" || (event.shiftKey && event.key === \"F10\");\n\t\t\tif (!isContextMenuKeyboardOpen) return;\n\n\t\t\tevent.preventDefault();\n\t\t\ttriggerElementRef.current = triggerElement;\n\n\t\t\tif (mode === \"click\") {\n\t\t\t\topenAtElement(triggerElement, \"keyboard\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst point = getMenuPointFromRect(triggerElement.getBoundingClientRect());\n\t\t\topenAtPoint(point, \"keyboard\", triggerElement);\n\t\t},\n\t\t[mode, openAtElement, openAtPoint]\n\t);\n\n\tconst visible = open && menuState.anchor !== null;\n\tconst anchorPoint = useMemo(() => {\n\t\tif (!menuState.anchor) return null;\n\n\t\tif (menuState.anchor.type === \"point\") {\n\t\t\treturn menuState.anchor.point;\n\t\t}\n\n\t\tconst rect = menuState.anchor.element.getBoundingClientRect();\n\t\treturn getMenuPointFromRect(rect);\n\t}, [menuState.anchor]);\n\n\tconst value = useMemo(\n\t\t() => ({\n\t\t\tmode,\n\t\t\topen: visible,\n\t\t\topenSource: menuState.source,\n\t\t\tanchorPoint,\n\t\t\tfloatingStyles,\n\t\t\tfloatingRef: refs.floating,\n\t\t\ttriggerRef: triggerElementRef,\n\t\t\tsetFloating: refs.setFloating,\n\t\t\tregisterTriggerElement,\n\t\t\tonTriggerClick,\n\t\t\tonTriggerContextMenu,\n\t\t\tonTriggerKeyDown,\n\t\t\tcloseMenu: closeMenuHandler\n\t\t}),\n\t\t[\n\t\t\tmode,\n\t\t\tvisible,\n\t\t\tmenuState.source,\n\t\t\tanchorPoint,\n\t\t\tfloatingStyles,\n\t\t\trefs.floating,\n\t\t\trefs.setFloating,\n\t\t\tregisterTriggerElement,\n\t\t\tonTriggerClick,\n\t\t\tonTriggerContextMenu,\n\t\t\tonTriggerKeyDown,\n\t\t\tcloseMenuHandler\n\t\t]\n\t);\n\n\treturn <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../../ui.module.scss\";\n\nexport interface MenuSeparatorProps {\n\tclassName?: string;\n}\n\nexport const MenuSeparator: React.FC<MenuSeparatorProps> = ({ className }) => {\n\treturn <div role=\"separator\" className={cn(uiStyles.uiPopupOptionSeparator, className)} />;\n};\n","import React, { Children, useCallback, useEffect, useMemo } from \"react\";\n\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport styles from \"../ContextMenu.module.scss\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface RadialMenuContentProps {\n\tchildren: React.ReactNode | ((ctx: { closeMenu: () => void }) => React.ReactNode);\n\tclassName?: string;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\trestoreFocus?: boolean;\n\tradius?: number;\n\titemSize?: number;\n\tcloseLabel?: string;\n}\n\nfunction clamp(value: number, min: number, max: number) {\n\tif (max < min) return min;\n\treturn Math.min(Math.max(value, min), max);\n}\n\nexport const RadialMenuContent: React.FC<RadialMenuContentProps> = ({\n\tchildren,\n\tclassName,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\trestoreFocus = true,\n\tradius = 76,\n\titemSize = 64,\n\tcloseLabel = \"Закрыть\"\n}) => {\n\tconst { open, anchorPoint, floatingRef, triggerRef, setFloating, closeMenu } = useMenuContext();\n\n\tconst resolvedChildren = typeof children === \"function\" ? children({ closeMenu }) : children;\n\tconst itemNodes = useMemo(() => Children.toArray(resolvedChildren), [resolvedChildren]);\n\tconst itemCount = itemNodes.length;\n\tconst panelSize = radius * 2 + itemSize;\n\n\tconst panelPoint = useMemo(() => {\n\t\tif (typeof window === \"undefined\" || !anchorPoint) return null;\n\n\t\t// Радиальное меню центрируется на точке вызова, но не выходит за границы viewport.\n\t\tconst safeOffset = panelSize / 2 + 8;\n\t\treturn {\n\t\t\tx: clamp(anchorPoint.x, safeOffset, window.innerWidth - safeOffset),\n\t\t\ty: clamp(anchorPoint.y, safeOffset, window.innerHeight - safeOffset)\n\t\t};\n\t}, [anchorPoint, panelSize]);\n\n\tconst getNavigableItems = useCallback(() => {\n\t\tconst floatingElement = floatingRef.current;\n\t\tif (!floatingElement) return [];\n\n\t\treturn Array.from(floatingElement.querySelectorAll<HTMLElement>('[data-menu-item=\"true\"]:not([data-disabled=\"true\"])'));\n\t}, [floatingRef]);\n\n\tuseOverlayFocus<HTMLElement>({\n\t\tactive: open,\n\t\tinitialFocus: (container) => getNavigableItems()[0] ?? container,\n\t\trestoreFocus,\n\t\trestoreFocusTarget: () => triggerRef.current,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (!open || !anchorPoint) return;\n\n\t\tlet rafId = 0;\n\n\t\t/**\n\t\t * Повторный правый клик при уже открытом меню меняет только якорь, поэтому общий\n\t\t * эффект начального фокуса не перезапускается. Возвращаем фокус в меню явно.\n\t\t */\n\t\tconst focusMenuOnReposition = () => {\n\t\t\tconst focusTarget = getNavigableItems()[0] ?? floatingRef.current;\n\t\t\tfocusTarget?.focus();\n\t\t};\n\n\t\trafId = window.requestAnimationFrame(focusMenuOnReposition);\n\t\treturn () => window.cancelAnimationFrame(rafId);\n\t}, [open, anchorPoint, getNavigableItems, floatingRef]);\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: closeMenu,\n\t\tcontainerRef: floatingRef\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) {\n\t\t\tcloseMenu();\n\t\t}\n\t}, [open, disableOutsideClick, closeOnOutside, closeMenu]);\n\n\tuseClickOutside([floatingRef as React.RefObject<HTMLElement>, triggerRef as React.RefObject<HTMLElement>], outsideClose);\n\n\tconst onMenuKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\tconst items = getNavigableItems();\n\t\t\tif (items.length === 0) return;\n\n\t\t\tconst activeElement = document.activeElement as HTMLElement | null;\n\t\t\tconst currentIndex = activeElement ? items.indexOf(activeElement) : -1;\n\n\t\t\tif (event.key === \"ArrowRight\" || event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex + 1) % items.length : 0;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"ArrowLeft\" || event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex = currentIndex >= 0 ? (currentIndex - 1 + items.length) % items.length : items.length - 1;\n\t\t\t\titems[nextIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Home\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[0]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"End\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\titems[items.length - 1]?.focus();\n\t\t\t}\n\t\t},\n\t\t[getNavigableItems]\n\t);\n\n\tif (typeof document === \"undefined\") return null;\n\n\treturn createPortal(\n\t\t<AnimatePresence>\n\t\t\t{open && panelPoint && (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={setFloating}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--radial-panel-size\": `${panelSize}px`,\n\t\t\t\t\t\t\t\"--radial-radius\": `${radius}px`,\n\t\t\t\t\t\t\t\"--radial-item-size\": `${itemSize}px`,\n\t\t\t\t\t\t\tleft: panelPoint.x - panelSize / 2,\n\t\t\t\t\t\t\ttop: panelPoint.y - panelSize / 2,\n\t\t\t\t\t\t\ttransformOrigin: \"center\"\n\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t}\n\t\t\t\t\trole=\"menu\"\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\tclassName={cn(styles.radialPanel, className)}\n\t\t\t\t\tonKeyDown={onMenuKeyDown}\n\t\t\t\t\tinitial={{ opacity: 0, scale: 0.78 }}\n\t\t\t\t\tanimate={{ opacity: 1, scale: 1 }}\n\t\t\t\t\texit={{ opacity: 0, scale: 0.78 }}\n\t\t\t\t\ttransition={{ duration: 0.16, ease: \"easeOut\" }}>\n\t\t\t\t\t<div className={styles.radialRing} aria-hidden=\"true\" />\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\tclassName={styles.radialCenterButton}\n\t\t\t\t\t\taria-label={closeLabel}\n\t\t\t\t\t\tdata-menu-item=\"true\"\n\t\t\t\t\t\tdata-radial-close=\"true\"\n\t\t\t\t\t\tonClick={closeMenu}>\n\t\t\t\t\t\t<span className={styles.radialCenterButtonText}>{closeLabel}</span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div className={styles.radialItems}>\n\t\t\t\t\t\t{itemNodes.map((item, index) => {\n\t\t\t\t\t\t\tconst angle = itemCount > 0 ? -90 + (360 / itemCount) * index : -90;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t// Индекс допустим: порядок пунктов полностью задает геометрию кольца.\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\tclassName={styles.radialItemSlot}\n\t\t\t\t\t\t\t\t\tstyle={{ \"--radial-item-angle\": `${angle}deg` } as React.CSSProperties}>\n\t\t\t\t\t\t\t\t\t{item}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t</motion.div>\n\t\t\t)}\n\t\t</AnimatePresence>,\n\t\tdocument.body\n\t);\n};\n","import React, { useCallback } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"../ContextMenu.module.scss\";\n\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface RadialMenuItemProps {\n\tchildren: React.ReactNode;\n\ticon?: React.ReactNode;\n\tclassName?: string;\n\tdisabled?: boolean;\n\tcloseOnSelect?: boolean;\n\tonSelect?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nexport const RadialMenuItem: React.FC<RadialMenuItemProps> = ({ children, icon, className, disabled, closeOnSelect = true, onSelect }) => {\n\tconst { closeMenu } = useMenuContext();\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (disabled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonSelect?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (closeOnSelect) {\n\t\t\t\tcloseMenu();\n\t\t\t}\n\t\t},\n\t\t[disabled, onSelect, closeOnSelect, closeMenu]\n\t);\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\trole=\"menuitem\"\n\t\t\ttabIndex={-1}\n\t\t\tdisabled={disabled}\n\t\t\taria-disabled={disabled}\n\t\t\tdata-menu-item=\"true\"\n\t\t\tdata-disabled={disabled ? \"true\" : undefined}\n\t\t\tdata-ui=\"radial-menu-item\"\n\t\t\tdata-action=\"select-radial-menu-item\"\n\t\t\tclassName={cn(styles.radialItem, className)}\n\t\t\tonClick={handleClick}>\n\t\t\t{icon && <span className={styles.radialItemIcon}>{icon}</span>}\n\t\t\t<span className={styles.radialItemText}>{children}</span>\n\t\t</button>\n\t);\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React from \"react\";\n\nimport { Placement } from \"@floating-ui/react\";\n\nimport { ContextMenuTrigger } from \"./ContextMenuTrigger\";\nimport { MenuContent } from \"./MenuContent\";\nimport { MenuGroupLabel } from \"./MenuGroupLabel\";\nimport { MenuItem } from \"./MenuItem\";\nimport { MenuRoot } from \"./MenuRoot\";\nimport { MenuSeparator } from \"./MenuSeparator\";\nimport { RadialMenuContent } from \"./RadialMenuContent\";\nimport { RadialMenuItem } from \"./RadialMenuItem\";\n\nexport interface ContextMenuProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nconst ContextMenuRoot: React.FC<ContextMenuProps> = ({ children, placement, open, defaultOpen, onOpenChange }) => {\n\treturn (\n\t\t<MenuRoot mode=\"contextmenu\" placement={placement} open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n\t\t\t{children}\n\t\t</MenuRoot>\n\t);\n};\n\nexport const ContextMenu = Object.assign(ContextMenuRoot, {\n\tTrigger: ContextMenuTrigger,\n\tContent: MenuContent,\n\tRadialContent: RadialMenuContent,\n\tItem: MenuItem,\n\tRadialItem: RadialMenuItem,\n\tSeparator: MenuSeparator,\n\tGroupLabel: MenuGroupLabel\n});\n","import React, { cloneElement } from \"react\";\n\nimport { assignRef, composeKeyboardHandlers, composeMouseHandlers } from \"./helpers\";\nimport { useMenuContext } from \"./MenuContext\";\n\nexport interface DropdownMenuTriggerProps {\n\tchildren: React.ReactElement<React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> }>;\n}\n\nexport const DropdownMenuTrigger: React.FC<DropdownMenuTriggerProps> = ({ children }) => {\n\tconst { mode, open, registerTriggerElement, onTriggerClick, onTriggerKeyDown } = useMenuContext();\n\n\tif (mode !== \"click\") {\n\t\tthrow new Error(\"DropdownMenu.Trigger must be used within <DropdownMenu>\");\n\t}\n\n\treturn cloneElement(children, {\n\t\tref: (node: HTMLElement | null) => {\n\t\t\tconst childRef = (children.props as { ref?: React.Ref<HTMLElement> }).ref;\n\t\t\tassignRef(childRef, node);\n\t\t\tregisterTriggerElement(node);\n\t\t},\n\t\t\"aria-haspopup\": \"menu\",\n\t\t\"aria-expanded\": open,\n\t\tonClick: composeMouseHandlers(children.props.onClick, onTriggerClick),\n\t\tonKeyDown: composeKeyboardHandlers(children.props.onKeyDown, onTriggerKeyDown)\n\t});\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React from \"react\";\n\nimport { Placement } from \"@floating-ui/react\";\n\nimport { DropdownMenuTrigger } from \"./DropdownMenuTrigger\";\nimport { MenuContent } from \"./MenuContent\";\nimport { MenuGroupLabel } from \"./MenuGroupLabel\";\nimport { MenuItem } from \"./MenuItem\";\nimport { MenuRoot } from \"./MenuRoot\";\nimport { MenuSeparator } from \"./MenuSeparator\";\n\nexport interface DropdownMenuProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nconst DropdownMenuRoot: React.FC<DropdownMenuProps> = ({ children, placement, open, defaultOpen, onOpenChange }) => {\n\treturn (\n\t\t<MenuRoot mode=\"click\" placement={placement} open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n\t\t\t{children}\n\t\t</MenuRoot>\n\t);\n};\n\nexport const DropdownMenu = Object.assign(DropdownMenuRoot, {\n\tTrigger: DropdownMenuTrigger,\n\tContent: MenuContent,\n\tItem: MenuItem,\n\tSeparator: MenuSeparator,\n\tGroupLabel: MenuGroupLabel\n});\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAgB,EAAa,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B;CAA2B;CAC/F;AACQ,CAAA,GAIgD;CAC3D,UDpBuE,EAAE,kBAAe;EACxF,IAAM,EAAE,SAAM,SAAM,2BAAwB,mBAAgB,wBAAqB,EAAe;EAEhG,IAAI,MAAS,SACZ,MAAU,MAAM,yDAAyD;EAG1E,OAAO,EAAa,GAAU;GAC7B,MAAM,MAA6B;IAClC,IAAM,IAAY,EAAS,MAA2C;IAEtE,AADA,EAAU,GAAU,CAAI,GACxB,EAAuB,CAAI;GAC5B;GACA,iBAAiB;GACjB,iBAAiB;GACjB,SAAS,EAAqB,EAAS,MAAM,SAAS,CAAc;GACpE,WAAW,EAAwB,EAAS,MAAM,WAAW,CAAgB;EAC9E,CAAC;CACF;CCGC,SAAS;CACT,MAAM;CACN,WAAW;CACX,YAAY;AACb,CAAC"}
@@ -1,12 +1,12 @@
1
- import { r as e } from "./popover-Bne-Ljbs.js";
1
+ import { r as e } from "./popover-yl5DVe06.js";
2
2
  import { t } from "./ui.module-oRwY3Zli.js";
3
- import { s as n } from "./input-DSPKgiCK.js";
4
- import { a as r, o as i, t as a } from "./CalendarView-Dm55k0bN.js";
5
- import { n as o } from "./radio-group-sSnlYjAX.js";
6
- import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
7
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
- import { CalendarDaysIcon as m } from "lucide-react";
9
- import { DEFAULT_DATE_PRESET_NAMES as h, formatDate as g, formatDateRange as _, getCalendarPeriod as v, getDatePreset as y, isDateRangeTuple as b, parseDateByFormat as x, resolveDateFormatName as ee } from "@ryuzaki13/react-foundation-lib/formatters";
3
+ import { s as n } from "./input-CuRK9Vbz.js";
4
+ import { a as r, o as i, t as a } from "./CalendarView-CwbPJG2Y.js";
5
+ import { n as o } from "./radio-group-CW-K1n9c.js";
6
+ import { CalendarDaysIcon as s } from "lucide-react";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import { useCallback as u, useEffect as ee, useMemo as d, useRef as f, useState as p } from "react";
9
+ import { DEFAULT_DATE_PRESET_NAMES as m, formatDate as h, formatDateRange as g, getCalendarPeriod as _, getDatePreset as v, isDateRangeTuple as y, parseDateByFormat as b, resolveDateFormatName as x } from "@ryuzaki13/react-foundation-lib/formatters";
10
10
  import { normalizePresetIds as S, resolvePresetOptionsByIds as C } from "@ryuzaki13/react-foundation-lib/presets";
11
11
  //#region src/date-input/lib/dateInputSelectionModes.ts
12
12
  var w = Object.freeze([
@@ -43,7 +43,7 @@ function k(e, t = T) {
43
43
  }
44
44
  //#endregion
45
45
  //#region src/date-input/lib/dateInputValue.ts
46
- var A = h.date, j = "dd.MM.yyyy", M = " - ";
46
+ var A = m.date, j = "dd.MM.yyyy", M = " - ";
47
47
  function N(e) {
48
48
  return e.selectionMode === "day" || e.selectionMode === "week" ? "day" : e.selectionMode === "month" || e.selectionMode === "year" ? e.selectionMode : e.datePickerLevel ?? "day";
49
49
  }
@@ -63,26 +63,26 @@ function F(e, t) {
63
63
  } : e;
64
64
  }
65
65
  function I(e) {
66
- let t = ee(e, A);
67
- return y(t) ? t : A;
66
+ let t = x(e, A);
67
+ return v(t) ? t : A;
68
68
  }
69
69
  function L(e, t) {
70
- return x(e, I(t.datePreset), {
70
+ return b(e, I(t.datePreset), {
71
71
  defaultFormat: A,
72
72
  precision: N(t),
73
73
  referenceDate: t.referenceDate
74
74
  })?.date ?? null;
75
75
  }
76
76
  function R(e, t) {
77
- return v(e, P(t))?.start ?? null;
77
+ return _(e, P(t))?.start ?? null;
78
78
  }
79
79
  function z(e, t) {
80
- if (!b(e)) return null;
80
+ if (!y(e)) return null;
81
81
  let [n, r] = e;
82
82
  return [R(n, t), B(r, t)];
83
83
  }
84
84
  function B(e, t) {
85
- return v(e, P(t))?.end ?? null;
85
+ return _(e, P(t))?.end ?? null;
86
86
  }
87
87
  function V(e) {
88
88
  return e?.getTime() ?? null;
@@ -96,16 +96,16 @@ function U(e, t, n) {
96
96
  }
97
97
  function W(e, t, n) {
98
98
  if (!e) return "";
99
- let r = F(t, n), i = v(e, P(r));
100
- return r.selectionMode === "week" && i ? _(i.start, i.end, I(r.datePreset), { precision: N(r) }) : g(e, I(r.datePreset), { precision: N(r) });
99
+ let r = F(t, n), i = _(e, P(r));
100
+ return r.selectionMode === "week" && i ? g(i.start, i.end, I(r.datePreset), { precision: N(r) }) : h(e, I(r.datePreset), { precision: N(r) });
101
101
  }
102
102
  function G(e, t, n) {
103
- if (!b(e)) return "";
103
+ if (!y(e)) return "";
104
104
  let r = F(t, n), [i, a] = e;
105
- return i && a ? _(i, a, I(r.datePreset), { precision: N(r) }) : i ? `${g(i, I(r.datePreset), { precision: N(r) })}${M}` : "";
105
+ return i && a ? g(i, a, I(r.datePreset), { precision: N(r) }) : i ? `${h(i, I(r.datePreset), { precision: N(r) })}${M}` : "";
106
106
  }
107
107
  function K(e, t, n) {
108
- return b(e) ? G(e, t, n) : W(e, t, n);
108
+ return y(e) ? G(e, t, n) : W(e, t, n);
109
109
  }
110
110
  function q(e, t, n) {
111
111
  let r = F(t, n);
@@ -122,10 +122,10 @@ function Y(e, t, n) {
122
122
  //#endregion
123
123
  //#region src/date-input/model/useDateInput.ts
124
124
  function X(e) {
125
- return b(e) ? e[0] ?? e[1] ?? void 0 : e ?? void 0;
125
+ return y(e) ? e[0] ?? e[1] ?? void 0 : e ?? void 0;
126
126
  }
127
127
  var te = (e) => {
128
- let t = l(() => {
128
+ let t = d(() => {
129
129
  let t = {
130
130
  selectionMode: e.selectionMode,
131
131
  weekEndDay: e.weekEndDay
@@ -136,7 +136,7 @@ var te = (e) => {
136
136
  e.selectionMode,
137
137
  e.value,
138
138
  e.weekEndDay
139
- ]), n = l(() => ({
139
+ ]), n = d(() => ({
140
140
  datePreset: e.datePreset,
141
141
  datePickerLevel: e.datePickerLevel,
142
142
  selectionMode: e.selectionMode,
@@ -152,12 +152,12 @@ var te = (e) => {
152
152
  e.datePickerLevel ?? null,
153
153
  e.selectionMode ?? null,
154
154
  e.weekEndDay ?? null,
155
- b(t) ? [t[0]?.getTime() ?? null, t[1]?.getTime() ?? null] : t?.getTime() ?? null
156
- ]), [a, o] = d(() => ({
155
+ y(t) ? [t[0]?.getTime() ?? null, t[1]?.getTime() ?? null] : t?.getTime() ?? null
156
+ ]), [a, o] = p(() => ({
157
157
  sourceSignature: i,
158
158
  selectedDate: t,
159
159
  inputValue: r
160
- })), s = a.sourceSignature === i, c = s ? a.selectedDate : t, u = s ? a.inputValue : r, f = (e) => {
160
+ })), s = a.sourceSignature === i, c = s ? a.selectedDate : t, l = s ? a.inputValue : r, u = (e) => {
161
161
  o((n) => {
162
162
  let r = n.sourceSignature === i ? n.selectedDate : t;
163
163
  return {
@@ -166,7 +166,7 @@ var te = (e) => {
166
166
  inputValue: e
167
167
  };
168
168
  });
169
- }, p = (e) => {
169
+ }, ee = (e) => {
170
170
  o((t) => {
171
171
  let n = t.sourceSignature === i ? t.inputValue : r;
172
172
  return {
@@ -175,12 +175,12 @@ var te = (e) => {
175
175
  inputValue: n
176
176
  };
177
177
  });
178
- }, m = (e) => K(e, n);
178
+ }, f = (e) => K(e, n);
179
179
  return {
180
- inputValue: u,
181
- setInputValue: f,
180
+ inputValue: l,
181
+ setInputValue: u,
182
182
  selectedDate: c,
183
- setSelectedDate: p,
183
+ setSelectedDate: ee,
184
184
  handleSelect: (t) => {
185
185
  let [r, a] = Array.isArray(t) ? t : [t, null];
186
186
  if (e.selectsRange) {
@@ -191,14 +191,14 @@ var te = (e) => {
191
191
  o({
192
192
  sourceSignature: i,
193
193
  selectedDate: t,
194
- inputValue: m(t)
194
+ inputValue: f(t)
195
195
  }), e.onChange(t);
196
196
  } else {
197
197
  let n = [t, s];
198
198
  o({
199
199
  sourceSignature: i,
200
200
  selectedDate: n,
201
- inputValue: m(n)
201
+ inputValue: f(n)
202
202
  }), e.onChange(n);
203
203
  }
204
204
  return !0;
@@ -207,17 +207,17 @@ var te = (e) => {
207
207
  return o({
208
208
  sourceSignature: i,
209
209
  selectedDate: c,
210
- inputValue: m(c)
210
+ inputValue: f(c)
211
211
  }), !1;
212
212
  }
213
213
  let s = R(r, n);
214
214
  return o({
215
215
  sourceSignature: i,
216
216
  selectedDate: s,
217
- inputValue: m(s)
217
+ inputValue: f(s)
218
218
  }), e.onChange(s), !0;
219
219
  },
220
- formatDate: m,
220
+ formatDate: f,
221
221
  parseDate: (t) => {
222
222
  let r = {
223
223
  ...n,
@@ -233,12 +233,12 @@ function re(e, t) {
233
233
  let n = O(e, w);
234
234
  return k(n.includes(t) ? n : [...n, t]);
235
235
  }
236
- function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v, maxDate: y, datePreset: x, datePickerLevel: ee, selectionMode: S, weekEndDay: C = "sunday", allowSelectionModeChange: T, selectionModeOptions: E, selectionModeDatePresets: D, onSelectionModeChange: k, ...A }) {
237
- let [j, M] = d(!1), N = O(E, w), [P, F] = d(() => S ?? N[0] ?? "day"), I = S ?? P, L = T ? D?.[I] ?? x : x, R = ee ?? "day", z = i(I, R), [B, V] = d(() => ({
236
+ function Z({ placeholder: d, disabled: m, error: h, onClearError: g, minDate: _, maxDate: v, datePreset: b, datePickerLevel: x, selectionMode: S, weekEndDay: C = "sunday", allowSelectionModeChange: T, selectionModeOptions: E, selectionModeDatePresets: D, onSelectionModeChange: k, ...A }) {
237
+ let [j, M] = p(!1), N = O(E, w), [P, F] = p(() => S ?? N[0] ?? "day"), I = S ?? P, L = T ? D?.[I] ?? b : b, R = x ?? "day", z = i(I, R), [B, V] = p(() => ({
238
238
  view: z,
239
239
  selectionMode: I,
240
240
  minDatePickerLevel: R
241
- })), W = B.selectionMode === I && B.minDatePickerLevel === R && r(B.view, R) ? B.view : z, G = u(A.value), K = {
241
+ })), W = B.selectionMode === I && B.minDatePickerLevel === R && r(B.view, R) ? B.view : z, G = f(A.value), K = {
242
242
  selectionMode: I,
243
243
  weekEndDay: C
244
244
  }, { inputValue: q, setInputValue: J, selectedDate: Y, setSelectedDate: X, handleSelect: Z, formatDate: Q, parseDate: ie } = te({
@@ -247,22 +247,22 @@ function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v,
247
247
  datePickerLevel: R,
248
248
  selectionMode: I,
249
249
  weekEndDay: C
250
- }), $ = A.selectsRange ? A.onChange : void 0, ae = s((e) => {
250
+ }), $ = A.selectsRange ? A.onChange : void 0, ae = u((e) => {
251
251
  r(e, R) && V({
252
252
  view: e,
253
253
  selectionMode: I,
254
254
  minDatePickerLevel: R
255
255
  });
256
256
  }, [R, I]);
257
- c(() => {
257
+ ee(() => {
258
258
  G.current = A.value;
259
259
  }, [A.value]);
260
260
  let oe = () => {
261
261
  if (q) {
262
262
  let e = ie(q);
263
263
  if (e) {
264
- if (J(Q(e)), A.selectsRange && b(e)) {
265
- if (U(e, b(Y) ? Y : null, K)) return;
264
+ if (J(Q(e)), A.selectsRange && y(e)) {
265
+ if (U(e, y(Y) ? Y : null, K)) return;
266
266
  X(e), A.onChange(e);
267
267
  } else if (!A.selectsRange && e instanceof Date) {
268
268
  if (H(e, Y instanceof Date ? Y : null, K)) return;
@@ -272,9 +272,9 @@ function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v,
272
272
  }
273
273
  }, se = (e) => {
274
274
  e.key === "Enter" && (e.preventDefault(), oe());
275
- }, ce = s((e) => {
275
+ }, ce = u((e) => {
276
276
  Z(e) && M(!1);
277
- }, [Z]), le = s((e) => {
277
+ }, [Z]), le = u((e) => {
278
278
  S === void 0 && F(e), k?.(e), V({
279
279
  view: i(e, R),
280
280
  selectionMode: e,
@@ -284,9 +284,9 @@ function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v,
284
284
  S,
285
285
  R,
286
286
  k
287
- ]), ue = s(() => {
287
+ ]), ue = u(() => {
288
288
  if ($) {
289
- let [, e] = b(Y) ? Y : [null, null];
289
+ let [, e] = y(Y) ? Y : [null, null];
290
290
  if (!e) {
291
291
  let e = G.current, t = Array.isArray(e) ? e : null, n = t?.[0] ?? null, r = t?.[1] ?? null;
292
292
  if (n && r) {
@@ -302,12 +302,12 @@ function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v,
302
302
  J,
303
303
  Q
304
304
  ]), de = re(E, I), fe = T && de.length > 1;
305
- return /* @__PURE__ */ p(e, {
305
+ return /* @__PURE__ */ l(e, {
306
306
  open: j,
307
307
  onOpenChange: (e) => {
308
308
  M(e), e || ue();
309
309
  },
310
- children: [/* @__PURE__ */ f(n, {
310
+ children: [/* @__PURE__ */ c(n, {
311
311
  label: A.label,
312
312
  description: A.description,
313
313
  size: A.size,
@@ -315,24 +315,24 @@ function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v,
315
315
  onChange: J,
316
316
  onBlur: oe,
317
317
  onKeyUp: se,
318
- placeholder: l,
319
- disabled: h,
320
- error: g,
321
- onClearError: _,
318
+ placeholder: d,
319
+ disabled: m,
320
+ error: h,
321
+ onClearError: g,
322
322
  endAdornmentWidth: "var(--control-height)",
323
- endAdornment: /* @__PURE__ */ f(e.Trigger, { children: /* @__PURE__ */ f("div", {
323
+ endAdornment: /* @__PURE__ */ c(e.Trigger, { children: /* @__PURE__ */ c("div", {
324
324
  className: t.uiToggleButtonContainer,
325
- children: /* @__PURE__ */ f("button", {
325
+ children: /* @__PURE__ */ c("button", {
326
326
  type: "button",
327
- disabled: h,
327
+ disabled: m,
328
328
  "aria-label": "Открыть календарь",
329
329
  className: t.uiToggleButton,
330
- children: /* @__PURE__ */ f(m, {})
330
+ children: /* @__PURE__ */ c(s, {})
331
331
  })
332
332
  }) })
333
- }), /* @__PURE__ */ p(e.Content, {
333
+ }), /* @__PURE__ */ l(e.Content, {
334
334
  background: "primary",
335
- children: [/* @__PURE__ */ f(a, {
335
+ children: [/* @__PURE__ */ c(a, {
336
336
  view: W,
337
337
  datePickerLevel: R,
338
338
  selectionMode: I,
@@ -340,17 +340,17 @@ function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v,
340
340
  onViewChange: ae,
341
341
  value: Y ?? null,
342
342
  onChange: ce,
343
- minDate: v,
344
- maxDate: y,
343
+ minDate: _,
344
+ maxDate: v,
345
345
  selectsRange: !!A.selectsRange
346
- }), fe && /* @__PURE__ */ f("div", {
346
+ }), fe && /* @__PURE__ */ c("div", {
347
347
  className: ne.selectionModeControl,
348
- children: /* @__PURE__ */ f(o, {
348
+ children: /* @__PURE__ */ c(o, {
349
349
  value: I,
350
350
  onChange: le,
351
351
  noWrap: !0,
352
352
  "aria-label": "Режим выбора даты",
353
- children: de.map((e) => /* @__PURE__ */ f(o.Option, {
353
+ children: de.map((e) => /* @__PURE__ */ c(o.Option, {
354
354
  value: e.id,
355
355
  label: e.label
356
356
  }, e.id))
@@ -360,10 +360,10 @@ function Z({ placeholder: l, disabled: h, error: g, onClearError: _, minDate: v,
360
360
  });
361
361
  }
362
362
  function Q(e) {
363
- return /* @__PURE__ */ f(Z, { ...e });
363
+ return /* @__PURE__ */ c(Z, { ...e });
364
364
  }
365
365
  function ie(e) {
366
- return /* @__PURE__ */ f(Z, {
366
+ return /* @__PURE__ */ c(Z, {
367
367
  ...e,
368
368
  selectsRange: !0
369
369
  });
@@ -371,4 +371,4 @@ function ie(e) {
371
371
  //#endregion
372
372
  export { T as _, U as a, k as b, G as c, B as d, R as f, w as g, q as h, A as i, W as l, Y as m, Q as n, H as o, J as p, j as r, K as s, ie as t, z as u, D as v, O as y };
373
373
 
374
- //# sourceMappingURL=date-input-D7aBsPJc.js.map
374
+ //# sourceMappingURL=date-input-Crijdmmq.js.map