@consta/uikit 4.28.1 → 4.29.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 (75) hide show
  1. package/__internal__/src/components/AutoCompleteCanary/helpers.d.ts +1 -1
  2. package/__internal__/src/components/AvatarGroup/helpers.d.ts +1 -1
  3. package/__internal__/src/components/BadgeGroup/types.d.ts +3 -2
  4. package/__internal__/src/components/BadgeGroup/types.js.map +1 -1
  5. package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabs.css +1 -1
  6. package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsCanary.js +1 -1
  7. package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsCanary.js.map +1 -1
  8. package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.css +1 -1
  9. package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.js +1 -1
  10. package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.js.map +1 -1
  11. package/__internal__/src/components/BookmarkTabsCanary/helper.d.ts +1 -1
  12. package/__internal__/src/components/BookmarkTabsCanary/types.d.ts +10 -7
  13. package/__internal__/src/components/BookmarkTabsCanary/types.js.map +1 -1
  14. package/__internal__/src/components/Button/Button.css +1 -1
  15. package/__internal__/src/components/Button/Button.d.ts +1 -0
  16. package/__internal__/src/components/Button/Button.js +1 -1
  17. package/__internal__/src/components/Button/Button.js.map +1 -1
  18. package/__internal__/src/components/ChipsCanary/types.d.ts +3 -2
  19. package/__internal__/src/components/ChipsCanary/types.js.map +1 -1
  20. package/__internal__/src/components/ChoiceGroup/helper.d.ts +1 -1
  21. package/__internal__/src/components/CollapseGroup/helpers.d.ts +2 -2
  22. package/__internal__/src/components/Combobox/helpers.d.ts +2 -2
  23. package/__internal__/src/components/ComboboxCanary/helpers.d.ts +2 -2
  24. package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
  25. package/__internal__/src/components/ContextMenu/helpers.d.ts +4 -4
  26. package/__internal__/src/components/ContextMenu/types.d.ts +7 -6
  27. package/__internal__/src/components/ContextMenu/types.js.map +1 -1
  28. package/__internal__/src/components/ContextMenuDeprecated/helpers.d.ts +5 -4
  29. package/__internal__/src/components/ContextMenuDeprecated/helpers.js.map +1 -1
  30. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +2 -2
  31. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +2 -2
  32. package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +2 -2
  33. package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +2 -2
  34. package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +2 -2
  35. package/__internal__/src/components/FileField/FileField.d.ts +2 -1
  36. package/__internal__/src/components/FileField/FileField.js.map +1 -1
  37. package/__internal__/src/components/Header/Logo/HeaderLogo.d.ts +3 -2
  38. package/__internal__/src/components/Header/Logo/HeaderLogo.js.map +1 -1
  39. package/__internal__/src/components/ListCanary/ListItem/ListItem.js +1 -1
  40. package/__internal__/src/components/ListCanary/ListItem/ListItem.js.map +1 -1
  41. package/__internal__/src/components/ListCanary/types.d.ts +5 -4
  42. package/__internal__/src/components/ListCanary/types.js.map +1 -1
  43. package/__internal__/src/components/ProgressStepBar/helpers.d.ts +2 -2
  44. package/__internal__/src/components/Select/helpers.d.ts +2 -2
  45. package/__internal__/src/components/SelectCanary/helpers.d.ts +2 -2
  46. package/__internal__/src/components/Sidebar/Sidebar.d.ts +2 -2
  47. package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
  48. package/__internal__/src/components/SnackBar/helper.d.ts +1 -1
  49. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/TabsFitModeDropdownWrapper.js +1 -1
  50. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/TabsFitModeDropdownWrapper.js.map +1 -1
  51. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/useFittingItems.d.ts +4 -3
  52. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/useFittingItems.js +1 -1
  53. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/useFittingItems.js.map +1 -1
  54. package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js +1 -1
  55. package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +1 -1
  56. package/__internal__/src/components/Tabs/Line/TabsLine.d.ts +1 -0
  57. package/__internal__/src/components/Tabs/Line/TabsLine.js +1 -1
  58. package/__internal__/src/components/Tabs/Line/TabsLine.js.map +1 -1
  59. package/__internal__/src/components/Tabs/Tabs.js +1 -1
  60. package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
  61. package/__internal__/src/components/Tabs/types.d.ts +7 -5
  62. package/__internal__/src/components/Tabs/types.js.map +1 -1
  63. package/__internal__/src/components/Tag/Tag.d.ts +3 -2
  64. package/__internal__/src/components/Tag/Tag.js.map +1 -1
  65. package/__internal__/src/components/TagBase/TagBase.d.ts +1 -1
  66. package/__internal__/src/components/UserSelect/helpers.d.ts +2 -2
  67. package/__internal__/src/components/UserSelectCanary/helpers.d.ts +2 -2
  68. package/__internal__/src/utils/types/AsTags.d.ts +3 -0
  69. package/__internal__/src/utils/types/AsTags.js +2 -0
  70. package/__internal__/src/utils/types/AsTags.js.map +1 -0
  71. package/__internal__/src/utils/types/PropsWithAsAttributes.d.ts +6 -5
  72. package/__internal__/src/utils/types/PropsWithAsAttributes.js.map +1 -1
  73. package/__internal__/src/utils/types/PropsWithJsxAttributes.d.ts +2 -1
  74. package/__internal__/src/utils/types/PropsWithJsxAttributes.js.map +1 -1
  75. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuLevel.js","names":["IconArrowLeft","IconArrowRight","React","forwardRef","useEffect","cnListBox","List","ListDivider","ListItem","mapIconSize","mapVerticalSpase","useFlag","useRefs","cnMixPopoverAnimate","cnMixSpace","cn","ContextMenuLevelWrapper","contextMenuDefaultSize","cnContextMenuLevel","timers","clearTimers","timer","clearTimeout","closeDelay","ContextMenuLevelRender","props","ref","size","items","groupsProp","groups","className","form","animate","levelDepth","activeItem","addLevel","deleteLevel","setHoveredParenLevel","hoveredParenLevel","sortGroup","onItemClick","isOpen","parent","isMobile","direction","possibleDirections","offset","onSetDirection","spareDirection","anchorRef","getItemLabel","getItemRightSide","getItemLeftSide","getItemSubMenu","getItemStatus","getItemDisabled","getItemKey","getItemOnClick","getItemAs","getItemAttributes","getItemGroupId","getItemLeftIcon","getItemRightIcon","getGroupLabel","getGroupId","otherProps","hovered","setHovered","getKey","item","toString","itemsRefs","map","setTimeout","addCurrentLevel","subMenu","disabled","Array","isArray","key","level","onMouseEnter","e","firstLevel","border","shadow","pV","on","off","mV","a","b","side","sides","push","ContextMenuLevel"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.tsx"],"sourcesContent":["import './ContextMenuLevel.css';\n\nimport { IconArrowLeft } from '@consta/icons/IconArrowLeft';\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport {\n cnListBox,\n List,\n ListDivider,\n ListItem,\n mapIconSize,\n mapVerticalSpase,\n} from '##/components/ListCanary';\nimport { useFlag } from '##/hooks/useFlag/useFlag';\nimport { useRefs } from '##/hooks/useRefs/useRefs';\nimport { cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\nimport { ContextMenuLevelWrapper } from '../ContextMenuLevelWrapper';\nimport {\n contextMenuDefaultSize,\n ContextMenuItemDefault,\n ContextMenuLevelComponent,\n ContextMenuLevelProps,\n} from '../types';\n\nexport const cnContextMenuLevel = cn('ContextMenuLevel');\n\nlet timers: ReturnType<typeof setTimeout>[] = [];\nexport function clearTimers() {\n for (const timer of timers) {\n clearTimeout(timer);\n }\n timers = [];\n}\n\nconst closeDelay = 300;\n\nconst ContextMenuLevelRender = (\n props: ContextMenuLevelProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = contextMenuDefaultSize,\n items,\n groups: groupsProp,\n className,\n form = 'default',\n animate,\n // Свойства относящиеся к меню\n levelDepth,\n activeItem,\n addLevel,\n deleteLevel,\n setHoveredParenLevel,\n hoveredParenLevel,\n sortGroup,\n onItemClick,\n isOpen,\n parent,\n isMobile,\n\n // Свойства для поповера\n direction,\n possibleDirections,\n offset,\n onSetDirection,\n spareDirection,\n anchorRef,\n // Геттеры для ITEM\n getItemLabel,\n getItemRightSide,\n getItemLeftSide,\n getItemSubMenu,\n getItemStatus,\n getItemDisabled,\n getItemKey,\n getItemOnClick,\n getItemAs,\n getItemAttributes,\n getItemGroupId,\n getItemLeftIcon,\n getItemRightIcon,\n // Геттеры для GROUP\n getGroupLabel,\n getGroupId,\n ...otherProps\n } = props;\n\n const [hovered, setHovered] = useFlag(false);\n\n const getKey = (item: ContextMenuItemDefault) =>\n (getItemKey(item) || getItemLabel(item)).toString();\n\n const itemsRefs = useRefs<HTMLDivElement, string[]>(\n items.map((item) => getKey(item)),\n [groupsProp],\n );\n\n useEffect(() => {\n if (levelDepth !== 0 && !hovered && hoveredParenLevel < levelDepth) {\n clearTimeout(timers[levelDepth]);\n timers[levelDepth] = setTimeout(\n () => deleteLevel(levelDepth),\n closeDelay,\n );\n }\n return () => clearTimeout(timers[levelDepth]);\n }, [hovered, hoveredParenLevel]);\n\n useEffect(() => {\n if (!isOpen) {\n clearTimeout(timers[levelDepth]);\n }\n }, [isOpen]);\n\n const addCurrentLevel = (item: ContextMenuItemDefault) => {\n const subMenu = getItemSubMenu(item);\n const disabled = getItemDisabled(item);\n\n if (Array.isArray(subMenu) && !disabled) {\n const key = getKey(item);\n addLevel({\n level: levelDepth + 1,\n items: subMenu,\n anchorRef: itemsRefs[key],\n activeItem: key,\n parent: item,\n });\n setHoveredParenLevel(levelDepth + 1);\n } else {\n setHoveredParenLevel(levelDepth);\n }\n };\n\n const onMouseEnter = isMobile\n ? undefined\n : (\n item: ContextMenuItemDefault,\n ): JSX.IntrinsicElements['div']['onMouseEnter'] =>\n (e) => {\n addCurrentLevel(item);\n const onMouseEnter = getItemAttributes(item)\n ?.onMouseEnter as JSX.IntrinsicElements['div']['onMouseEnter'];\n\n onMouseEnter?.(e);\n };\n\n const firstLevel = levelDepth === 0;\n\n return (\n <ContextMenuLevelWrapper\n anchorRef={anchorRef}\n className={\n isMobile\n ? cnContextMenuLevel('Mobile', { animate }, [className])\n : cnContextMenuLevel('Desktop', { firstLevel }, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixSpace({\n pV: mapVerticalSpase[size],\n }),\n cnMixPopoverAnimate({ animate }),\n firstLevel ? className : undefined,\n ])\n }\n possibleDirections={possibleDirections}\n spareDirection={spareDirection}\n direction={direction}\n offset={offset}\n onSetDirection={onSetDirection}\n onMouseEnter={setHovered.on}\n onMouseLeave={setHovered.off}\n ref={ref}\n isMobile={isMobile}\n {...otherProps}\n >\n {parent && (\n <>\n <ListItem\n label={getItemLabel(parent)}\n size={size}\n leftIcon={IconArrowLeft}\n onClick={() => deleteLevel(levelDepth)}\n />\n <ListDivider size={size} space={{ mV: mapVerticalSpase[size] }} />\n </>\n )}\n <List\n size={size}\n items={items}\n getItemLabel={getItemLabel}\n onItemClick={(item, { e }) => {\n isMobile && addCurrentLevel(item);\n onItemClick?.({\n item,\n e: e as React.MouseEvent<HTMLDivElement>,\n });\n }}\n sortGroup={sortGroup ? (a, b) => sortGroup(a.key, b.key) : undefined}\n getItemOnClick={\n getItemOnClick\n ? (item) => (e) =>\n getItemOnClick(item)?.({\n e: e as React.MouseEvent<HTMLDivElement>,\n item,\n })\n : undefined\n }\n getItemAs={getItemAs}\n getItemAttributes={\n onMouseEnter\n ? (item) =>\n ({\n ...getItemAttributes(item),\n onMouseEnter: onMouseEnter(item),\n } as JSX.IntrinsicElements[keyof JSX.IntrinsicElements])\n : getItemAttributes\n }\n getItemGroupKey={getItemGroupId}\n getItemLeftIcon={getItemLeftIcon}\n getItemRightIcon={getItemRightIcon}\n getItemLeftSide={getItemLeftSide}\n getItemRightSide={(item) => {\n const side = getItemRightSide(item);\n if (!getItemSubMenu(item)) {\n return side;\n }\n\n const sides: React.ReactNode[] = Array.isArray(side) ? side : [side];\n sides.push(<IconArrowRight size={mapIconSize[size]} />);\n return sides;\n }}\n getGroupKey={getGroupId}\n getGroupLabel={getGroupLabel}\n getItemDisabled={getItemDisabled}\n getItemStatus={getItemStatus}\n getItemRef={(item) => itemsRefs[getKey(item)]}\n groups={groupsProp}\n getItemActive={(item) => getKey(item) === activeItem}\n innerOffset={form === 'round' ? 'increased' : 'normal'}\n />\n </ContextMenuLevelWrapper>\n );\n};\n\nexport const ContextMenuLevel = forwardRef(\n ContextMenuLevelRender,\n) as ContextMenuLevelComponent;\n"],"mappings":"0/EAAA,+BAEA,OAASA,aAAT,KAA8B,6BAA9B,CACA,OAASC,cAAT,KAA+B,8BAA/B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,KAA6C,OAA7C,CAEA,OACEC,SADF,CAEEC,IAFF,CAGEC,WAHF,CAIEC,QAJF,CAKEC,WALF,CAMEC,gBANF,wBAQA,OAASC,OAAT,sCACA,OAASC,OAAT,sCACA,OAASC,mBAAT,uCACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAEA,OAASC,uBAAT,kCACA,OACEC,sBADF,gBAOA,MAAO,IAAMC,mBAAkB,CAAGH,EAAE,CAAC,kBAAD,CAA7B,CAEP,GAAII,OAAuC,CAAG,EAA9C,CACA,MAAO,SAASC,YAAT,EAAuB,oCACRD,MADQ,MAC5B,2BAA4B,IAAjBE,EAAiB,SAC1BC,YAAY,CAACD,CAAD,CACb,CAH2B,+BAI5BF,M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B,IAAI,CAAEtF,WAAW,CAACkB,CAAD,CAAjC,EAAX,CACA,CAAOmE,CACR,CA5CH,CA6CE,WAAW,CAAE7B,CA7Cf,CA8CE,aAAa,CAAED,CA9CjB,CA+CE,eAAe,CAAER,CA/CnB,CAgDE,aAAa,CAAED,CAhDjB,CAiDE,UAAU,CAAE,oBAACe,CAAD,QAAUE,EAAS,CAACH,CAAM,CAACC,CAAD,CAAP,CAAnB,CAjDd,CAkDE,MAAM,CAAEzC,CAlDV,CAmDE,aAAa,CAAE,uBAACyC,CAAD,QAAUD,EAAM,CAACC,CAAD,CAAN,GAAiBnC,CAA3B,CAnDjB,CAoDE,WAAW,CAAW,OAAT,GAAAH,CAAI,CAAe,WAAf,CAA6B,QApDhD,EApCF,CA4FH,C,CAED,MAAO,IAAMgE,iBAAgB,CAAG7F,UAAU,CACxCqB,sBADwC,CAAnC"}
1
+ {"version":3,"file":"ContextMenuLevel.js","names":["IconArrowLeft","IconArrowRight","React","forwardRef","useEffect","cnListBox","List","ListDivider","ListItem","mapIconSize","mapVerticalSpase","useFlag","useRefs","cnMixPopoverAnimate","cnMixSpace","cn","ContextMenuLevelWrapper","contextMenuDefaultSize","cnContextMenuLevel","timers","clearTimers","timer","clearTimeout","closeDelay","ContextMenuLevelRender","props","ref","size","items","groupsProp","groups","className","form","animate","levelDepth","activeItem","addLevel","deleteLevel","setHoveredParenLevel","hoveredParenLevel","sortGroup","onItemClick","isOpen","parent","isMobile","direction","possibleDirections","offset","onSetDirection","spareDirection","anchorRef","getItemLabel","getItemRightSide","getItemLeftSide","getItemSubMenu","getItemStatus","getItemDisabled","getItemKey","getItemOnClick","getItemAs","getItemAttributes","getItemGroupId","getItemLeftIcon","getItemRightIcon","getGroupLabel","getGroupId","otherProps","hovered","setHovered","getKey","item","toString","itemsRefs","map","setTimeout","addCurrentLevel","subMenu","disabled","Array","isArray","key","level","onMouseEnter","e","firstLevel","border","shadow","pV","on","off","mV","a","b","side","sides","push","ContextMenuLevel"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.tsx"],"sourcesContent":["import './ContextMenuLevel.css';\n\nimport { IconArrowLeft } from '@consta/icons/IconArrowLeft';\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport {\n cnListBox,\n List,\n ListDivider,\n ListItem,\n mapIconSize,\n mapVerticalSpase,\n} from '##/components/ListCanary';\nimport { useFlag } from '##/hooks/useFlag/useFlag';\nimport { useRefs } from '##/hooks/useRefs/useRefs';\nimport { cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { AsAttributes, AsTagAttribute } from '##/utils/types/AsTags';\n\nimport { ContextMenuLevelWrapper } from '../ContextMenuLevelWrapper';\nimport {\n contextMenuDefaultSize,\n ContextMenuItemDefault,\n ContextMenuLevelComponent,\n ContextMenuLevelProps,\n} from '../types';\n\nexport const cnContextMenuLevel = cn('ContextMenuLevel');\n\nlet timers: ReturnType<typeof setTimeout>[] = [];\nexport function clearTimers() {\n for (const timer of timers) {\n clearTimeout(timer);\n }\n timers = [];\n}\n\nconst closeDelay = 300;\n\nconst ContextMenuLevelRender = (\n props: ContextMenuLevelProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = contextMenuDefaultSize,\n items,\n groups: groupsProp,\n className,\n form = 'default',\n animate,\n // Свойства относящиеся к меню\n levelDepth,\n activeItem,\n addLevel,\n deleteLevel,\n setHoveredParenLevel,\n hoveredParenLevel,\n sortGroup,\n onItemClick,\n isOpen,\n parent,\n isMobile,\n\n // Свойства для поповера\n direction,\n possibleDirections,\n offset,\n onSetDirection,\n spareDirection,\n anchorRef,\n // Геттеры для ITEM\n getItemLabel,\n getItemRightSide,\n getItemLeftSide,\n getItemSubMenu,\n getItemStatus,\n getItemDisabled,\n getItemKey,\n getItemOnClick,\n getItemAs,\n getItemAttributes,\n getItemGroupId,\n getItemLeftIcon,\n getItemRightIcon,\n // Геттеры для GROUP\n getGroupLabel,\n getGroupId,\n ...otherProps\n } = props;\n\n const [hovered, setHovered] = useFlag(false);\n\n const getKey = (item: ContextMenuItemDefault) =>\n (getItemKey(item) || getItemLabel(item)).toString();\n\n const itemsRefs = useRefs<HTMLDivElement, string[]>(\n items.map((item) => getKey(item)),\n [groupsProp],\n );\n\n useEffect(() => {\n if (levelDepth !== 0 && !hovered && hoveredParenLevel < levelDepth) {\n clearTimeout(timers[levelDepth]);\n timers[levelDepth] = setTimeout(\n () => deleteLevel(levelDepth),\n closeDelay,\n );\n }\n return () => clearTimeout(timers[levelDepth]);\n }, [hovered, hoveredParenLevel]);\n\n useEffect(() => {\n if (!isOpen) {\n clearTimeout(timers[levelDepth]);\n }\n }, [isOpen]);\n\n const addCurrentLevel = (item: ContextMenuItemDefault) => {\n const subMenu = getItemSubMenu(item);\n const disabled = getItemDisabled(item);\n\n if (Array.isArray(subMenu) && !disabled) {\n const key = getKey(item);\n addLevel({\n level: levelDepth + 1,\n items: subMenu,\n anchorRef: itemsRefs[key],\n activeItem: key,\n parent: item,\n });\n setHoveredParenLevel(levelDepth + 1);\n } else {\n setHoveredParenLevel(levelDepth);\n }\n };\n\n const onMouseEnter = isMobile\n ? undefined\n : (item: ContextMenuItemDefault): AsTagAttribute<'div'>['onMouseEnter'] =>\n (e) => {\n addCurrentLevel(item);\n const onMouseEnter = getItemAttributes(item)\n ?.onMouseEnter as AsTagAttribute<'div'>['onMouseEnter'];\n\n onMouseEnter?.(e);\n };\n\n const firstLevel = levelDepth === 0;\n\n return (\n <ContextMenuLevelWrapper\n anchorRef={anchorRef}\n className={\n isMobile\n ? cnContextMenuLevel('Mobile', { animate }, [className])\n : cnContextMenuLevel('Desktop', { firstLevel }, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixSpace({\n pV: mapVerticalSpase[size],\n }),\n cnMixPopoverAnimate({ animate }),\n firstLevel ? className : undefined,\n ])\n }\n possibleDirections={possibleDirections}\n spareDirection={spareDirection}\n direction={direction}\n offset={offset}\n onSetDirection={onSetDirection}\n onMouseEnter={setHovered.on}\n onMouseLeave={setHovered.off}\n ref={ref}\n isMobile={isMobile}\n {...otherProps}\n >\n {parent && (\n <>\n <ListItem\n label={getItemLabel(parent)}\n size={size}\n leftIcon={IconArrowLeft}\n onClick={() => deleteLevel(levelDepth)}\n />\n <ListDivider size={size} space={{ mV: mapVerticalSpase[size] }} />\n </>\n )}\n <List\n size={size}\n items={items}\n getItemLabel={getItemLabel}\n onItemClick={(item, { e }) => {\n isMobile && addCurrentLevel(item);\n onItemClick?.({\n item,\n e: e as React.MouseEvent<HTMLDivElement>,\n });\n }}\n sortGroup={sortGroup ? (a, b) => sortGroup(a.key, b.key) : undefined}\n getItemOnClick={\n getItemOnClick\n ? (item) => (e) =>\n getItemOnClick(item)?.({\n e: e as React.MouseEvent<HTMLDivElement>,\n item,\n })\n : undefined\n }\n getItemAs={getItemAs}\n getItemAttributes={\n onMouseEnter\n ? (item) =>\n ({\n ...getItemAttributes(item),\n onMouseEnter: onMouseEnter(item),\n } as AsAttributes)\n : getItemAttributes\n }\n getItemGroupKey={getItemGroupId}\n getItemLeftIcon={getItemLeftIcon}\n getItemRightIcon={getItemRightIcon}\n getItemLeftSide={getItemLeftSide}\n getItemRightSide={(item) => {\n const side = getItemRightSide(item);\n if (!getItemSubMenu(item)) {\n return side;\n }\n\n const sides: React.ReactNode[] = Array.isArray(side) ? side : [side];\n sides.push(<IconArrowRight size={mapIconSize[size]} />);\n return sides;\n }}\n getGroupKey={getGroupId}\n getGroupLabel={getGroupLabel}\n getItemDisabled={getItemDisabled}\n getItemStatus={getItemStatus}\n getItemRef={(item) => itemsRefs[getKey(item)]}\n groups={groupsProp}\n getItemActive={(item) => getKey(item) === activeItem}\n innerOffset={form === 'round' ? 'increased' : 'normal'}\n />\n </ContextMenuLevelWrapper>\n );\n};\n\nexport const ContextMenuLevel = forwardRef(\n ContextMenuLevelRender,\n) as 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enter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown") => void) | undefined;
15
15
  onClickOutside?: import("../../hooks/useClickOutside").ClickOutsideHandler | undefined;
16
16
  isOpen?: boolean | undefined;
17
- form?: "default" | "round" | "brick" | undefined;
17
+ form?: "default" | "brick" | "round" | undefined;
18
18
  isMobile?: boolean | undefined;
19
19
  } & import("./types").MappersItem<ITEM> & import("./types").MappersGroup<GROUP> & {
20
20
  anchorRef: import("react").RefObject<HTMLElement>;
21
21
  position?: undefined;
22
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "direction" | "offset" | "items" | "groups" | "position" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
22
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "items" | "groups" | "direction" | "offset" | "position" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
23
23
  id: unknown;
24
24
  } ? {} : {
25
25
  getGroupId: ContextMenuPropGetGroupId<GROUP>;
@@ -60,12 +60,12 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuLevels
60
60
  onSetDirection?: ((direction: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown") => void) | undefined;
61
61
  onClickOutside?: import("../../hooks/useClickOutside").ClickOutsideHandler | undefined;
62
62
  isOpen?: boolean | undefined;
63
- form?: "default" | "round" | "brick" | undefined;
63
+ form?: "default" | "brick" | "round" | undefined;
64
64
  isMobile?: boolean | undefined;
65
65
  } & import("./types").MappersItem<ITEM> & import("./types").MappersGroup<GROUP> & {
66
66
  anchorRef?: undefined;
67
67
  position: import("../Popover").Position;
68
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "direction" | "offset" | "items" | "groups" | "position" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
68
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "items" | "groups" | "direction" | "offset" | "position" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
69
69
  id: unknown;
70
70
  } ? {} : {
71
71
  getGroupId: ContextMenuPropGetGroupId<GROUP>;
@@ -3,6 +3,7 @@ import { IconComponent } from '@consta/icons/Icon';
3
3
  import { ListPropForm } from "../ListCanary";
4
4
  import { ComponentSize } from "../../hooks/useComponentSize";
5
5
  import { Animate } from "../../mixs/MixPopoverAnimate";
6
+ import { AsAttributes, AsTags } from "../../utils/types/AsTags";
6
7
  import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';
7
8
  import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
8
9
  import { PropsWithHTMLAttributes, PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
@@ -39,8 +40,8 @@ export declare type ContextMenuItemDefault = {
39
40
  disabled?: boolean;
40
41
  groupId?: number;
41
42
  onClick?: ContextMenuPropOnClick<ContextMenuItemDefault>;
42
- as?: keyof JSX.IntrinsicElements;
43
- attributes?: JSX.IntrinsicElements[keyof JSX.IntrinsicElements];
43
+ as?: AsTags;
44
+ attributes?: AsAttributes;
44
45
  };
45
46
  export declare type ContextMenuPropSortGroup = (a: string | number, b: string | number) => number;
46
47
  export declare type ContextMenuPropGetItemLabel<ITEM> = (item: ITEM) => string | number;
@@ -51,8 +52,8 @@ export declare type ContextMenuPropGetItemStatus<ITEM> = (item: ITEM) => Context
51
52
  export declare type ContextMenuPropGetItemKey<ITEM> = (item: ITEM) => string | number | undefined;
52
53
  export declare type ContextMenuPropGetItemOnClick<ITEM> = (item: ITEM) => ContextMenuPropOnClick<ITEM> | undefined;
53
54
  export declare type ContextMenuPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
54
- export declare type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => keyof JSX.IntrinsicElements | undefined;
55
- export declare type ContextMenuPropGetItemAttributes<ITEM> = (item: ITEM) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements] | undefined;
55
+ export declare type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
56
+ export declare type ContextMenuPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
56
57
  export declare type ContextMenuPropGetItemGroupId<ITEM> = (item: ITEM) => number | undefined;
57
58
  export declare type ContextMenuPropGetItemRightIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
58
59
  export declare type ContextMenuPropGetItemLeftIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
@@ -146,12 +147,12 @@ export declare type ContextMenuLevelProps<ITEM = ContextMenuItemDefault, GROUP =
146
147
  animate: Animate;
147
148
  } & Required<MappersItem<ITEM>> & Required<MappersGroup<GROUP>>;
148
149
  export declare type ContextMenuLevelComponent = <ITEM, GROUP>(props: ContextMenuLevelProps<ITEM, GROUP>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
149
- export declare type ContextMenuItemProps<AS extends keyof JSX.IntrinsicElements = 'div'> = PropsWithAsAttributes<Omit<ContextMenuItemDefault, 'onClick' | 'attributes' | 'key'> & {
150
+ export declare type ContextMenuItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<Omit<ContextMenuItemDefault, 'onClick' | 'attributes' | 'key'> & {
150
151
  size?: ContextMenuPropSize;
151
152
  active: boolean;
152
153
  withSubMenu: boolean;
153
154
  }, AS> & React.RefAttributes<HTMLDivElement>;
154
- export declare type ContextMenuItemComponent = <AS extends keyof JSX.IntrinsicElements = 'div'>(props: ContextMenuItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
155
+ export declare type ContextMenuItemComponent = <AS extends AsTags = 'div'>(props: ContextMenuItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
155
156
  export declare type GetLevelsParams<ITEM> = {
156
157
  levels: Level<ITEM>[];
157
158
  items: ITEM[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["defaultListPropForm","listPropForm","contextMenuSizes","contextMenuDefaultSize","contextMenuStatus","contextMenuDefaultStatus","contextMenuForm","defaultContextMenuForm","contextMenuPropSubMenuDirections","contextMenuPropDefaultSubMenuDirection"],"sources":["../../../../../src/components/ContextMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\n\nimport {\n defaultListPropForm,\n ListPropForm,\n listPropForm,\n} from '##/components/ListCanary';\nimport { ComponentSize } from '##/hooks/useComponentSize';\nimport { Animate } from '##/mixs/MixPopoverAnimate';\n\nimport { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';\nimport {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction, PopoverPropOffset, Position } from '../Popover/Popover';\n\nexport const contextMenuSizes = ['m', 'xs', 's', 'l'] as const;\nexport type ContextMenuPropSize = typeof contextMenuSizes[number];\nexport const contextMenuDefaultSize: ContextMenuPropSize = contextMenuSizes[0];\n\nexport const contextMenuStatus = ['alert', 'success', 'warning'] as const;\nexport type ContextMenuStatus = typeof contextMenuStatus[number];\nexport const contextMenuDefaultStatus: ContextMenuStatus = contextMenuStatus[0];\n\nexport const contextMenuForm = listPropForm;\nexport type ContextMenuForm = ListPropForm;\nexport const defaultContextMenuForm = defaultListPropForm;\n\nexport const contextMenuPropSubMenuDirections = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n] as const;\nexport type ContextMenuPropSubMenuDirection =\n typeof contextMenuPropSubMenuDirections[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\nexport type ContextMenuPropOnClick<ITEM> = (params: {\n e: React.MouseEvent<HTMLDivElement>;\n item: ITEM;\n}) => void;\n\nexport type ContextMenuGroupDefault = {\n label?: string;\n id: number;\n};\n\nexport type ContextMenuItemDefault = {\n label: string | number;\n key?: string | number;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n subMenu?: ContextMenuItemDefault[];\n status?: ContextMenuStatus;\n disabled?: boolean;\n groupId?: number;\n onClick?: ContextMenuPropOnClick<ContextMenuItemDefault>;\n as?: keyof JSX.IntrinsicElements;\n attributes?: JSX.IntrinsicElements[keyof JSX.IntrinsicElements];\n};\n\nexport type ContextMenuPropSortGroup = (\n a: string | number,\n b: string | number,\n) => number;\n\nexport type ContextMenuPropGetItemLabel<ITEM> = (item: ITEM) => string | number;\n\nexport type ContextMenuPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemSubMenu<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\n\nexport type ContextMenuPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ContextMenuStatus | undefined;\n\nexport type ContextMenuPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ContextMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => ContextMenuPropOnClick<ITEM> | undefined;\n\nexport type ContextMenuPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type ContextMenuPropGetItemAs<ITEM> = (\n item: ITEM,\n) => keyof JSX.IntrinsicElements | undefined;\n\nexport type ContextMenuPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements] | undefined;\n\nexport type ContextMenuPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => number | undefined;\n\nexport type ContextMenuPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetGroupLabel<GROUP> = (\n group: GROUP,\n) => string | undefined;\nexport type ContextMenuPropGetGroupId<GROUP> = (group: GROUP) => number;\n\ntype PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n position?: never;\n }\n | {\n anchorRef?: never;\n position: Position;\n };\n\nexport type MappersItem<ITEM> = {\n getItemLabel?: ContextMenuPropGetItemLabel<ITEM>;\n getItemRightSide?: ContextMenuPropGetItemRightSide<ITEM>;\n getItemLeftSide?: ContextMenuPropGetItemLeftSide<ITEM>;\n getItemSubMenu?: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemStatus?: ContextMenuPropGetItemStatus<ITEM>;\n getItemDisabled?: ContextMenuPropGetItemDisabled<ITEM>;\n getItemKey?: ContextMenuPropGetItemKey<ITEM>;\n getItemOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n getItemAs?: ContextMenuPropGetItemAs<ITEM>;\n getItemAttributes?: ContextMenuPropGetItemAttributes<ITEM>;\n getItemGroupId?: ContextMenuPropGetItemGroupId<ITEM>;\n getItemLeftIcon?: ContextMenuPropGetItemLeftIcon<ITEM>;\n getItemRightIcon?: ContextMenuPropGetItemRightIcon<ITEM>;\n};\n\nexport type MappersGroup<GROUP> = {\n getGroupLabel?: ContextMenuPropGetGroupLabel<GROUP>;\n getGroupId?: ContextMenuPropGetGroupId<GROUP>;\n};\n\nexport type Level<ITEM> = {\n items: ITEM[];\n activeItem?: string;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n offset?: PopoverPropOffset;\n parent?: ITEM;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n};\n\nexport type AddLevel<ITEM> = (params: {\n level: number;\n items: ITEM[];\n parent?: ITEM;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n activeItem: string;\n}) => void;\n\nexport type ContextMenuProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n groups?: GROUP[];\n sortGroup?: ContextMenuPropSortGroup;\n onItemClick?: ContextMenuPropOnClick<ITEM>;\n possibleDirections?: readonly Direction[];\n subMenuDirection?: ContextMenuPropSubMenuDirection;\n spareDirection?: Direction;\n onSetDirection?: (direction: Direction) => void;\n onClickOutside?: ClickOutsideHandler;\n isOpen?: boolean;\n form?: ContextMenuForm;\n isMobile?: boolean;\n } & MappersItem<ITEM> &\n MappersGroup<GROUP> &\n PositioningProps,\n HTMLDivElement\n> &\n (GROUP extends { id: ContextMenuGroupDefault['id'] | unknown }\n ? {}\n : { getGroupId: ContextMenuPropGetGroupId<GROUP> }) &\n (ITEM extends { label: ContextMenuItemDefault['label'] }\n ? {}\n : { getItemLabel: ContextMenuPropGetItemLabel<ITEM> });\n\nexport type ContextMenuLevelsProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = ContextMenuProps<ITEM, GROUP> & {\n setComponentSize: React.Dispatch<React.SetStateAction<ComponentSize>>;\n disableAnimationBack: () => void;\n enableAnimationBack: () => void;\n};\n\nexport type ContextMenuLevelsComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuLevelsProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ContextMenuComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ContextMenuLevelProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = Omit<\n ContextMenuProps<ITEM, GROUP>,\n | 'subMenuDirection'\n | 'onClickOutside'\n | 'setComponentSize'\n | 'animationBack'\n | 'disableAnimationBack'\n | 'enableAnimationBack'\n | keyof MappersItem<ITEM>\n | keyof MappersGroup<GROUP>\n> & {\n parent?: ITEM;\n levelDepth: number;\n addLevel: AddLevel<ITEM>;\n deleteLevel: (level: number) => void;\n activeItem?: string;\n onSetDirection?: (direction: Direction) => void;\n hoveredParenLevel: number;\n setHoveredParenLevel: (level: number) => void;\n animate: Animate;\n} & Required<MappersItem<ITEM>> &\n Required<MappersGroup<GROUP>>;\n\nexport type ContextMenuLevelComponent = <ITEM, GROUP>(\n props: ContextMenuLevelProps<ITEM, GROUP>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type ContextMenuItemProps<\n AS extends keyof JSX.IntrinsicElements = 'div',\n> = PropsWithAsAttributes<\n Omit<ContextMenuItemDefault, 'onClick' | 'attributes' | 'key'> & {\n size?: ContextMenuPropSize;\n active: boolean;\n withSubMenu: boolean;\n },\n AS\n> &\n React.RefAttributes<HTMLDivElement>;\n\nexport type ContextMenuItemComponent = <\n AS extends keyof JSX.IntrinsicElements = 'div',\n>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type GetLevelsParams<ITEM> = {\n levels: Level<ITEM>[];\n items: ITEM[];\n getItemSubMenu: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemKey: ContextMenuPropGetItemKey<ITEM>;\n};\n\nexport type ContextMenuWrapperProps = PropsWithHTMLAttributes<\n {\n children: React.ReactNode;\n isOpen?: boolean;\n isMobile?: boolean;\n form?: ContextMenuForm;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: readonly Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n className?: string;\n animationBack?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ContextMenuLevelWrapperProps = PropsWithHTMLAttributesAndRef<\n {\n children: React.ReactNode;\n isOpen?: boolean;\n isMobile?: boolean;\n form?: ContextMenuForm;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: readonly Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n classname?: string;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAEA,OACEA,mBADF,CAGEC,YAHF,qBAgBA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE,CAEP,MAAO,IAAME,kBAAiB,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAA1B,CAEP,MAAO,IAAMC,yBAA2C,CAAGD,iBAAiB,CAAC,CAAD,CAArE,CAEP,MAAO,IAAME,gBAAe,CAAGL,YAAxB,CAEP,MAAO,IAAMM,uBAAsB,CAAGP,mBAA/B,CAEP,MAAO,IAAMQ,iCAAgC,CAAG,CAC9C,cAD8C,CAE9C,gBAF8C,CAG9C,aAH8C,CAI9C,eAJ8C,CAAzC,CAQP,MAAO,IAAMC,uCAAuE,CAClFD,gCAAgC,CAAC,CAAD,CAD3B"}
1
+ {"version":3,"file":"types.js","names":["defaultListPropForm","listPropForm","contextMenuSizes","contextMenuDefaultSize","contextMenuStatus","contextMenuDefaultStatus","contextMenuForm","defaultContextMenuForm","contextMenuPropSubMenuDirections","contextMenuPropDefaultSubMenuDirection"],"sources":["../../../../../src/components/ContextMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\n\nimport {\n defaultListPropForm,\n ListPropForm,\n listPropForm,\n} from '##/components/ListCanary';\nimport { ComponentSize } from '##/hooks/useComponentSize';\nimport { Animate } from '##/mixs/MixPopoverAnimate';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\n\nimport { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';\nimport {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction, PopoverPropOffset, Position } from '../Popover/Popover';\n\nexport const contextMenuSizes = ['m', 'xs', 's', 'l'] as const;\nexport type ContextMenuPropSize = typeof contextMenuSizes[number];\nexport const contextMenuDefaultSize: ContextMenuPropSize = contextMenuSizes[0];\n\nexport const contextMenuStatus = ['alert', 'success', 'warning'] as const;\nexport type ContextMenuStatus = typeof contextMenuStatus[number];\nexport const contextMenuDefaultStatus: ContextMenuStatus = contextMenuStatus[0];\n\nexport const contextMenuForm = listPropForm;\nexport type ContextMenuForm = ListPropForm;\nexport const defaultContextMenuForm = defaultListPropForm;\n\nexport const contextMenuPropSubMenuDirections = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n] as const;\nexport type ContextMenuPropSubMenuDirection =\n typeof contextMenuPropSubMenuDirections[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\nexport type ContextMenuPropOnClick<ITEM> = (params: {\n e: React.MouseEvent<HTMLDivElement>;\n item: ITEM;\n}) => void;\n\nexport type ContextMenuGroupDefault = {\n label?: string;\n id: number;\n};\n\nexport type ContextMenuItemDefault = {\n label: string | number;\n key?: string | number;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n subMenu?: ContextMenuItemDefault[];\n status?: ContextMenuStatus;\n disabled?: boolean;\n groupId?: number;\n onClick?: ContextMenuPropOnClick<ContextMenuItemDefault>;\n as?: AsTags;\n attributes?: AsAttributes;\n};\n\nexport type ContextMenuPropSortGroup = (\n a: string | number,\n b: string | number,\n) => number;\n\nexport type ContextMenuPropGetItemLabel<ITEM> = (item: ITEM) => string | number;\n\nexport type ContextMenuPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemSubMenu<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\n\nexport type ContextMenuPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ContextMenuStatus | undefined;\n\nexport type ContextMenuPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ContextMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => ContextMenuPropOnClick<ITEM> | undefined;\n\nexport type ContextMenuPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ContextMenuPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type ContextMenuPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => number | undefined;\n\nexport type ContextMenuPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetGroupLabel<GROUP> = (\n group: GROUP,\n) => string | undefined;\nexport type ContextMenuPropGetGroupId<GROUP> = (group: GROUP) => number;\n\ntype PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n position?: never;\n }\n | {\n anchorRef?: never;\n position: Position;\n };\n\nexport type MappersItem<ITEM> = {\n getItemLabel?: ContextMenuPropGetItemLabel<ITEM>;\n getItemRightSide?: ContextMenuPropGetItemRightSide<ITEM>;\n getItemLeftSide?: ContextMenuPropGetItemLeftSide<ITEM>;\n getItemSubMenu?: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemStatus?: ContextMenuPropGetItemStatus<ITEM>;\n getItemDisabled?: ContextMenuPropGetItemDisabled<ITEM>;\n getItemKey?: ContextMenuPropGetItemKey<ITEM>;\n getItemOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n getItemAs?: ContextMenuPropGetItemAs<ITEM>;\n getItemAttributes?: ContextMenuPropGetItemAttributes<ITEM>;\n getItemGroupId?: ContextMenuPropGetItemGroupId<ITEM>;\n getItemLeftIcon?: ContextMenuPropGetItemLeftIcon<ITEM>;\n getItemRightIcon?: ContextMenuPropGetItemRightIcon<ITEM>;\n};\n\nexport type MappersGroup<GROUP> = {\n getGroupLabel?: ContextMenuPropGetGroupLabel<GROUP>;\n getGroupId?: ContextMenuPropGetGroupId<GROUP>;\n};\n\nexport type Level<ITEM> = {\n items: ITEM[];\n activeItem?: string;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n offset?: PopoverPropOffset;\n parent?: ITEM;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n};\n\nexport type AddLevel<ITEM> = (params: {\n level: number;\n items: ITEM[];\n parent?: ITEM;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n activeItem: string;\n}) => void;\n\nexport type ContextMenuProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n groups?: GROUP[];\n sortGroup?: ContextMenuPropSortGroup;\n onItemClick?: ContextMenuPropOnClick<ITEM>;\n possibleDirections?: readonly Direction[];\n subMenuDirection?: ContextMenuPropSubMenuDirection;\n spareDirection?: Direction;\n onSetDirection?: (direction: Direction) => void;\n onClickOutside?: ClickOutsideHandler;\n isOpen?: boolean;\n form?: ContextMenuForm;\n isMobile?: boolean;\n } & MappersItem<ITEM> &\n MappersGroup<GROUP> &\n PositioningProps,\n HTMLDivElement\n> &\n (GROUP extends { id: ContextMenuGroupDefault['id'] | unknown }\n ? {}\n : { getGroupId: ContextMenuPropGetGroupId<GROUP> }) &\n (ITEM extends { label: ContextMenuItemDefault['label'] }\n ? {}\n : { getItemLabel: ContextMenuPropGetItemLabel<ITEM> });\n\nexport type ContextMenuLevelsProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = ContextMenuProps<ITEM, GROUP> & {\n setComponentSize: React.Dispatch<React.SetStateAction<ComponentSize>>;\n disableAnimationBack: () => void;\n enableAnimationBack: () => void;\n};\n\nexport type ContextMenuLevelsComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuLevelsProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ContextMenuComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ContextMenuLevelProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = Omit<\n ContextMenuProps<ITEM, GROUP>,\n | 'subMenuDirection'\n | 'onClickOutside'\n | 'setComponentSize'\n | 'animationBack'\n | 'disableAnimationBack'\n | 'enableAnimationBack'\n | keyof MappersItem<ITEM>\n | keyof MappersGroup<GROUP>\n> & {\n parent?: ITEM;\n levelDepth: number;\n addLevel: AddLevel<ITEM>;\n deleteLevel: (level: number) => void;\n activeItem?: string;\n onSetDirection?: (direction: Direction) => void;\n hoveredParenLevel: number;\n setHoveredParenLevel: (level: number) => void;\n animate: Animate;\n} & Required<MappersItem<ITEM>> &\n Required<MappersGroup<GROUP>>;\n\nexport type ContextMenuLevelComponent = <ITEM, GROUP>(\n props: ContextMenuLevelProps<ITEM, GROUP>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type ContextMenuItemProps<AS extends AsTags = 'div'> =\n PropsWithAsAttributes<\n Omit<ContextMenuItemDefault, 'onClick' | 'attributes' | 'key'> & {\n size?: ContextMenuPropSize;\n active: boolean;\n withSubMenu: boolean;\n },\n AS\n > &\n React.RefAttributes<HTMLDivElement>;\n\nexport type ContextMenuItemComponent = <AS extends AsTags = 'div'>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type GetLevelsParams<ITEM> = {\n levels: Level<ITEM>[];\n items: ITEM[];\n getItemSubMenu: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemKey: ContextMenuPropGetItemKey<ITEM>;\n};\n\nexport type ContextMenuWrapperProps = PropsWithHTMLAttributes<\n {\n children: React.ReactNode;\n isOpen?: boolean;\n isMobile?: boolean;\n form?: ContextMenuForm;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: readonly Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n className?: string;\n animationBack?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ContextMenuLevelWrapperProps = PropsWithHTMLAttributesAndRef<\n {\n children: React.ReactNode;\n isOpen?: boolean;\n isMobile?: boolean;\n form?: ContextMenuForm;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: readonly Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n classname?: string;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAEA,OACEA,mBADF,CAGEC,YAHF,qBAiBA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE,CAEP,MAAO,IAAME,kBAAiB,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAA1B,CAEP,MAAO,IAAMC,yBAA2C,CAAGD,iBAAiB,CAAC,CAAD,CAArE,CAEP,MAAO,IAAME,gBAAe,CAAGL,YAAxB,CAEP,MAAO,IAAMM,uBAAsB,CAAGP,mBAA/B,CAEP,MAAO,IAAMQ,iCAAgC,CAAG,CAC9C,cAD8C,CAE9C,gBAF8C,CAG9C,aAH8C,CAI9C,eAJ8C,CAAzC,CAQP,MAAO,IAAMC,uCAAuE,CAClFD,gCAAgC,CAAC,CAAD,CAD3B"}
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { AsAttributes, AsTags } from "../../utils/types/AsTags";
2
3
  import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';
3
4
  import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
4
5
  import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
@@ -18,8 +19,8 @@ export declare type ContextMenuPropGetDisable<ITEM> = (item: ITEM) => boolean |
18
19
  export declare type ContextMenuPropGetGroupLabel = (id: string | number | undefined) => string | number | undefined;
19
20
  export declare type ContextMenuPropSortGroup = (a: string | number, b: string | number) => number;
20
21
  export declare type ContextMenuPropGetItemOnClick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
21
- export declare type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => keyof JSX.IntrinsicElements;
22
- export declare type ContextMenuPropGetItemHTMLAttributes<ITEM> = (item: ITEM) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements];
22
+ export declare type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags;
23
+ export declare type ContextMenuPropGetItemHTMLAttributes<ITEM> = (item: ITEM) => AsAttributes;
23
24
  export declare const contextMenuPropSubMenuDirections: readonly ["rightStartUp", "rightStartDown", "leftStartUp", "leftStartDown"];
24
25
  export declare type ContextMenuPropSubMenuDirection = typeof contextMenuPropSubMenuDirections[number];
25
26
  export declare const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection;
@@ -70,7 +71,7 @@ declare type ContextMenuLevelProps<ITEM> = Omit<ContextMenuProps<ITEM> & {
70
71
  hoveredParenLevel: number;
71
72
  setHoveredParenLevel: (level: number) => void;
72
73
  }, 'subMenuDirection' | 'getKey' | 'onClickOutside' | 'isOpen'>;
73
- export declare type ContextMenuItemProps<AS extends keyof JSX.IntrinsicElements = 'div'> = PropsWithAsAttributes<{
74
+ export declare type ContextMenuItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<{
74
75
  label: string | number;
75
76
  rightSide?: React.ReactNode;
76
77
  leftSide?: React.ReactNode;
@@ -87,7 +88,7 @@ export declare type Level<ITEM> = {
87
88
  possibleDirections?: readonly Direction[];
88
89
  offset?: PopoverPropOffset;
89
90
  } & PositioningProps;
90
- export declare type ContextMenuItemComponent = <AS extends keyof JSX.IntrinsicElements = 'div'>(props: ContextMenuItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
91
+ export declare type ContextMenuItemComponent = <AS extends AsTags = 'div'>(props: ContextMenuItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
91
92
  export declare type ContextMenuComponent = <ITEM>(props: ContextMenuProps<ITEM>) => React.ReactElement | null;
92
93
  export declare type ContextMenuLevelType = <ITEM>(props: ContextMenuLevelProps<ITEM>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
93
94
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["contextMenuSizes","contextMenuDefaultSize","contextMenuAccent","contextMenuPropSubMenuDirections","contextMenuPropDefaultSubMenuDirection"],"sources":["../../../../../src/components/ContextMenuDeprecated/helpers.tsx"],"sourcesContent":["import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction, PopoverPropOffset, Position } from '../Popover/Popover';\n\nexport const contextMenuSizes = ['m', 's', 'l'] as const;\nexport type ContextMenuPropSize = typeof contextMenuSizes[number];\nexport const contextMenuDefaultSize: ContextMenuPropSize = contextMenuSizes[0];\n\nexport const contextMenuAccent = ['alert', 'warning', 'success'] as const;\nexport type ContextMenuAccent = typeof contextMenuAccent[number];\n\nexport type ContextMenuPropGetLabel<ITEM> = (item: ITEM) => string | number;\nexport type ContextMenuPropGetSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | null;\nexport type ContextMenuPropGetSubItems<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\nexport type ContextMenuPropGetAccent<ITEM> = (\n item: ITEM,\n) => ContextMenuAccent | undefined;\nexport type ContextMenuPropGetGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type ContextMenuPropGetKey<ITEM> = (item: ITEM) => string | number;\nexport type ContextMenuPropGetDisable<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ContextMenuPropGetGroupLabel = (\n id: string | number | undefined,\n) => string | number | undefined;\nexport type ContextMenuPropSortGroup = (\n a: string | number,\n b: string | number,\n) => number;\nexport type ContextMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\nexport type ContextMenuPropGetItemAs<ITEM> = (\n item: ITEM,\n) => keyof JSX.IntrinsicElements;\nexport type ContextMenuPropGetItemHTMLAttributes<ITEM> = (\n item: ITEM,\n) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements];\n\nexport const contextMenuPropSubMenuDirections = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n] as const;\nexport type ContextMenuPropSubMenuDirection =\n typeof contextMenuPropSubMenuDirections[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\ntype PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n position?: never;\n }\n | {\n anchorRef?: never;\n position: Position;\n };\n\nexport type ContextMenuProps<ITEM> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n getLabel: ContextMenuPropGetLabel<ITEM>;\n getLeftSideBar?: ContextMenuPropGetSide<ITEM>;\n getRightSideBar?: ContextMenuPropGetSide<ITEM>;\n getSubItems?: ContextMenuPropGetSubItems<ITEM>;\n getGroupId?: ContextMenuPropGetGroupId<ITEM>;\n getGroupLabel?: ContextMenuPropGetGroupLabel;\n getAccent?: ContextMenuPropGetAccent<ITEM>;\n size?: ContextMenuPropSize;\n sortGroup?: ContextMenuPropSortGroup;\n getOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n getItemOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n subMenuDirection?: ContextMenuPropSubMenuDirection;\n getKey?: ContextMenuPropGetKey<ITEM>;\n getDisabled?: ContextMenuPropGetDisable<ITEM>;\n offset?: PopoverPropOffset;\n onItemClick?: (props: { e: React.MouseEvent; item: ITEM }) => void;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n getItemAs?: ContextMenuPropGetItemAs<ITEM>;\n getItemHTMLAttributes?: ContextMenuPropGetItemHTMLAttributes<ITEM>;\n onSetDirection?: (direction: Direction) => void;\n } & PositioningProps,\n HTMLDivElement\n>;\n\nexport type AddLevel<ITEM> = (\n level: number,\n items: ITEM[],\n anchorRef: React.RefObject<HTMLElement>,\n activeItem: string,\n) => void;\n\nexport type DeleteLevel = (level: number) => void;\n\ntype ContextMenuLevelProps<ITEM> = Omit<\n ContextMenuProps<ITEM> & {\n level: number;\n addLevel: AddLevel<ITEM>;\n deleteLevel: DeleteLevel;\n activeItem?: string;\n onSetDirection?: (direction: Direction) => void;\n hoveredParenLevel: number;\n setHoveredParenLevel: (level: number) => void;\n },\n 'subMenuDirection' | 'getKey' | 'onClickOutside' | 'isOpen'\n>;\n\nexport type ContextMenuItemProps<\n AS extends keyof JSX.IntrinsicElements = 'div',\n> = PropsWithAsAttributes<\n {\n label: string | number;\n rightSide?: React.ReactNode;\n leftSide?: React.ReactNode;\n size?: ContextMenuPropSize;\n active?: boolean;\n withSubMenu: boolean;\n accent?: ContextMenuAccent;\n disabled?: boolean;\n },\n AS\n> &\n React.RefAttributes<HTMLDivElement>;\n\nexport type Level<ITEM> = {\n items: ITEM[];\n activeItem?: string;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n offset?: PopoverPropOffset;\n} & PositioningProps;\n\nexport type ContextMenuItemComponent = <\n AS extends keyof JSX.IntrinsicElements = 'div',\n>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type ContextMenuComponent = <ITEM>(\n props: ContextMenuProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type ContextMenuLevelType = <ITEM>(\n props: ContextMenuLevelProps<ITEM>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n"],"mappings":"AAKA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE,CAEP,MAAO,IAAME,kBAAiB,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAA1B,CAqCP,MAAO,IAAMC,iCAAgC,CAAG,CAC9C,cAD8C,CAE9C,gBAF8C,CAG9C,aAH8C,CAI9C,eAJ8C,CAAzC,CAQP,MAAO,IAAMC,uCAAuE,CAClFD,gCAAgC,CAAC,CAAD,CAD3B"}
1
+ {"version":3,"file":"helpers.js","names":["contextMenuSizes","contextMenuDefaultSize","contextMenuAccent","contextMenuPropSubMenuDirections","contextMenuPropDefaultSubMenuDirection"],"sources":["../../../../../src/components/ContextMenuDeprecated/helpers.tsx"],"sourcesContent":["import { AsAttributes, AsTags } from '##/utils/types/AsTags';\n\nimport { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction, PopoverPropOffset, Position } from '../Popover/Popover';\n\nexport const contextMenuSizes = ['m', 's', 'l'] as const;\nexport type ContextMenuPropSize = typeof contextMenuSizes[number];\nexport const contextMenuDefaultSize: ContextMenuPropSize = contextMenuSizes[0];\n\nexport const contextMenuAccent = ['alert', 'warning', 'success'] as const;\nexport type ContextMenuAccent = typeof contextMenuAccent[number];\n\nexport type ContextMenuPropGetLabel<ITEM> = (item: ITEM) => string | number;\nexport type ContextMenuPropGetSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | null;\nexport type ContextMenuPropGetSubItems<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\nexport type ContextMenuPropGetAccent<ITEM> = (\n item: ITEM,\n) => ContextMenuAccent | undefined;\nexport type ContextMenuPropGetGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type ContextMenuPropGetKey<ITEM> = (item: ITEM) => string | number;\nexport type ContextMenuPropGetDisable<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ContextMenuPropGetGroupLabel = (\n id: string | number | undefined,\n) => string | number | undefined;\nexport type ContextMenuPropSortGroup = (\n a: string | number,\n b: string | number,\n) => number;\nexport type ContextMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\nexport type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags;\nexport type ContextMenuPropGetItemHTMLAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes;\n\nexport const contextMenuPropSubMenuDirections = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n] as const;\nexport type ContextMenuPropSubMenuDirection =\n typeof contextMenuPropSubMenuDirections[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\ntype PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n position?: never;\n }\n | {\n anchorRef?: never;\n position: Position;\n };\n\nexport type ContextMenuProps<ITEM> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n getLabel: ContextMenuPropGetLabel<ITEM>;\n getLeftSideBar?: ContextMenuPropGetSide<ITEM>;\n getRightSideBar?: ContextMenuPropGetSide<ITEM>;\n getSubItems?: ContextMenuPropGetSubItems<ITEM>;\n getGroupId?: ContextMenuPropGetGroupId<ITEM>;\n getGroupLabel?: ContextMenuPropGetGroupLabel;\n getAccent?: ContextMenuPropGetAccent<ITEM>;\n size?: ContextMenuPropSize;\n sortGroup?: ContextMenuPropSortGroup;\n getOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n getItemOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n subMenuDirection?: ContextMenuPropSubMenuDirection;\n getKey?: ContextMenuPropGetKey<ITEM>;\n getDisabled?: ContextMenuPropGetDisable<ITEM>;\n offset?: PopoverPropOffset;\n onItemClick?: (props: { e: React.MouseEvent; item: ITEM }) => void;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n getItemAs?: ContextMenuPropGetItemAs<ITEM>;\n getItemHTMLAttributes?: ContextMenuPropGetItemHTMLAttributes<ITEM>;\n onSetDirection?: (direction: Direction) => void;\n } & PositioningProps,\n HTMLDivElement\n>;\n\nexport type AddLevel<ITEM> = (\n level: number,\n items: ITEM[],\n anchorRef: React.RefObject<HTMLElement>,\n activeItem: string,\n) => void;\n\nexport type DeleteLevel = (level: number) => void;\n\ntype ContextMenuLevelProps<ITEM> = Omit<\n ContextMenuProps<ITEM> & {\n level: number;\n addLevel: AddLevel<ITEM>;\n deleteLevel: DeleteLevel;\n activeItem?: string;\n onSetDirection?: (direction: Direction) => void;\n hoveredParenLevel: number;\n setHoveredParenLevel: (level: number) => void;\n },\n 'subMenuDirection' | 'getKey' | 'onClickOutside' | 'isOpen'\n>;\n\nexport type ContextMenuItemProps<AS extends AsTags = 'div'> =\n PropsWithAsAttributes<\n {\n label: string | number;\n rightSide?: React.ReactNode;\n leftSide?: React.ReactNode;\n size?: ContextMenuPropSize;\n active?: boolean;\n withSubMenu: boolean;\n accent?: ContextMenuAccent;\n disabled?: boolean;\n },\n AS\n > &\n React.RefAttributes<HTMLDivElement>;\n\nexport type Level<ITEM> = {\n items: ITEM[];\n activeItem?: string;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n offset?: PopoverPropOffset;\n} & PositioningProps;\n\nexport type ContextMenuItemComponent = <AS extends AsTags = 'div'>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type ContextMenuComponent = <ITEM>(\n props: ContextMenuProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type ContextMenuLevelType = <ITEM>(\n props: ContextMenuLevelProps<ITEM>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n"],"mappings":"AAOA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE,CAEP,MAAO,IAAME,kBAAiB,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAA1B,CAmCP,MAAO,IAAMC,iCAAgC,CAAG,CAC9C,cAD8C,CAE9C,gBAF8C,CAG9C,aAH8C,CAI9C,eAJ8C,CAAzC,CAQP,MAAO,IAAMC,uCAAuE,CAClFD,gCAAgC,CAAC,CAAD,CAD3B"}
@@ -12,7 +12,7 @@ export declare const DatePickerFieldTypeDate: React.ForwardRefExoticComponent<{
12
12
  disabled?: boolean | undefined;
13
13
  size?: "m" | "s" | "xs" | "l" | undefined;
14
14
  view?: "default" | "clear" | undefined;
15
- form?: "default" | "round" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
15
+ form?: "default" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "round" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
16
16
  status?: "alert" | "warning" | "success" | undefined;
17
17
  width?: "default" | "full" | undefined;
18
18
  onFocus?: React.FocusEventHandler<HTMLElement> | undefined;
@@ -38,4 +38,4 @@ export declare const DatePickerFieldTypeDate: React.ForwardRefExoticComponent<{
38
38
  caption?: string | undefined;
39
39
  labelPosition?: "left" | "top" | undefined;
40
40
  withClearButton?: boolean | undefined;
41
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "format" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate"> & React.RefAttributes<HTMLDivElement>>;
41
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "format" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate"> & React.RefAttributes<HTMLDivElement>>;
@@ -12,7 +12,7 @@ export declare const DatePickerFieldTypeDateTime: React.ForwardRefExoticComponen
12
12
  disabled?: boolean | undefined;
13
13
  size?: "m" | "s" | "xs" | "l" | undefined;
14
14
  view?: "default" | "clear" | undefined;
15
- form?: "default" | "round" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
15
+ form?: "default" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "round" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
16
16
  status?: "alert" | "warning" | "success" | undefined;
17
17
  width?: "default" | "full" | undefined;
18
18
  onFocus?: React.FocusEventHandler<HTMLElement> | undefined;
@@ -41,4 +41,4 @@ export declare const DatePickerFieldTypeDateTime: React.ForwardRefExoticComponen
41
41
  caption?: string | undefined;
42
42
  labelPosition?: "left" | "top" | undefined;
43
43
  withClearButton?: boolean | undefined;
44
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "format" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate" | "multiplicitySeconds" | "multiplicityMinutes" | "multiplicityHours"> & React.RefAttributes<HTMLDivElement>>;
44
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "format" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate" | "multiplicitySeconds" | "multiplicityMinutes" | "multiplicityHours"> & React.RefAttributes<HTMLDivElement>>;
@@ -12,7 +12,7 @@ export declare const DatePickerFieldTypeMonth: React.ForwardRefExoticComponent<{
12
12
  disabled?: boolean | undefined;
13
13
  size?: "m" | "s" | "xs" | "l" | undefined;
14
14
  view?: "default" | "clear" | undefined;
15
- form?: "default" | "round" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
15
+ form?: "default" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "round" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
16
16
  status?: "alert" | "warning" | "success" | undefined;
17
17
  width?: "default" | "full" | undefined;
18
18
  onFocus?: React.FocusEventHandler<HTMLElement> | undefined;
@@ -38,4 +38,4 @@ export declare const DatePickerFieldTypeMonth: React.ForwardRefExoticComponent<{
38
38
  caption?: string | undefined;
39
39
  labelPosition?: "left" | "top" | undefined;
40
40
  withClearButton?: boolean | undefined;
41
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "format" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate"> & React.RefAttributes<HTMLDivElement>>;
41
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "format" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate"> & React.RefAttributes<HTMLDivElement>>;
@@ -12,7 +12,7 @@ export declare const DatePickerFieldTypeTime: React.ForwardRefExoticComponent<{
12
12
  disabled?: boolean | undefined;
13
13
  size?: "m" | "s" | "xs" | "l" | undefined;
14
14
  view?: "default" | "clear" | undefined;
15
- form?: "default" | "round" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
15
+ form?: "default" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "round" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
16
16
  status?: "alert" | "warning" | "success" | undefined;
17
17
  width?: "default" | "full" | undefined;
18
18
  onFocus?: React.FocusEventHandler<HTMLElement> | undefined;
@@ -41,4 +41,4 @@ export declare const DatePickerFieldTypeTime: React.ForwardRefExoticComponent<{
41
41
  caption?: string | undefined;
42
42
  labelPosition?: "left" | "top" | undefined;
43
43
  withClearButton?: boolean | undefined;
44
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "format" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate" | "multiplicitySeconds" | "multiplicityMinutes" | "multiplicityHours"> & React.RefAttributes<HTMLDivElement>>;
44
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "format" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate" | "multiplicitySeconds" | "multiplicityMinutes" | "multiplicityHours"> & React.RefAttributes<HTMLDivElement>>;
@@ -12,7 +12,7 @@ export declare const DatePickerFieldTypeYear: React.ForwardRefExoticComponent<{
12
12
  disabled?: boolean | undefined;
13
13
  size?: "m" | "s" | "xs" | "l" | undefined;
14
14
  view?: "default" | "clear" | undefined;
15
- form?: "default" | "round" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
15
+ form?: "default" | "defaultClear" | "defaultBrick" | "brick" | "brickDefault" | "brickClear" | "brickRound" | "round" | "roundClear" | "roundBrick" | "clearRound" | "clearDefault" | "clearBrick" | "clearClear" | undefined;
16
16
  status?: "alert" | "warning" | "success" | undefined;
17
17
  width?: "default" | "full" | undefined;
18
18
  onFocus?: React.FocusEventHandler<HTMLElement> | undefined;
@@ -38,4 +38,4 @@ export declare const DatePickerFieldTypeYear: React.ForwardRefExoticComponent<{
38
38
  caption?: string | undefined;
39
39
  labelPosition?: "left" | "top" | undefined;
40
40
  withClearButton?: boolean | undefined;
41
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "format" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate"> & React.RefAttributes<HTMLDivElement>>;
41
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "className" | "id" | "placeholder" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "onError" | "size" | "caption" | "form" | "label" | "view" | "separator" | "status" | "name" | "width" | "autoFocus" | "disabled" | "value" | "readOnly" | "required" | "inputRef" | "focused" | "ariaLabel" | "labelIcon" | "labelPosition" | "format" | "leftSide" | "rightSide" | "withClearButton" | "iconSize" | "minDate" | "maxDate"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,9 +1,10 @@
1
1
  import './FileField.css';
2
2
  import React from 'react';
3
+ import { AsTags } from "../../utils/types/AsTags";
3
4
  import { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes';
4
5
  declare type ComponentProps = {
5
6
  role: string;
6
- as: keyof JSX.IntrinsicElements;
7
+ as: AsTags;
7
8
  };
8
9
  declare type RenderFn = (props: ComponentProps) => React.ReactNode;
9
10
  export declare type FileFieldProps = PropsWithJsxAttributes<{
@@ -1 +1 @@
1
- {"version":3,"file":"FileField.js","names":["React","useRef","useForkRef","cnMixVisuallyHidden","cn","usePropsHandler","COMPONENT_NAME","isRenderFn","fn","call","cnFileField","FileField","props","fileFieldRef","className","children","id","inputRef","ariaLabel","inputProps","content","role","as"],"sources":["../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import './FileField.css';\n\nimport React, { useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixVisuallyHidden } from '../../mixs/MixVisuallyHidden/MixVisuallyHidden';\nimport { cn } from '../../utils/bem';\nimport { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\ntype ComponentProps = { role: string; as: keyof JSX.IntrinsicElements };\n\ntype RenderFn = (props: ComponentProps) => React.ReactNode;\n\nexport type FileFieldProps = PropsWithJsxAttributes<\n {\n id: string;\n onChange?: (e: DragEvent | React.ChangeEvent) => void;\n children?: RenderFn | React.ReactNode;\n inputRef?: React.Ref<HTMLInputElement>;\n },\n 'input'\n>;\n\nexport const COMPONENT_NAME = 'FileField' as const;\n\nfunction isRenderFn(fn: RenderFn | React.ReactNode): fn is RenderFn {\n return (fn as RenderFn).call !== undefined;\n}\n\nexport const cnFileField = cn('FileField');\n\nexport const FileField: React.FC<FileFieldProps> = (props) => {\n const fileFieldRef = useRef<HTMLInputElement>(null);\n\n const {\n className,\n children,\n id,\n inputRef,\n 'aria-label': ariaLabel = 'File input',\n ...inputProps\n } = usePropsHandler(COMPONENT_NAME, props, fileFieldRef);\n\n const content = isRenderFn(children)\n ? children({ role: 'button', as: 'span' })\n : children;\n\n return (\n <label htmlFor={id} className={cnFileField(null, [className])}>\n <input\n {...inputProps}\n className={cnFileField('Input', [cnMixVisuallyHidden()])}\n id={id}\n type=\"file\"\n aria-label={ariaLabel}\n ref={useForkRef([inputRef, fileFieldRef])}\n />\n {content}\n </label>\n );\n};\n"],"mappings":"yJAAA,wBAEA,MAAOA,MAAP,EAAgBC,MAAhB,KAA8B,OAA9B,CAEA,OAASC,UAAT,yCACA,OAASC,mBAAT,sDACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAgBA,MAAO,IAAMC,eAAc,CAAG,WAAvB,CAEP,QAASC,WAAT,CAAoBC,CAApB,CAAoE,CAClE,MAAQA,EAAD,CAAiBC,IAAjB,SACR,CAED,MAAO,IAAMC,YAAW,CAAGN,EAAE,CAAC,WAAD,CAAtB,CAEP,MAAO,IAAMO,UAAmC,CAAG,SAACC,CAAD,CAAW,IACtDC,EAAY,CAAGZ,MAAM,CAAmB,IAAnB,CADiC,GAUxDI,eAAe,CAACC,cAAD,CAAiBM,CAAjB,CAAwBC,CAAxB,CAVyC,CAI1DC,CAJ0D,GAI1DA,SAJ0D,CAK1DC,CAL0D,GAK1DA,QAL0D,CAM1DC,CAN0D,GAM1DA,EAN0D,CAO1DC,CAP0D,GAO1DA,QAP0D,KAQ1D,YAR0D,EAQ5CC,CAR4C,YAQhC,YARgC,GASvDC,CATuD,uCAYtDC,CAAO,CAAGb,UAAU,CAACQ,CAAD,CAAV,CACZA,CAAQ,CAAC,CAAEM,IAAI,CAAE,QAAR,CAAkBC,EAAE,CAAE,MAAtB,CAAD,CADI,CAEZP,CAdwD,CAgB5D,MACE,8BAAO,OAAO,CAAEC,CAAhB,CAAoB,SAAS,CAAEN,WAAW,CAAC,IAAD,CAAO,CAACI,CAAD,CAAP,CAA1C,EACE,6CACMK,CADN,EAEE,SAAS,CAAET,WAAW,CAAC,OAAD,CAAU,CAACP,mBAAmB,EAApB,CAAV,CAFxB,CAGE,EAAE,CAAEa,CAHN,CAIE,IAAI,CAAC,MAJP,CAKE,aAAYE,CALd,CAME,GAAG,CAAEhB,UAAU,CAAC,CAACe,CAAD,CAAWJ,CAAX,CAAD,CANjB,GADF,CASGO,CATH,CAYH,CA7BM"}
1
+ {"version":3,"file":"FileField.js","names":["React","useRef","useForkRef","cnMixVisuallyHidden","cn","usePropsHandler","COMPONENT_NAME","isRenderFn","fn","call","cnFileField","FileField","props","fileFieldRef","className","children","id","inputRef","ariaLabel","inputProps","content","role","as"],"sources":["../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import './FileField.css';\n\nimport React, { useRef } from 'react';\n\nimport { AsTags } from '##/utils/types/AsTags';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixVisuallyHidden } from '../../mixs/MixVisuallyHidden/MixVisuallyHidden';\nimport { cn } from '../../utils/bem';\nimport { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\ntype ComponentProps = { role: string; as: AsTags };\n\ntype RenderFn = (props: ComponentProps) => React.ReactNode;\n\nexport type FileFieldProps = PropsWithJsxAttributes<\n {\n id: string;\n onChange?: (e: DragEvent | React.ChangeEvent) => void;\n children?: RenderFn | React.ReactNode;\n inputRef?: React.Ref<HTMLInputElement>;\n },\n 'input'\n>;\n\nexport const COMPONENT_NAME = 'FileField' as const;\n\nfunction isRenderFn(fn: RenderFn | React.ReactNode): fn is RenderFn {\n return (fn as RenderFn).call !== undefined;\n}\n\nexport const cnFileField = cn('FileField');\n\nexport const FileField: React.FC<FileFieldProps> = (props) => {\n const fileFieldRef = useRef<HTMLInputElement>(null);\n\n const {\n className,\n children,\n id,\n inputRef,\n 'aria-label': ariaLabel = 'File input',\n ...inputProps\n } = usePropsHandler(COMPONENT_NAME, props, fileFieldRef);\n\n const content = isRenderFn(children)\n ? children({ role: 'button', as: 'span' })\n : children;\n\n return (\n <label htmlFor={id} className={cnFileField(null, [className])}>\n <input\n {...inputProps}\n className={cnFileField('Input', [cnMixVisuallyHidden()])}\n id={id}\n type=\"file\"\n aria-label={ariaLabel}\n ref={useForkRef([inputRef, fileFieldRef])}\n />\n {content}\n </label>\n );\n};\n"],"mappings":"yJAAA,wBAEA,MAAOA,MAAP,EAAgBC,MAAhB,KAA8B,OAA9B,CAIA,OAASC,UAAT,yCACA,OAASC,mBAAT,sDACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAgBA,MAAO,IAAMC,eAAc,CAAG,WAAvB,CAEP,QAASC,WAAT,CAAoBC,CAApB,CAAoE,CAClE,MAAQA,EAAD,CAAiBC,IAAjB,SACR,CAED,MAAO,IAAMC,YAAW,CAAGN,EAAE,CAAC,WAAD,CAAtB,CAEP,MAAO,IAAMO,UAAmC,CAAG,SAACC,CAAD,CAAW,IACtDC,EAAY,CAAGZ,MAAM,CAAmB,IAAnB,CADiC,GAUxDI,eAAe,CAACC,cAAD,CAAiBM,CAAjB,CAAwBC,CAAxB,CAVyC,CAI1DC,CAJ0D,GAI1DA,SAJ0D,CAK1DC,CAL0D,GAK1DA,QAL0D,CAM1DC,CAN0D,GAM1DA,EAN0D,CAO1DC,CAP0D,GAO1DA,QAP0D,KAQ1D,YAR0D,EAQ5CC,CAR4C,YAQhC,YARgC,GASvDC,CATuD,uCAYtDC,CAAO,CAAGb,UAAU,CAACQ,CAAD,CAAV,CACZA,CAAQ,CAAC,CAAEM,IAAI,CAAE,QAAR,CAAkBC,EAAE,CAAE,MAAtB,CAAD,CADI,CAEZP,CAdwD,CAgB5D,MACE,8BAAO,OAAO,CAAEC,CAAhB,CAAoB,SAAS,CAAEN,WAAW,CAAC,IAAD,CAAO,CAACI,CAAD,CAAP,CAA1C,EACE,6CACMK,CADN,EAEE,SAAS,CAAET,WAAW,CAAC,OAAD,CAAU,CAACP,mBAAmB,EAApB,CAAV,CAFxB,CAGE,EAAE,CAAEa,CAHN,CAIE,IAAI,CAAC,MAJP,CAKE,aAAYE,CALd,CAME,GAAG,CAAEhB,UAAU,CAAC,CAACe,CAAD,CAAWJ,CAAX,CAAD,CANjB,GADF,CASGO,CATH,CAYH,CA7BM"}
@@ -1,6 +1,7 @@
1
1
  import './HeaderLogo.css';
2
2
  import React from 'react';
3
+ import { AsTags } from "../../../utils/types/AsTags";
3
4
  import { PropsWithAsAttributes } from '../../../utils/types/PropsWithAsAttributes';
4
5
  export declare const cnHeaderLogo: import("@bem-react/classname").ClassNameFormatter;
5
- export declare type HeaderProps<As extends keyof JSX.IntrinsicElements> = PropsWithAsAttributes<{}, As>;
6
- export declare const HeaderLogo: <As extends keyof JSX.IntrinsicElements = "div">(props: HeaderProps<As>) => React.ReactElement;
6
+ export declare type HeaderProps<As extends AsTags> = PropsWithAsAttributes<{}, As>;
7
+ export declare const HeaderLogo: <As extends AsTags = "div">(props: HeaderProps<As>) => React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderLogo.js","names":["React","cn","cnHeaderLogo","HeaderLogo","props","children","as","className","otherProps"],"sources":["../../../../../../src/components/Header/Logo/HeaderLogo.tsx"],"sourcesContent":["import './HeaderLogo.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { PropsWithAsAttributes } from '../../../utils/types/PropsWithAsAttributes';\n\nexport const cnHeaderLogo = cn('HeaderLogo');\n\nexport type HeaderProps<As extends keyof JSX.IntrinsicElements> =\n PropsWithAsAttributes<{}, As>;\n\nexport const HeaderLogo = <As extends keyof JSX.IntrinsicElements = 'div'>(\n props: HeaderProps<As>,\n): React.ReactElement => {\n const { children, as = 'div', className, ...otherProps } = props;\n const Tag = as as string;\n return (\n <Tag className={cnHeaderLogo(null, [className])} {...otherProps}>\n {children}\n </Tag>\n );\n};\n"],"mappings":"iIAAA,yBAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAGA,MAAO,IAAMC,aAAY,CAAGD,EAAE,CAAC,YAAD,CAAvB,CAKP,MAAO,IAAME,WAAU,CAAG,SACxBC,CADwB,CAED,IACfC,EADe,CACoCD,CADpC,CACfC,QADe,GACoCD,CADpC,CACLE,EADK,CACLA,CADK,YACA,KADA,GACOC,CADP,CACoCH,CADpC,CACOG,SADP,CACqBC,CADrB,0BACoCJ,CADpC,YAGvB,MACE,qBAFUE,CAEV,gBAAK,SAAS,CAAEJ,YAAY,CAAC,IAAD,CAAO,CAACK,CAAD,CAAP,CAA5B,EAAqDC,CAArD,EACGH,CADH,CAIH,CAVM"}
1
+ {"version":3,"file":"HeaderLogo.js","names":["React","cn","cnHeaderLogo","HeaderLogo","props","children","as","className","otherProps"],"sources":["../../../../../../src/components/Header/Logo/HeaderLogo.tsx"],"sourcesContent":["import './HeaderLogo.css';\n\nimport React from 'react';\n\nimport { AsTags } from '##/utils/types/AsTags';\n\nimport { cn } from '../../../utils/bem';\nimport { PropsWithAsAttributes } from '../../../utils/types/PropsWithAsAttributes';\n\nexport const cnHeaderLogo = cn('HeaderLogo');\n\nexport type HeaderProps<As extends AsTags> = PropsWithAsAttributes<{}, As>;\n\nexport const HeaderLogo = <As extends AsTags = 'div'>(\n props: HeaderProps<As>,\n): React.ReactElement => {\n const { children, as = 'div', className, ...otherProps } = props;\n const Tag = as as string;\n return (\n <Tag className={cnHeaderLogo(null, [className])} {...otherProps}>\n {children}\n </Tag>\n );\n};\n"],"mappings":"iIAAA,yBAEA,MAAOA,MAAP,KAAkB,OAAlB,CAIA,OAASC,EAAT,0BAGA,MAAO,IAAMC,aAAY,CAAGD,EAAE,CAAC,YAAD,CAAvB,CAIP,MAAO,IAAME,WAAU,CAAG,SACxBC,CADwB,CAED,IACfC,EADe,CACoCD,CADpC,CACfC,QADe,GACoCD,CADpC,CACLE,EADK,CACLA,CADK,YACA,KADA,GACOC,CADP,CACoCH,CADpC,CACOG,SADP,CACqBC,CADrB,0BACoCJ,CADpC,YAGvB,MACE,qBAFUE,CAEV,gBAAK,SAAS,CAAEJ,YAAY,CAAC,IAAD,CAAO,CAACK,CAAD,CAAP,CAA5B,EAAqDC,CAArD,EACGH,CADH,CAIH,CAVM"}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","active","label","innerOffset","disabled","className","leftSide","rightSide","rightIcon","leftIcon","as","checked","onClick","status","space","iconSize"];import"./ListItem.css";import React,{forwardRef}from"react";import{Text}from"../../Text";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{cnListItemGrid,renderSlot}from"../ListItemGrid";import{mapHorisontalSpase,mapHorisontalSpaseIncreased,mapItemVerticalPadding}from"../maps";import{defaultListPropSize}from"../types";export var cnListItem=cn("ListItem");var ListItemRender=function(a,b){var c=a.size,d=void 0===c?defaultListPropSize:c,e=a.active,f=a.label,g=a.innerOffset,h=a.disabled,i=a.className,j=a.leftSide,k=a.rightSide,l=a.rightIcon,m=a.leftIcon,n=a.as,o=a.checked,p=a.onClick,q=a.status,r=a.space,s=a.iconSize,t=_objectWithoutProperties(a,_excluded),u=p&&!h?p:void 0;return React.createElement(Text,Object.assign({},t,{className:cnListItem({active:e,disabled:h,checked:o,interactive:!!u},[cnMixSpace(r||{pH:"increased"===g?mapHorisontalSpaseIncreased[d]:mapHorisontalSpase[d],pV:mapItemVerticalPadding[d]}),cnListItemGrid(),i]),as:n,onClick:u,lineHeight:"xs",size:d,ref:b,view:q}),renderSlot(j,"left",d,m,s),l||k||j||m?f&&React.createElement("span",{className:cnListItemGrid("Slot",{position:"center"})},f):f,renderSlot(k,"right",d,l,s))};export var ListItem=forwardRef(ListItemRender);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","active","label","innerOffset","disabled","className","leftSide","rightSide","rightIcon","leftIcon","as","checked","onClick","status","space","iconSize"];import"./ListItem.css";import React,{forwardRef}from"react";import{cnText}from"../../Text";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{cnListItemGrid,renderSlot}from"../ListItemGrid";import{mapHorisontalSpase,mapHorisontalSpaseIncreased,mapItemVerticalPadding}from"../maps";import{defaultListPropSize}from"../types";export var cnListItem=cn("ListItem");var ListItemRender=function(a,b){var c=a.size,d=void 0===c?defaultListPropSize:c,e=a.active,f=a.label,g=a.innerOffset,h=a.disabled,i=a.className,j=a.leftSide,k=a.rightSide,l=a.rightIcon,m=a.leftIcon,n=a.as,o=void 0===n?"div":n,p=a.checked,q=a.onClick,r=a.status,s=a.space,t=a.iconSize,u=_objectWithoutProperties(a,_excluded),v=q&&!h?q:void 0;return React.createElement(o,Object.assign({},u,{className:cnListItem({active:e,disabled:h,checked:p,interactive:!!v},[cnText({lineHeight:"xs",size:d,view:r}),cnMixSpace(s||{pH:"increased"===g?mapHorisontalSpaseIncreased[d]:mapHorisontalSpase[d],pV:mapItemVerticalPadding[d]}),cnListItemGrid(),i]),onClick:v,ref:b}),renderSlot(j,"left",d,m,t),l||k||j||m?f&&React.createElement("span",{className:cnListItemGrid("Slot",{position:"center"})},f):f,renderSlot(k,"right",d,l,t))};export var ListItem=forwardRef(ListItemRender);
2
2
  //# sourceMappingURL=ListItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.js","names":["React","forwardRef","Text","cnMixSpace","cn","cnListItemGrid","renderSlot","mapHorisontalSpase","mapHorisontalSpaseIncreased","mapItemVerticalPadding","defaultListPropSize","cnListItem","ListItemRender","props","ref","size","active","label","innerOffset","disabled","className","leftSide","rightSide","rightIcon","leftIcon","as","checked","onClick","status","space","iconSize","otherProps","handleClick","interactive","pH","pV","position","ListItem"],"sources":["../../../../../../src/components/ListCanary/ListItem/ListItem.tsx"],"sourcesContent":["import './ListItem.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { Text } from '##/components/Text';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\nimport { cnListItemGrid, renderSlot } from '../ListItemGrid';\nimport {\n mapHorisontalSpase,\n mapHorisontalSpaseIncreased,\n mapItemVerticalPadding,\n} from '../maps';\nimport {\n defaultListPropSize,\n ListItemComponent,\n ListItemProps,\n} from '../types';\n\nexport const cnListItem = cn('ListItem');\n\nconst ListItemRender = (\n props: ListItemProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = defaultListPropSize,\n active,\n label,\n innerOffset,\n disabled,\n className,\n leftSide,\n rightSide,\n rightIcon,\n leftIcon,\n as,\n checked,\n onClick,\n status,\n space,\n iconSize,\n ...otherProps\n } = props;\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> | undefined =\n onClick && !disabled ? onClick : undefined;\n\n return (\n <Text\n {...otherProps}\n className={cnListItem(\n { active, disabled, checked, interactive: !!handleClick },\n [\n cnMixSpace(\n space || {\n pH:\n innerOffset === 'increased'\n ? mapHorisontalSpaseIncreased[size]\n : mapHorisontalSpase[size],\n pV: mapItemVerticalPadding[size],\n },\n ),\n cnListItemGrid(),\n className,\n ],\n )}\n as={as}\n onClick={handleClick}\n lineHeight=\"xs\"\n size={size}\n ref={ref}\n view={status}\n >\n {renderSlot(leftSide, 'left', size, leftIcon, iconSize)}\n {!rightIcon && !rightSide && !leftSide && !leftIcon\n ? label\n : label && (\n <span className={cnListItemGrid('Slot', { position: 'center' })}>\n {label}\n </span>\n )}\n {renderSlot(rightSide, 'right', size, rightIcon, iconSize)}\n </Text>\n );\n};\n\nexport const ListItem = forwardRef(ListItemRender) as ListItemComponent;\n"],"mappings":"qQAAA,uBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,IAAT,kBACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAEA,OAASC,cAAT,CAAyBC,UAAzB,uBACA,OACEC,kBADF,CAEEC,2BAFF,CAGEC,sBAHF,eAKA,OACEC,mBADF,gBAMA,MAAO,IAAMC,WAAU,CAAGP,EAAE,CAAC,UAAD,CAArB,CAEP,GAAMQ,eAAc,CAAG,SACrBC,CADqB,CAErBC,CAFqB,CAGlB,OAmBCD,CAnBD,CAEDE,IAFC,CAEDA,CAFC,YAEML,mBAFN,GAGDM,CAHC,CAmBCH,CAnBD,CAGDG,MAHC,CAIDC,CAJC,CAmBCJ,CAnBD,CAIDI,KAJC,CAKDC,CALC,CAmBCL,CAnBD,CAKDK,WALC,CAMDC,CANC,CAmBCN,CAnBD,CAMDM,QANC,CAODC,CAPC,CAmBCP,CAnBD,CAODO,SAPC,CAQDC,CARC,CAmBCR,CAnBD,CAQDQ,QARC,CASDC,CATC,CAmBCT,CAnBD,CASDS,SATC,CAUDC,CAVC,CA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,SAAS,CAAEZ,cAAc,CAAC,MAAD,CAAS,CAAE+B,QAAQ,CAAE,QAAZ,CAAT,CAA/B,EACGnB,CADH,CAHL,CACGA,CA3BN,CAiCGX,UAAU,CAACgB,CAAD,CAAY,OAAZ,CAAqBP,CAArB,CAA2BQ,CAA3B,CAAsCO,CAAtC,CAjCb,CAoCH,CAhED,CAkEA,MAAO,IAAMO,SAAQ,CAAGpC,UAAU,CAACW,cAAD,CAA3B"}
1
+ {"version":3,"file":"ListItem.js","names":["React","forwardRef","cnText","cnMixSpace","cn","cnListItemGrid","renderSlot","mapHorisontalSpase","mapHorisontalSpaseIncreased","mapItemVerticalPadding","defaultListPropSize","cnListItem","ListItemRender","props","ref","size","active","label","innerOffset","disabled","className","leftSide","rightSide","rightIcon","leftIcon","as","Tag","checked","onClick","status","space","iconSize","otherProps","handleClick","interactive","lineHeight","view","pH","pV","position","ListItem"],"sources":["../../../../../../src/components/ListCanary/ListItem/ListItem.tsx"],"sourcesContent":["import './ListItem.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { cnText } from '##/components/Text';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\nimport { cnListItemGrid, renderSlot } from '../ListItemGrid';\nimport {\n mapHorisontalSpase,\n mapHorisontalSpaseIncreased,\n mapItemVerticalPadding,\n} from '../maps';\nimport {\n defaultListPropSize,\n ListItemComponent,\n ListItemProps,\n} from '../types';\n\nexport const cnListItem = cn('ListItem');\n\nconst ListItemRender = (\n props: ListItemProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = defaultListPropSize,\n active,\n label,\n innerOffset,\n disabled,\n className,\n leftSide,\n rightSide,\n rightIcon,\n leftIcon,\n as: Tag = 'div',\n checked,\n onClick,\n status,\n space,\n iconSize,\n ...otherProps\n } = props;\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> | undefined =\n onClick && !disabled ? onClick : undefined;\n\n return (\n <Tag\n {...otherProps}\n className={cnListItem(\n { active, disabled, checked, interactive: !!handleClick },\n [\n cnText({\n lineHeight: 'xs',\n size,\n view: status,\n }),\n cnMixSpace(\n space || {\n pH:\n innerOffset === 'increased'\n ? mapHorisontalSpaseIncreased[size]\n : mapHorisontalSpase[size],\n pV: mapItemVerticalPadding[size],\n },\n ),\n cnListItemGrid(),\n className,\n ],\n )}\n onClick={handleClick}\n ref={ref}\n >\n {renderSlot(leftSide, 'left', size, leftIcon, iconSize)}\n {!rightIcon && !rightSide && !leftSide && !leftIcon\n ? label\n : label && (\n <span className={cnListItemGrid('Slot', { position: 'center' })}>\n {label}\n </span>\n )}\n {renderSlot(rightSide, 'right', size, rightIcon, iconSize)}\n </Tag>\n );\n};\n\nexport const ListItem = forwardRef(ListItemRender) as ListItemComponent;\n"],"mappings":"qQAAA,uBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,MAAT,kBACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAEA,OAASC,cAAT,CAAyBC,UAAzB,uBACA,OACEC,kBADF,CAEEC,2BAFF,CAGEC,sBAHF,eAKA,OACEC,mBADF,gBAMA,MAAO,IAAMC,WAAU,CAAGP,EAAE,CAAC,UAAD,CAArB,CAEP,GAAMQ,eAAc,CAAG,SACrBC,CADqB,CAErBC,CAFqB,CAGlB,OAmBCD,CAnBD,CAEDE,IAFC,CAEDA,CAFC,YAEML,mBAFN,GAGDM,CAHC,CAmBCH,CAnBD,CAGDG,MAHC,CAIDC,CAJC,CAmBCJ,CAnBD,CAIDI,KAJC,CAKDC,CALC,CAmBCL,CAnBD,CAKDK,WALC,CAMDC,CANC,CAmBCN,CAnBD,CAMDM,QANC,CAODC,CAPC,CAmBCP,CAnBD,CAODO,SAPC,CAQDC,CARC,CAmBCR,CAnBD,CAQDQ,QARC,CASDC,CATC,CAmBCT,CAnBD,CASDS,SATC,CAUDC,CAVC,CAmBCV,CAnBD,CAUDU,SAVC,CAWDC,CAXC,CAmBCX,CAnBD,CAWDW,QA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QAAQ,CAAE,QAAZ,CAAT,CAA/B,EACGtB,CADH,CAHL,CACGA,CA5BN,CAkCGX,UAAU,CAACgB,CAAD,CAAY,OAAZ,CAAqBP,CAArB,CAA2BQ,CAA3B,CAAsCQ,CAAtC,CAlCb,CAqCH,CAjED,CAmEA,MAAO,IAAMS,SAAQ,CAAGvC,UAAU,CAACW,cAAD,CAA3B"}
@@ -2,6 +2,7 @@ import { IconComponent, IconPropSize } from '@consta/icons/Icon';
2
2
  import React from 'react';
3
3
  import { MixSpaceProps } from "../../mixs/MixSpace";
4
4
  import { Group } from "../../utils/getGroups";
5
+ import { AsAttributes, AsTags } from "../../utils/types/AsTags";
5
6
  import { PropsWithAsAttributes } from "../../utils/types/PropsWithAsAttributes";
6
7
  import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
7
8
  export declare const listPropSize: readonly ["m", "xs", "s", "l"];
@@ -49,8 +50,8 @@ export declare type ListPropGetItemLeftSide<ITEM> = (item: ITEM) => React.ReactN
49
50
  export declare type ListPropGetItemLeftIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
50
51
  export declare type ListPropGetItemRightSide<ITEM> = (item: ITEM) => React.ReactNode | undefined;
51
52
  export declare type ListPropGetItemRightIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
52
- export declare type ListPropGetItemAs<ITEM> = (item: ITEM) => keyof JSX.IntrinsicElements | undefined;
53
- export declare type ListPropGetItemAttributes<ITEM> = (item: ITEM) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements] | undefined;
53
+ export declare type ListPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
54
+ export declare type ListPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
54
55
  export declare type ListPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler | undefined;
55
56
  export declare type ListPropSortGroup<ITEM, GROUP> = (a: Group<ITEM, GROUP>, b: Group<ITEM, GROUP>) => number;
56
57
  export declare type ListPropGetGroupKey<GROUP> = (item: GROUP) => string | number;
@@ -99,13 +100,13 @@ export declare type ListProps<ITEM = DefaultListItem, GROUP = DefaultListGroup>
99
100
  getGroupKey: ListPropGetGroupKey<GROUP>;
100
101
  });
101
102
  export declare type ListComponent = <ITEM = DefaultListItem, GROUP = DefaultListGroup>(props: ListProps<ITEM, GROUP>) => React.ReactElement | null;
102
- export declare type ListItemProps<AS extends keyof JSX.IntrinsicElements = 'div'> = PropsWithAsAttributes<Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {
103
+ export declare type ListItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {
103
104
  size?: ListPropSize;
104
105
  innerOffset?: 'normal' | 'increased';
105
106
  space?: MixSpaceProps;
106
107
  iconSize?: IconPropSize;
107
108
  }, AS>;
108
- export declare type ListItemComponent = <AS extends keyof JSX.IntrinsicElements = 'div'>(props: ListItemProps<AS>) => React.ReactElement | null;
109
+ export declare type ListItemComponent = <AS extends AsTags = 'div'>(props: ListItemProps<AS>) => React.ReactElement | null;
109
110
  export declare type ListGroupLabelProps = PropsWithHTMLAttributesAndRef<{
110
111
  size?: ListPropSize;
111
112
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["listPropSize","defaultListPropSize","listPropInnerOffset","defaultListPropInnerOffset","listPropStatus","listPropForm","defaultListPropForm"],"sources":["../../../../../src/components/ListCanary/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { MixSpaceProps } from '##/mixs/MixSpace';\nimport { Group } from '##/utils/getGroups';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const listPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type ListPropSize = typeof listPropSize[number];\nexport const defaultListPropSize = listPropSize[0];\n\nexport const listPropInnerOffset = ['normal', 'increased'] as const;\nexport type ListPropInnerOffset = typeof listPropInnerOffset[number];\nexport const defaultListPropInnerOffset = listPropInnerOffset[0];\n\nexport const listPropStatus = ['alert', 'success', 'warning'] as const;\nexport type ListPropStatus = typeof listPropStatus[number];\n\nexport const listPropForm = ['default', 'brick', 'round'] as const;\nexport type ListPropForm = typeof listPropForm[number];\nexport const defaultListPropForm = listPropForm[0];\n\nexport type DefaultListGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultListItem = {\n label: React.ReactNode;\n disabled?: boolean;\n active?: boolean;\n checked?: boolean;\n status?: ListPropStatus;\n groupId?: string | number;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n onClick?: React.MouseEventHandler;\n};\n\nexport type ListPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n item: ITEM;\n },\n) => void;\n\nexport type ListPropRenderItem<ITEM> = (\n item: ITEM,\n) => React.ReactElement | null;\n\n// ITEMS\n\nexport type ListPropGetItemLabel<ITEM> = (item: ITEM) => React.ReactNode;\n\nexport type ListPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type ListPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemChecked<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ListPropStatus | undefined;\n\nexport type ListPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ListPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemAs<ITEM> = (\n item: ITEM,\n) => keyof JSX.IntrinsicElements | undefined;\n\nexport type ListPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements] | undefined;\n\nexport type ListPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\n\nexport type ListPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type ListPropGetGroupKey<GROUP> = (item: GROUP) => string | number;\nexport type ListPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type ListPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;\nexport type ListPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type ListProps<ITEM = DefaultListItem, GROUP = DefaultListGroup> = {\n size?: ListPropSize;\n items: ITEM[];\n innerOffset?: ListPropInnerOffset;\n itemSpase?: MixSpaceProps;\n groupLabelSpase?: MixSpaceProps;\n dividerSpase?: MixSpaceProps;\n onItemClick?: ListPropOnItemClick<ITEM>;\n getItemLabel?: ListPropGetItemLabel<ITEM>;\n getItemDisabled?: ListPropGetItemDisabled<ITEM>;\n getItemActive?: ListPropGetItemActive<ITEM>;\n getItemChecked?: ListPropGetItemActive<ITEM>;\n getItemLeftSide?: ListPropGetItemLeftSide<ITEM>;\n getItemLeftIcon?: ListPropGetItemLeftIcon<ITEM>;\n getItemRightSide?: ListPropGetItemRightSide<ITEM>;\n getItemRightIcon?: ListPropGetItemRightIcon<ITEM>;\n getItemGroupKey?: ListPropGetItemGroupId<ITEM>;\n getItemOnClick?: ListPropGetItemOnClick<ITEM>;\n getItemStatus?: ListPropGetItemStatus<ITEM>;\n getItemAs?: ListPropGetItemAs<ITEM>;\n getItemAttributes?: ListPropGetItemAttributes<ITEM>;\n getItemRef?: ListPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: ListPropGetItemAdditionalClassName<ITEM>;\n renderItem?: ListPropRenderItem<ITEM>;\n groups?: GROUP[];\n getGroupKey?: ListPropGetGroupKey<GROUP>;\n getGroupLabel?: ListPropGetGroupLabel<GROUP>;\n getGroupRightSide?: ListPropGetGroupRightSide<GROUP>;\n sortGroup?: ListPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: ListPropGetGroupAdditionalClassName<GROUP>;\n disabled?: boolean;\n} & (ITEM extends { label: DefaultListItem['label'] }\n ? {}\n : { getItemLabel: ListPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultListGroup['id'] }\n ? {}\n : { getGroupKey: ListPropGetGroupKey<GROUP> });\n\nexport type ListComponent = <ITEM = DefaultListItem, GROUP = DefaultListGroup>(\n props: ListProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ListItemProps<AS extends keyof JSX.IntrinsicElements = 'div'> =\n PropsWithAsAttributes<\n Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {\n size?: ListPropSize;\n innerOffset?: 'normal' | 'increased';\n space?: MixSpaceProps;\n iconSize?: IconPropSize;\n },\n AS\n >;\n\nexport type ListItemComponent = <\n AS extends keyof JSX.IntrinsicElements = 'div',\n>(\n props: ListItemProps<AS>,\n) => React.ReactElement | null;\n\nexport type ListGroupLabelProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: string;\n innerOffset?: ListPropInnerOffset;\n rightSide?: React.ReactNode;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListDividerProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n innerOffset?: ListPropInnerOffset;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListBoxProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n form?: ListPropForm;\n border?: boolean;\n shadow?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ListAddItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: React.ReactNode;\n innerOffset?: ListPropInnerOffset;\n active?: boolean;\n underLine?: boolean;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAQA,MAAO,IAAMA,aAAY,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,WAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA0B,CAAGD,mBAAmB,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAvB,CAGP,MAAO,IAAMC,aAAY,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC"}
1
+ {"version":3,"file":"types.js","names":["listPropSize","defaultListPropSize","listPropInnerOffset","defaultListPropInnerOffset","listPropStatus","listPropForm","defaultListPropForm"],"sources":["../../../../../src/components/ListCanary/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { MixSpaceProps } from '##/mixs/MixSpace';\nimport { Group } from '##/utils/getGroups';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const listPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type ListPropSize = typeof listPropSize[number];\nexport const defaultListPropSize = listPropSize[0];\n\nexport const listPropInnerOffset = ['normal', 'increased'] as const;\nexport type ListPropInnerOffset = typeof listPropInnerOffset[number];\nexport const defaultListPropInnerOffset = listPropInnerOffset[0];\n\nexport const listPropStatus = ['alert', 'success', 'warning'] as const;\nexport type ListPropStatus = typeof listPropStatus[number];\n\nexport const listPropForm = ['default', 'brick', 'round'] as const;\nexport type ListPropForm = typeof listPropForm[number];\nexport const defaultListPropForm = listPropForm[0];\n\nexport type DefaultListGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultListItem = {\n label: React.ReactNode;\n disabled?: boolean;\n active?: boolean;\n checked?: boolean;\n status?: ListPropStatus;\n groupId?: string | number;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n onClick?: React.MouseEventHandler;\n};\n\nexport type ListPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n item: ITEM;\n },\n) => void;\n\nexport type ListPropRenderItem<ITEM> = (\n item: ITEM,\n) => React.ReactElement | null;\n\n// ITEMS\n\nexport type ListPropGetItemLabel<ITEM> = (item: ITEM) => React.ReactNode;\n\nexport type ListPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type ListPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemChecked<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ListPropStatus | undefined;\n\nexport type ListPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ListPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ListPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type ListPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\n\nexport type ListPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type ListPropGetGroupKey<GROUP> = (item: GROUP) => string | number;\nexport type ListPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type ListPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;\nexport type ListPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type ListProps<ITEM = DefaultListItem, GROUP = DefaultListGroup> = {\n size?: ListPropSize;\n items: ITEM[];\n innerOffset?: ListPropInnerOffset;\n itemSpase?: MixSpaceProps;\n groupLabelSpase?: MixSpaceProps;\n dividerSpase?: MixSpaceProps;\n onItemClick?: ListPropOnItemClick<ITEM>;\n getItemLabel?: ListPropGetItemLabel<ITEM>;\n getItemDisabled?: ListPropGetItemDisabled<ITEM>;\n getItemActive?: ListPropGetItemActive<ITEM>;\n getItemChecked?: ListPropGetItemActive<ITEM>;\n getItemLeftSide?: ListPropGetItemLeftSide<ITEM>;\n getItemLeftIcon?: ListPropGetItemLeftIcon<ITEM>;\n getItemRightSide?: ListPropGetItemRightSide<ITEM>;\n getItemRightIcon?: ListPropGetItemRightIcon<ITEM>;\n getItemGroupKey?: ListPropGetItemGroupId<ITEM>;\n getItemOnClick?: ListPropGetItemOnClick<ITEM>;\n getItemStatus?: ListPropGetItemStatus<ITEM>;\n getItemAs?: ListPropGetItemAs<ITEM>;\n getItemAttributes?: ListPropGetItemAttributes<ITEM>;\n getItemRef?: ListPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: ListPropGetItemAdditionalClassName<ITEM>;\n renderItem?: ListPropRenderItem<ITEM>;\n groups?: GROUP[];\n getGroupKey?: ListPropGetGroupKey<GROUP>;\n getGroupLabel?: ListPropGetGroupLabel<GROUP>;\n getGroupRightSide?: ListPropGetGroupRightSide<GROUP>;\n sortGroup?: ListPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: ListPropGetGroupAdditionalClassName<GROUP>;\n disabled?: boolean;\n} & (ITEM extends { label: DefaultListItem['label'] }\n ? {}\n : { getItemLabel: ListPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultListGroup['id'] }\n ? {}\n : { getGroupKey: ListPropGetGroupKey<GROUP> });\n\nexport type ListComponent = <ITEM = DefaultListItem, GROUP = DefaultListGroup>(\n props: ListProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ListItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<\n Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {\n size?: ListPropSize;\n innerOffset?: 'normal' | 'increased';\n space?: MixSpaceProps;\n iconSize?: IconPropSize;\n },\n AS\n>;\n\nexport type ListItemComponent = <AS extends AsTags = 'div'>(\n props: ListItemProps<AS>,\n) => React.ReactElement | null;\n\nexport type ListGroupLabelProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: string;\n innerOffset?: ListPropInnerOffset;\n rightSide?: React.ReactNode;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListDividerProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n innerOffset?: ListPropInnerOffset;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListBoxProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n form?: ListPropForm;\n border?: boolean;\n shadow?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ListAddItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: React.ReactNode;\n innerOffset?: ListPropInnerOffset;\n active?: boolean;\n underLine?: boolean;\n },\n HTMLDivElement\n>;\n"],"mappings":"AASA,MAAO,IAAMA,aAAY,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,WAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA0B,CAAGD,mBAAmB,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAvB,CAGP,MAAO,IAAMC,aAAY,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC"}