@consta/uikit 3.17.3 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/BreadcrumbsCanary/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +18 -19
- package/Calendar/package.json +1 -1
- package/Card/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/CheckboxGroup/package.json +1 -1
- package/ChoiceGroup/package.json +1 -1
- package/Collapse/package.json +1 -1
- package/CollapseGroup/package.json +1 -1
- package/Combobox/package.json +1 -1
- package/ComboboxDeprecated/package.json +1 -1
- package/ContextMenu/package.json +1 -1
- package/ContextMenuCanary/es.js +1 -0
- package/ContextMenuCanary/index.d.ts +1 -0
- package/ContextMenuCanary/index.js +4 -0
- package/ContextMenuCanary/package.json +9 -0
- package/DatePickerCanary/package.json +1 -1
- package/DateTimeCanary/package.json +1 -1
- package/DragNDropField/package.json +1 -1
- package/EventInterceptor/package.json +1 -1
- package/FieldCaption/package.json +1 -1
- package/FieldLabel/package.json +1 -1
- package/File/package.json +1 -1
- package/FileField/package.json +1 -1
- package/FileIcon/package.json +1 -1
- package/FileIconAvi/package.json +1 -1
- package/FileIconBmp/package.json +1 -1
- package/FileIconCsv/package.json +1 -1
- package/FileIconDoc/package.json +1 -1
- package/FileIconExe/package.json +1 -1
- package/FileIconGif/package.json +1 -1
- package/FileIconJpg/package.json +1 -1
- package/FileIconJson/package.json +1 -1
- package/FileIconLoading/package.json +1 -1
- package/FileIconMov/package.json +1 -1
- package/FileIconMp3/package.json +1 -1
- package/FileIconMp4/package.json +1 -1
- package/FileIconPdf/package.json +1 -1
- package/FileIconPng/package.json +1 -1
- package/FileIconPtt/package.json +1 -1
- package/FileIconRar/package.json +1 -1
- package/FileIconRtf/package.json +1 -1
- package/FileIconTiff/package.json +1 -1
- package/FileIconTxt/package.json +1 -1
- package/FileIconUndefined/package.json +1 -1
- package/FileIconWav/package.json +1 -1
- package/FileIconXls/package.json +1 -1
- package/FileIconZip/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Header/package.json +1 -1
- package/Icon/package.json +1 -1
- package/IconAdd/package.json +1 -1
- package/IconAddToComparison/package.json +1 -1
- package/IconAlert/package.json +1 -1
- package/IconAlignBlocksLeft/package.json +1 -1
- package/IconAlignBlocksRight/package.json +1 -1
- package/IconAlignCenter/package.json +1 -1
- package/IconAlignJustify/package.json +1 -1
- package/IconAlignLeft/package.json +1 -1
- package/IconAlignRight/package.json +1 -1
- package/IconAllDone/package.json +1 -1
- package/IconArrowDown/package.json +1 -1
- package/IconArrowLeft/package.json +1 -1
- package/IconArrowRight/package.json +1 -1
- package/IconArrowUp/package.json +1 -1
- package/IconArtBrush/package.json +1 -1
- package/IconAttach/package.json +1 -1
- package/IconBackward/package.json +1 -1
- package/IconBag/package.json +1 -1
- package/IconBarrier/package.json +1 -1
- package/IconBento/package.json +1 -1
- package/IconBold/package.json +1 -1
- package/IconBook/package.json +1 -1
- package/IconBookmarkFilled/package.json +1 -1
- package/IconBookmarkStroked/package.json +1 -1
- package/IconCalculator/package.json +1 -1
- package/IconCalendar/package.json +1 -1
- package/IconCamera/package.json +1 -1
- package/IconCancel/package.json +1 -1
- package/IconCards/package.json +1 -1
- package/IconChat/package.json +1 -1
- package/IconCheck/package.json +1 -1
- package/IconClose/package.json +1 -1
- package/IconCollapse/package.json +1 -1
- package/IconColorFill/package.json +1 -1
- package/IconColorText/package.json +1 -1
- package/IconColumns/package.json +1 -1
- package/IconComment/package.json +1 -1
- package/IconConnection/package.json +1 -1
- package/IconCopy/package.json +1 -1
- package/IconCrown/package.json +1 -1
- package/IconCursorMouse/package.json +1 -1
- package/IconDataNull/package.json +1 -1
- package/IconDiamond/package.json +1 -1
- package/IconDinosaur/package.json +1 -1
- package/IconDisconnection/package.json +1 -1
- package/IconDocAdd/package.json +1 -1
- package/IconDocBlank/package.json +1 -1
- package/IconDocDelete/package.json +1 -1
- package/IconDocExport/package.json +1 -1
- package/IconDocFilled/package.json +1 -1
- package/IconDown/package.json +1 -1
- package/IconDownload/package.json +1 -1
- package/IconDrag/package.json +1 -1
- package/IconDraggable/package.json +1 -1
- package/IconDrillingRig/package.json +1 -1
- package/IconDrop/package.json +1 -1
- package/IconEdit/package.json +1 -1
- package/IconExit/package.json +1 -1
- package/IconExpand/package.json +1 -1
- package/IconEye/package.json +1 -1
- package/IconEyeClose/package.json +1 -1
- package/IconFavorite/package.json +1 -1
- package/IconFilter/package.json +1 -1
- package/IconFitToDefault/package.json +1 -1
- package/IconFlagFilled/package.json +1 -1
- package/IconFlagStroked/package.json +1 -1
- package/IconFolders/package.json +1 -1
- package/IconForward/package.json +1 -1
- package/IconFunnel/package.json +1 -1
- package/IconGas/package.json +1 -1
- package/IconGeo/package.json +1 -1
- package/IconGrouping/package.json +1 -1
- package/IconHamburger/package.json +1 -1
- package/IconHand/package.json +1 -1
- package/IconHealth/package.json +1 -1
- package/IconHome/package.json +1 -1
- package/IconInComparison/package.json +1 -1
- package/IconInfo/package.json +1 -1
- package/IconIntroduction/package.json +1 -1
- package/IconIpad/package.json +1 -1
- package/IconItalic/package.json +1 -1
- package/IconKebab/package.json +1 -1
- package/IconLaptop/package.json +1 -1
- package/IconLayers/package.json +1 -1
- package/IconLeaf/package.json +1 -1
- package/IconLightningBolt/package.json +1 -1
- package/IconLineAndBarChart/package.json +1 -1
- package/IconLink/package.json +1 -1
- package/IconList/package.json +1 -1
- package/IconListNumbered/package.json +1 -1
- package/IconLock/package.json +1 -1
- package/IconLogicalElement/package.json +1 -1
- package/IconMBU/package.json +1 -1
- package/IconMGRP/package.json +1 -1
- package/IconMLSP/package.json +1 -1
- package/IconMMP/package.json +1 -1
- package/IconMail/package.json +1 -1
- package/IconMap/package.json +1 -1
- package/IconMaxHeight/package.json +1 -1
- package/IconMaxWidth/package.json +1 -1
- package/IconMeatball/package.json +1 -1
- package/IconMic/package.json +1 -1
- package/IconMolecules/package.json +1 -1
- package/IconMoon/package.json +1 -1
- package/IconNodeEnd/package.json +1 -1
- package/IconNodeStart/package.json +1 -1
- package/IconNodeStep/package.json +1 -1
- package/IconNodes/package.json +1 -1
- package/IconOpenInNew/package.json +1 -1
- package/IconOperators/package.json +1 -1
- package/IconPanelBottom/package.json +1 -1
- package/IconPanelLeft/package.json +1 -1
- package/IconPanelRight/package.json +1 -1
- package/IconPanelTop/package.json +1 -1
- package/IconPaste/package.json +1 -1
- package/IconPause/package.json +1 -1
- package/IconPhone/package.json +1 -1
- package/IconPhoto/package.json +1 -1
- package/IconPicture/package.json +1 -1
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconPriceLabel/package.json +1 -1
- package/IconProcessing/package.json +1 -1
- package/IconQuestion/package.json +1 -1
- package/IconQuote/package.json +1 -1
- package/IconRUO/package.json +1 -1
- package/IconRUS/package.json +1 -1
- package/IconRecord/package.json +1 -1
- package/IconRemove/package.json +1 -1
- package/IconRemoveFromComparison/package.json +1 -1
- package/IconReply/package.json +1 -1
- package/IconResize/package.json +1 -1
- package/IconRestart/package.json +1 -1
- package/IconRevert/package.json +1 -1
- package/IconRing/package.json +1 -1
- package/IconRouble/package.json +1 -1
- package/IconRuler/package.json +1 -1
- package/IconSave/package.json +1 -1
- package/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/package.json +1 -1
- package/IconSendMessage/package.json +1 -1
- package/IconSettings/package.json +1 -1
- package/IconShape/package.json +1 -1
- package/IconShuffle/package.json +1 -1
- package/IconSmile/package.json +1 -1
- package/IconSortDown/package.json +1 -1
- package/IconSortDownCenter/package.json +1 -1
- package/IconSortUp/package.json +1 -1
- package/IconSortUpCenter/package.json +1 -1
- package/IconStop/package.json +1 -1
- package/IconStorage/package.json +1 -1
- package/IconStrikethrough/package.json +1 -1
- package/IconSun/package.json +1 -1
- package/IconTable/package.json +1 -1
- package/IconTable2/package.json +1 -1
- package/IconTarget/package.json +1 -1
- package/IconTeam/package.json +1 -1
- package/IconTechResponse/package.json +1 -1
- package/IconTest/package.json +1 -1
- package/IconThumbUp/package.json +1 -1
- package/IconTie/package.json +1 -1
- package/IconTop/package.json +1 -1
- package/IconTrash/package.json +1 -1
- package/IconType/package.json +1 -1
- package/IconUnderline/package.json +1 -1
- package/IconUnlock/package.json +1 -1
- package/IconUnsort/package.json +1 -1
- package/IconUnsortCenter/package.json +1 -1
- package/IconUpload/package.json +1 -1
- package/IconUser/package.json +1 -1
- package/IconVZD/package.json +1 -1
- package/IconVideo/package.json +1 -1
- package/IconWarning/package.json +1 -1
- package/IconWatch/package.json +1 -1
- package/IconWideScreen/package.json +1 -1
- package/IconWorld/package.json +1 -1
- package/IconWrench/package.json +1 -1
- package/Informer/package.json +1 -1
- package/LayoutCanary/package.json +1 -1
- package/Loader/package.json +1 -1
- package/MixCard/package.json +1 -1
- package/MixFocus/package.json +1 -1
- package/MixPopoverAnimate/package.json +1 -1
- package/MixPopoverArrow/es.js +1 -0
- package/MixPopoverArrow/index.d.ts +1 -0
- package/MixPopoverArrow/index.js +4 -0
- package/MixPopoverArrow/package.json +9 -0
- package/MixSpace/package.json +1 -1
- package/MixVisuallyHidden/package.json +1 -1
- package/Modal/package.json +1 -1
- package/MultiComboboxDeprecated/package.json +1 -1
- package/Pagination/package.json +1 -1
- package/Popover/package.json +1 -1
- package/PortalWithTheme/package.json +1 -1
- package/ProgressSpin/package.json +1 -1
- package/ProgressStepBarCanary/package.json +1 -1
- package/Radio/package.json +1 -1
- package/RadioGroup/package.json +1 -1
- package/Responses/package.json +1 -1
- package/Responses403/package.json +1 -1
- package/Responses404/package.json +1 -1
- package/Responses500/package.json +1 -1
- package/Responses503/package.json +1 -1
- package/ResponsesConnectionError/package.json +1 -1
- package/ResponsesDeleted/package.json +1 -1
- package/ResponsesEmptyBox/package.json +1 -1
- package/ResponsesEmptyPockets/package.json +1 -1
- package/ResponsesExit/package.json +1 -1
- package/ResponsesImage/package.json +1 -1
- package/ResponsesImage403/package.json +1 -1
- package/ResponsesImage404/package.json +1 -1
- package/ResponsesImage500/package.json +1 -1
- package/ResponsesImage503/package.json +1 -1
- package/ResponsesImageConnectionError/package.json +1 -1
- package/ResponsesImageDeleted/package.json +1 -1
- package/ResponsesImageEmptyBox/package.json +1 -1
- package/ResponsesImageEmptyPockets/package.json +1 -1
- package/ResponsesImageNothingFound/package.json +1 -1
- package/ResponsesImageSuccess/package.json +1 -1
- package/ResponsesNothingFound/package.json +1 -1
- package/ResponsesSuccess/package.json +1 -1
- package/Select/package.json +1 -1
- package/Sidebar/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SliderCanary/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/Steps/package.json +1 -1
- package/Switch/package.json +1 -1
- package/SwitchGroup/package.json +1 -1
- package/Table/package.json +1 -1
- package/Tabs/package.json +1 -1
- package/Tag/package.json +1 -1
- package/TagBase/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextField/package.json +1 -1
- package/Theme/package.json +1 -1
- package/ThemeToggler/package.json +1 -1
- package/Timer/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/User/package.json +1 -1
- package/UserSelect/package.json +1 -1
- package/UserSelectDeprecated/package.json +1 -1
- package/__internal__/cjs-src/components/Card/Card.d.ts +1 -0
- package/__internal__/cjs-src/components/Card/Card.js +8 -4
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenu.css +18 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuCanary.d.ts +4 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuCanary.js +30 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.css +74 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.d.ts +3 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.js +45 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.css +73 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +4 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +102 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.d.ts +2 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +74 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/helper.d.ts +95 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/helper.js +119 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/types.d.ts +141 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/types.js +14 -0
- package/__internal__/cjs-src/components/EventInterceptor/EventInterceptor.d.ts +2 -2
- package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.d.ts +2 -81
- package/__internal__/cjs-src/components/EventInterceptor/types.d.ts +1 -0
- package/__internal__/cjs-src/components/EventInterceptor/types.js +2 -0
- package/__internal__/cjs-src/components/EventInterceptor/usePropsHandler.d.ts +2 -2
- package/__internal__/cjs-src/components/Tag/Tag.d.ts +1 -0
- package/__internal__/cjs-src/components/Tag/Tag.js +8 -4
- package/__internal__/cjs-src/components/ThemeToggler/ThemeToggler.d.ts +2 -30
- package/__internal__/cjs-src/components/ThemeToggler/ThemeToggler.js +23 -37
- package/__internal__/cjs-src/components/ThemeToggler/helpers.d.ts +274 -0
- package/__internal__/cjs-src/components/ThemeToggler/helpers.js +27 -0
- package/__internal__/cjs-src/components/ThemeToggler/types.d.ts +45 -0
- package/__internal__/cjs-src/components/ThemeToggler/types.js +5 -0
- package/__internal__/cjs-src/components/Tooltip/Tooltip.css +1 -88
- package/__internal__/cjs-src/components/Tooltip/Tooltip.js +3 -2
- package/__internal__/cjs-src/mixs/MixPopoverArrow/MixPopoverArrow.css +88 -0
- package/__internal__/cjs-src/mixs/MixPopoverArrow/MixPopoverArrow.d.ts +8 -0
- package/__internal__/cjs-src/mixs/MixPopoverArrow/MixPopoverArrow.js +6 -0
- package/__internal__/src/components/Card/Card.d.ts +1 -0
- package/__internal__/src/components/Card/Card.js +7 -3
- package/__internal__/src/components/ContextMenuCanary/ContextMenu.css +18 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuCanary.d.ts +4 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuCanary.js +27 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.css +74 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.d.ts +3 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.js +42 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.css +73 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +4 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +99 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.d.ts +2 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +71 -0
- package/__internal__/src/components/ContextMenuCanary/helper.d.ts +95 -0
- package/__internal__/src/components/ContextMenuCanary/helper.js +115 -0
- package/__internal__/src/components/ContextMenuCanary/types.d.ts +141 -0
- package/__internal__/src/components/ContextMenuCanary/types.js +11 -0
- package/__internal__/src/components/EventInterceptor/EventInterceptor.d.ts +2 -2
- package/__internal__/src/components/EventInterceptor/eventInterceptorMap.d.ts +2 -81
- package/__internal__/src/components/EventInterceptor/types.d.ts +1 -0
- package/__internal__/src/components/EventInterceptor/types.js +0 -0
- package/__internal__/src/components/EventInterceptor/usePropsHandler.d.ts +2 -2
- package/__internal__/src/components/Tag/Tag.d.ts +1 -0
- package/__internal__/src/components/Tag/Tag.js +7 -3
- package/__internal__/src/components/ThemeToggler/ThemeToggler.d.ts +2 -30
- package/__internal__/src/components/ThemeToggler/ThemeToggler.js +21 -35
- package/__internal__/src/components/ThemeToggler/helpers.d.ts +274 -0
- package/__internal__/src/components/ThemeToggler/helpers.js +23 -0
- package/__internal__/src/components/ThemeToggler/types.d.ts +45 -0
- package/__internal__/src/components/ThemeToggler/types.js +2 -0
- package/__internal__/src/components/Tooltip/Tooltip.css +1 -88
- package/__internal__/src/components/Tooltip/Tooltip.js +3 -2
- package/__internal__/src/mixs/MixPopoverArrow/MixPopoverArrow.css +88 -0
- package/__internal__/src/mixs/MixPopoverArrow/MixPopoverArrow.d.ts +8 -0
- package/__internal__/src/mixs/MixPopoverArrow/MixPopoverArrow.js +3 -0
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +3 -1
- package/useBreakpoints/package.json +1 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useHideElementsInLine/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/useOverflow/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useRefs/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollElements/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useSortSteps/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconComponent } from '../../icons/Icon/Icon';
|
|
3
|
+
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
+
import { Direction } from '../Popover/Popover';
|
|
5
|
+
export declare const themeTogglerPropSize: readonly ["m", "l", "s", "xs"];
|
|
6
|
+
export declare type ThemeTogglerPropSize = typeof themeTogglerPropSize[number];
|
|
7
|
+
export declare const themeTogglerPropSizeDefault: ThemeTogglerPropSize;
|
|
8
|
+
export declare type ThemeTogglerPropSetValue<ITEM> = (props: {
|
|
9
|
+
e: React.MouseEvent;
|
|
10
|
+
value: ITEM;
|
|
11
|
+
}) => void;
|
|
12
|
+
export declare type ThemeTogglerPropGetItemKey<ITEM> = (item: ITEM) => string | number;
|
|
13
|
+
export declare type ThemeTogglerPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
14
|
+
export declare type ThemeTogglerPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent;
|
|
15
|
+
export declare type ThemeTogglerItemDefault = {
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
18
|
+
icon: IconComponent;
|
|
19
|
+
};
|
|
20
|
+
export declare type ThemeTogglerProps<ITEM = ThemeTogglerItemDefault> = PropsWithHTMLAttributesAndRef<{
|
|
21
|
+
size?: ThemeTogglerPropSize;
|
|
22
|
+
className?: string;
|
|
23
|
+
items: ITEM[];
|
|
24
|
+
value: ITEM;
|
|
25
|
+
onChange: ThemeTogglerPropSetValue<ITEM>;
|
|
26
|
+
getItemKey?: ThemeTogglerPropGetItemKey<ITEM>;
|
|
27
|
+
getItemLabel?: ThemeTogglerPropGetItemLabel<ITEM>;
|
|
28
|
+
getItemIcon?: ThemeTogglerPropGetItemIcon<ITEM>;
|
|
29
|
+
direction?: Direction;
|
|
30
|
+
possibleDirections?: readonly Direction[];
|
|
31
|
+
children?: never;
|
|
32
|
+
}, HTMLButtonElement> & (ITEM extends {
|
|
33
|
+
key: ThemeTogglerItemDefault['key'];
|
|
34
|
+
} ? {} : {
|
|
35
|
+
getItemKey: ThemeTogglerPropGetItemLabel<ITEM>;
|
|
36
|
+
}) & (ITEM extends {
|
|
37
|
+
label: ThemeTogglerItemDefault['label'];
|
|
38
|
+
} ? {} : {
|
|
39
|
+
getItemLabel: ThemeTogglerPropGetItemLabel<ITEM>;
|
|
40
|
+
}) & (ITEM extends {
|
|
41
|
+
icon: ThemeTogglerItemDefault['icon'];
|
|
42
|
+
} ? {} : {
|
|
43
|
+
getItemIcon: ThemeTogglerPropGetItemIcon<ITEM>;
|
|
44
|
+
});
|
|
45
|
+
export declare type ThemeTogglerComponent = <ITEM>(props: ThemeTogglerProps<ITEM>) => React.ReactElement | null;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
.Tooltip {
|
|
2
2
|
--tooltip-bg-color: var(--color-bg-default);
|
|
3
|
+
--popover-arrow-bg-color: var(--tooltip-bg-color);
|
|
3
4
|
--tooltip-bg-opacity: 0.9;
|
|
4
|
-
|
|
5
|
-
/* Задаются через js */
|
|
6
|
-
--tooltip-arrow-size: 0;
|
|
7
|
-
--tooltip-arrow-offset: 0;
|
|
8
5
|
}
|
|
9
6
|
|
|
10
7
|
.Tooltip_status_alert {
|
|
@@ -67,89 +64,5 @@
|
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
.Tooltip-Arrow {
|
|
70
|
-
position: absolute;
|
|
71
|
-
border: var(--tooltip-arrow-size) solid transparent;
|
|
72
67
|
opacity: var(--tooltip-bg-opacity);
|
|
73
68
|
}
|
|
74
|
-
|
|
75
|
-
.Tooltip-Arrow_direction_upLeft,
|
|
76
|
-
.Tooltip-Arrow_direction_upCenter,
|
|
77
|
-
.Tooltip-Arrow_direction_upRight,
|
|
78
|
-
.Tooltip-Arrow_direction_upStartLeft,
|
|
79
|
-
.Tooltip-Arrow_direction_upStartRight {
|
|
80
|
-
bottom: 0;
|
|
81
|
-
border-top-color: var(--tooltip-bg-color);
|
|
82
|
-
-webkit-transform: translateY(100%);
|
|
83
|
-
transform: translateY(100%);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.Tooltip-Arrow_direction_upLeft,
|
|
87
|
-
.Tooltip-Arrow_direction_downLeft,
|
|
88
|
-
.Tooltip-Arrow_direction_downStartRight,
|
|
89
|
-
.Tooltip-Arrow_direction_upStartRight {
|
|
90
|
-
right: var(--tooltip-arrow-offset);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.Tooltip-Arrow_direction_upCenter,
|
|
94
|
-
.Tooltip-Arrow_direction_downCenter {
|
|
95
|
-
left: calc(50% - var(--tooltip-arrow-size));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.Tooltip-Arrow_direction_upRight,
|
|
99
|
-
.Tooltip-Arrow_direction_downRight,
|
|
100
|
-
.Tooltip-Arrow_direction_downStartLeft,
|
|
101
|
-
.Tooltip-Arrow_direction_upStartLeft {
|
|
102
|
-
left: var(--tooltip-arrow-offset);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.Tooltip-Arrow_direction_downLeft,
|
|
106
|
-
.Tooltip-Arrow_direction_downCenter,
|
|
107
|
-
.Tooltip-Arrow_direction_downRight,
|
|
108
|
-
.Tooltip-Arrow_direction_downStartLeft,
|
|
109
|
-
.Tooltip-Arrow_direction_downStartRight {
|
|
110
|
-
top: 0;
|
|
111
|
-
border-bottom-color: var(--tooltip-bg-color);
|
|
112
|
-
-webkit-transform: translateY(-100%);
|
|
113
|
-
transform: translateY(-100%);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.Tooltip-Arrow_direction_rightUp,
|
|
117
|
-
.Tooltip-Arrow_direction_rightCenter,
|
|
118
|
-
.Tooltip-Arrow_direction_rightDown,
|
|
119
|
-
.Tooltip-Arrow_direction_rightStartUp,
|
|
120
|
-
.Tooltip-Arrow_direction_rightStartDown {
|
|
121
|
-
left: 0;
|
|
122
|
-
border-right-color: var(--tooltip-bg-color);
|
|
123
|
-
-webkit-transform: translateX(-100%);
|
|
124
|
-
transform: translateX(-100%);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.Tooltip-Arrow_direction_rightUp,
|
|
128
|
-
.Tooltip-Arrow_direction_leftUp,
|
|
129
|
-
.Tooltip-Arrow_direction_leftStartDown,
|
|
130
|
-
.Tooltip-Arrow_direction_rightStartDown {
|
|
131
|
-
bottom: var(--tooltip-arrow-offset);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.Tooltip-Arrow_direction_rightCenter,
|
|
135
|
-
.Tooltip-Arrow_direction_leftCenter {
|
|
136
|
-
top: calc(50% - var(--tooltip-arrow-size));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.Tooltip-Arrow_direction_rightDown,
|
|
140
|
-
.Tooltip-Arrow_direction_leftDown,
|
|
141
|
-
.Tooltip-Arrow_direction_leftStartUp,
|
|
142
|
-
.Tooltip-Arrow_direction_rightStartUp {
|
|
143
|
-
top: var(--tooltip-arrow-offset);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.Tooltip-Arrow_direction_leftUp,
|
|
147
|
-
.Tooltip-Arrow_direction_leftCenter,
|
|
148
|
-
.Tooltip-Arrow_direction_leftDown,
|
|
149
|
-
.Tooltip-Arrow_direction_leftStartUp,
|
|
150
|
-
.Tooltip-Arrow_direction_leftStartDown {
|
|
151
|
-
right: 0;
|
|
152
|
-
border-left-color: var(--tooltip-bg-color);
|
|
153
|
-
-webkit-transform: translateX(100%);
|
|
154
|
-
transform: translateX(100%);
|
|
155
|
-
}
|
|
@@ -4,6 +4,7 @@ exports.Tooltip = exports.tooltipPropStatus = exports.tooltipPropSizesDefault =
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("./Tooltip.css");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var MixPopoverArrow_1 = require("../../mixs/MixPopoverArrow/MixPopoverArrow");
|
|
7
8
|
var bem_1 = require("../../utils/bem");
|
|
8
9
|
var Popover_1 = require("../Popover/Popover");
|
|
9
10
|
var Text_1 = require("../Text/Text");
|
|
@@ -38,8 +39,8 @@ exports.Tooltip = react_1["default"].forwardRef(function (props, ref) {
|
|
|
38
39
|
setDirection(direction);
|
|
39
40
|
};
|
|
40
41
|
return (react_1["default"].createElement(Theme_1.ThemeContext.Provider, { value: { theme: tooltipTheme, themeClassNames: tooltipThemeClassNames } },
|
|
41
|
-
react_1["default"].createElement(Popover_1.Popover, tslib_1.__assign({}, rest, { arrowOffset: ARROW_OFFSET + ARROW_SIZE, offset: ARROW_SIZE + 4, onSetDirection: onSetDirection, ref: ref, className: cnTooltip({ status: status }, [className]), style: tslib_1.__assign((_a = {}, _a['--
|
|
42
|
+
react_1["default"].createElement(Popover_1.Popover, tslib_1.__assign({}, rest, { arrowOffset: ARROW_OFFSET + ARROW_SIZE, offset: ARROW_SIZE + 4, onSetDirection: onSetDirection, ref: ref, className: cnTooltip({ status: status }, [className]), style: tslib_1.__assign((_a = {}, _a['--popover-arrow-size'] = ARROW_SIZE + "px", _a['--popover-arrow-offset'] = ARROW_OFFSET + "px", _a), style) }),
|
|
42
43
|
react_1["default"].createElement("div", { className: cnTooltip('Background') }),
|
|
43
|
-
react_1["default"].createElement("div", { className: cnTooltip('Arrow', { direction: direction }) }),
|
|
44
|
+
react_1["default"].createElement("div", { className: cnTooltip('Arrow', [MixPopoverArrow_1.cnMixPopoverArrow({ direction: direction })]) }),
|
|
44
45
|
react_1["default"].createElement("div", { className: cnTooltip('Content', { size: size }) }, renderChildren(children)))));
|
|
45
46
|
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.MixPopoverArrow {
|
|
2
|
+
--popover-arrow-size: 10px;
|
|
3
|
+
--popover-arrow-offset: 6px;
|
|
4
|
+
position: absolute;
|
|
5
|
+
border: var(--popover-arrow-size) solid transparent;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.MixPopoverArrow_direction_upLeft,
|
|
9
|
+
.MixPopoverArrow_direction_upCenter,
|
|
10
|
+
.MixPopoverArrow_direction_upRight,
|
|
11
|
+
.MixPopoverArrow_direction_upStartLeft,
|
|
12
|
+
.MixPopoverArrow_direction_upStartRight {
|
|
13
|
+
bottom: 0;
|
|
14
|
+
border-top-color: var(--popover-arrow-bg-color);
|
|
15
|
+
-webkit-transform: translateY(100%);
|
|
16
|
+
transform: translateY(100%);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.MixPopoverArrow_direction_upLeft,
|
|
20
|
+
.MixPopoverArrow_direction_downLeft,
|
|
21
|
+
.MixPopoverArrow_direction_downStartRight,
|
|
22
|
+
.MixPopoverArrow_direction_upStartRight {
|
|
23
|
+
right: var(--popover-arrow-offset);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.MixPopoverArrow_direction_upCenter,
|
|
27
|
+
.MixPopoverArrow_direction_downCenter {
|
|
28
|
+
left: calc(50% - var(--popover-arrow-size));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.MixPopoverArrow_direction_upRight,
|
|
32
|
+
.MixPopoverArrow_direction_downRight,
|
|
33
|
+
.MixPopoverArrow_direction_downStartLeft,
|
|
34
|
+
.MixPopoverArrow_direction_upStartLeft {
|
|
35
|
+
left: var(--popover-arrow-offset);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.MixPopoverArrow_direction_downLeft,
|
|
39
|
+
.MixPopoverArrow_direction_downCenter,
|
|
40
|
+
.MixPopoverArrow_direction_downRight,
|
|
41
|
+
.MixPopoverArrow_direction_downStartLeft,
|
|
42
|
+
.MixPopoverArrow_direction_downStartRight {
|
|
43
|
+
top: 0;
|
|
44
|
+
border-bottom-color: var(--popover-arrow-bg-color);
|
|
45
|
+
-webkit-transform: translateY(-100%);
|
|
46
|
+
transform: translateY(-100%);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.MixPopoverArrow_direction_rightUp,
|
|
50
|
+
.MixPopoverArrow_direction_rightCenter,
|
|
51
|
+
.MixPopoverArrow_direction_rightDown,
|
|
52
|
+
.MixPopoverArrow_direction_rightStartUp,
|
|
53
|
+
.MixPopoverArrow_direction_rightStartDown {
|
|
54
|
+
left: 0;
|
|
55
|
+
border-right-color: var(--popover-arrow-bg-color);
|
|
56
|
+
-webkit-transform: translateX(-100%);
|
|
57
|
+
transform: translateX(-100%);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.MixPopoverArrow_direction_rightUp,
|
|
61
|
+
.MixPopoverArrow_direction_leftUp,
|
|
62
|
+
.MixPopoverArrow_direction_leftStartDown,
|
|
63
|
+
.MixPopoverArrow_direction_rightStartDown {
|
|
64
|
+
bottom: var(--popover-arrow-offset);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.MixPopoverArrow_direction_rightCenter,
|
|
68
|
+
.MixPopoverArrow_direction_leftCenter {
|
|
69
|
+
top: calc(50% - var(--popover-arrow-size));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.MixPopoverArrow_direction_rightDown,
|
|
73
|
+
.MixPopoverArrow_direction_leftDown,
|
|
74
|
+
.MixPopoverArrow_direction_leftStartUp,
|
|
75
|
+
.MixPopoverArrow_direction_rightStartUp {
|
|
76
|
+
top: var(--popover-arrow-offset);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.MixPopoverArrow_direction_leftUp,
|
|
80
|
+
.MixPopoverArrow_direction_leftCenter,
|
|
81
|
+
.MixPopoverArrow_direction_leftDown,
|
|
82
|
+
.MixPopoverArrow_direction_leftStartUp,
|
|
83
|
+
.MixPopoverArrow_direction_leftStartDown {
|
|
84
|
+
right: 0;
|
|
85
|
+
border-left-color: var(--popover-arrow-bg-color);
|
|
86
|
+
-webkit-transform: translateX(100%);
|
|
87
|
+
transform: translateX(100%);
|
|
88
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './MixPopoverArrow.css';
|
|
2
|
+
import { Direction } from '../../components/Popover/Popover';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
direction?: Direction;
|
|
5
|
+
};
|
|
6
|
+
declare type CnMixPopoverArrow = (elemNameOrBlockMods?: Props | string | null, elemModsOrBlockMix?: Props | Array<string | undefined> | null, elemMix?: Array<string | undefined>) => string;
|
|
7
|
+
export declare const cnMixPopoverArrow: CnMixPopoverArrow;
|
|
8
|
+
export {};
|
|
@@ -14,5 +14,6 @@ export declare type Props = {
|
|
|
14
14
|
shadow?: boolean;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
16
|
};
|
|
17
|
+
export declare const COMPONENT_NAME: "Card";
|
|
17
18
|
export declare const cnCard: import("@bem-react/classname").ClassNameFormatter;
|
|
18
19
|
export declare const Card: import("../../utils/types/PropsWithAsAttributes").ComponentWithAs<Props, "div">;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import { useForkRef } from '../../hooks/useForkRef/useForkRef';
|
|
3
4
|
import { cnMixCard } from '../../mixs/MixCard/MixCard';
|
|
4
5
|
import { cn } from '../../utils/bem';
|
|
5
6
|
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
|
|
7
|
+
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
|
|
6
8
|
export var cardPropForm = ['round', 'square'];
|
|
7
9
|
export var cardPropFormDefault = cardPropForm[0];
|
|
8
10
|
export var cardPropSpace = ['m', 'xs', 's', 'l', 'xl', '2xl', '3xl', '4xl', '5xl'];
|
|
9
11
|
export var cardPropStatus = ['alert', 'success', 'warning'];
|
|
12
|
+
export var COMPONENT_NAME = 'Card';
|
|
10
13
|
export var cnCard = cn('Card');
|
|
11
14
|
export var Card = forwardRefWithAs(function (props, ref) {
|
|
12
|
-
var
|
|
15
|
+
var cardRef = useRef(null);
|
|
16
|
+
var _a = usePropsHandler(COMPONENT_NAME, props, cardRef), verticalSpace = _a.verticalSpace, horizontalSpace = _a.horizontalSpace, status = _a.status, _b = _a.form, form = _b === void 0 ? cardPropFormDefault : _b, _c = _a.shadow, shadow = _c === void 0 ? true : _c, children = _a.children, tabIndex = _a.tabIndex, className = _a.className, _d = _a.as, as = _d === void 0 ? 'div' : _d, otherProps = __rest(_a, ["verticalSpace", "horizontalSpace", "status", "form", "shadow", "children", "tabIndex", "className", "as"]);
|
|
13
17
|
var Tag = as;
|
|
14
|
-
return (React.createElement(Tag, __assign({ tabIndex: tabIndex, ref: ref, className: cnCard(null, [
|
|
18
|
+
return (React.createElement(Tag, __assign({ tabIndex: tabIndex, ref: useForkRef([cardRef, ref]), className: cnCard(null, [
|
|
15
19
|
cnMixCard({ verticalSpace: verticalSpace, horizontalSpace: horizontalSpace, shadow: shadow, form: form, status: status }),
|
|
16
20
|
className,
|
|
17
21
|
]) }, otherProps), children));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.ContextMenuCanary-Level {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ContextMenuCanary-Level.MixPopoverAnimate_animate_entered {
|
|
6
|
+
pointer-events: auto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ContextMenuCanary-Level_playAnimation.MixPopoverAnimate {
|
|
10
|
+
opacity: 0 !important;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
-webkit-transition: opacity 0.2s, -webkit-transform 0.2s !important;
|
|
13
|
+
transition: opacity 0.2s, -webkit-transform 0.2s !important;
|
|
14
|
+
transition: opacity 0.2s, transform 0.2s !important;
|
|
15
|
+
transition: opacity 0.2s, transform 0.2s, -webkit-transform 0.2s !important;
|
|
16
|
+
-webkit-transform: var(--mix-dropdown-animate-transform) !important;
|
|
17
|
+
transform: var(--mix-dropdown-animate-transform) !important;
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import './ContextMenu.css';
|
|
3
|
+
import React, { useRef, useState } from 'react';
|
|
4
|
+
import { Transition } from 'react-transition-group';
|
|
5
|
+
import { useFlag } from '../../hooks/useFlag/useFlag';
|
|
6
|
+
import { useForkRef } from '../../hooks/useForkRef/useForkRef';
|
|
7
|
+
import { animateTimeout, cnMixPopoverAnimate, } from '../../mixs/MixPopoverAnimate/MixPopoverAnimate';
|
|
8
|
+
import { cn } from '../../utils/bem';
|
|
9
|
+
import { ContextMenuLevels } from './ContextMenuLevels/ContextMenuLevels';
|
|
10
|
+
var cnContextMenu = cn('ContextMenuCanary');
|
|
11
|
+
function ContextMenuRender(props, ref) {
|
|
12
|
+
var isOpen = props.isOpen, className = props.className, onSetDirection = props.onSetDirection, otherProps = __rest(props, ["isOpen", "className", "onSetDirection"]);
|
|
13
|
+
var _a = __read(useFlag(), 2), playAnimation = _a[0], setPlayAnimation = _a[1];
|
|
14
|
+
var _b = __read(useState(props.direction), 2), direction = _b[0], setDirection = _b[1];
|
|
15
|
+
var nodeRef = useRef(null);
|
|
16
|
+
var levelRef = useForkRef([ref, nodeRef]);
|
|
17
|
+
var handleSetDirection = function (d) {
|
|
18
|
+
setDirection(d);
|
|
19
|
+
onSetDirection === null || onSetDirection === void 0 ? void 0 : onSetDirection(d);
|
|
20
|
+
};
|
|
21
|
+
return (React.createElement(Transition, { "in": isOpen, unmountOnExit: true, timeout: animateTimeout, onEnter: setPlayAnimation.off, onExit: setPlayAnimation.on, nodeRef: nodeRef }, function (animate) { return (React.createElement(ContextMenuLevels, __assign({}, otherProps, { ref: levelRef, onSetDirection: handleSetDirection, className: cnContextMenu('Level', { playAnimation: playAnimation }, [
|
|
22
|
+
className,
|
|
23
|
+
cnMixPopoverAnimate({ animate: animate, direction: direction }),
|
|
24
|
+
]) }))); }));
|
|
25
|
+
}
|
|
26
|
+
export var ContextMenu = React.forwardRef(ContextMenuRender);
|
|
27
|
+
export * from './types';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.ContextMenuItemCanary {
|
|
2
|
+
--vertical-space: 0;
|
|
3
|
+
display: -webkit-box;
|
|
4
|
+
display: -ms-flexbox;
|
|
5
|
+
display: flex;
|
|
6
|
+
-webkit-box-align: center;
|
|
7
|
+
-ms-flex-align: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: var(--vertical-space) var(--space-s);
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
word-break: break-word;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
-webkit-transition: background-color 0.2s;
|
|
14
|
+
transition: background-color 0.2s;
|
|
15
|
+
gap: var(--space-xs);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ContextMenuItemCanary:hover,
|
|
19
|
+
.ContextMenuItemCanary_active {
|
|
20
|
+
background: var(--color-control-bg-clear-hover);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ContextMenuItemCanary_size_xs {
|
|
24
|
+
--vertical-space: var(--space-2xs);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ContextMenuItemCanary_size_s {
|
|
28
|
+
--vertical-space: var(--space-xs);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ContextMenuItemCanary_size_m {
|
|
32
|
+
--vertical-space: var(--space-s);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ContextMenuItemCanary_size_l {
|
|
36
|
+
--vertical-space: var(--space-m);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ContextMenuItemCanary-Label {
|
|
40
|
+
-webkit-box-flex: 1;
|
|
41
|
+
-ms-flex: 1;
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ContextMenuItemCanary_disabled.Text {
|
|
46
|
+
color: var(--color-control-typo-disable);
|
|
47
|
+
cursor: default;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ContextMenuItemCanary_disabled.Text:hover {
|
|
51
|
+
background: transparent;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ContextMenuItemCanary-Slot {
|
|
55
|
+
display: -webkit-box;
|
|
56
|
+
display: -ms-flexbox;
|
|
57
|
+
display: flex;
|
|
58
|
+
-webkit-box-align: center;
|
|
59
|
+
-ms-flex-align: center;
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ContextMenuItemCanary-Slot_position_left,
|
|
64
|
+
.ContextMenuItemCanary-Slot_position_right {
|
|
65
|
+
-webkit-box-flex: 0;
|
|
66
|
+
-ms-flex: 0;
|
|
67
|
+
flex: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ContextMenuItemCanary-Slot_position_center {
|
|
71
|
+
-webkit-box-flex: 1;
|
|
72
|
+
-ms-flex: 1;
|
|
73
|
+
flex: 1;
|
|
74
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __assign, __read, __rest, __spread } from "tslib";
|
|
2
|
+
import './ContextMenuItem.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { IconArrowRight } from '../../../icons/IconArrowRight/IconArrowRight';
|
|
5
|
+
import { cn } from '../../../utils/bem';
|
|
6
|
+
import { getByMap } from '../../../utils/getByMap';
|
|
7
|
+
import { Text } from '../../Text/Text';
|
|
8
|
+
import { sizeMapIcon } from '../helper';
|
|
9
|
+
import { contextMenuDefaultSize, } from '../types';
|
|
10
|
+
var cnContextMenuItem = cn('ContextMenuItemCanary');
|
|
11
|
+
function renderSide(side, position, withArrow, size, icon) {
|
|
12
|
+
var sides = side ? __spread((Array.isArray(side) ? side : [side])) : [];
|
|
13
|
+
if (icon) {
|
|
14
|
+
var Icon = icon;
|
|
15
|
+
var render = React.createElement(Icon, { size: getByMap(sizeMapIcon, size) });
|
|
16
|
+
if (position === 'left') {
|
|
17
|
+
sides.unshift(render);
|
|
18
|
+
}
|
|
19
|
+
if (position === 'right') {
|
|
20
|
+
sides.push(render);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (withArrow) {
|
|
24
|
+
sides.push(React.createElement(IconArrowRight, { size: "xs", view: "secondary" }));
|
|
25
|
+
}
|
|
26
|
+
var sidesRender = sides.map(function (item, index) { return (React.createElement("div", { className: cnContextMenuItem('Slot', {
|
|
27
|
+
position: position
|
|
28
|
+
}), key: cnContextMenuItem('Slot', {
|
|
29
|
+
position: position,
|
|
30
|
+
index: index
|
|
31
|
+
}) }, item)); });
|
|
32
|
+
return sidesRender;
|
|
33
|
+
}
|
|
34
|
+
function ContextMenuItemRender(props, ref) {
|
|
35
|
+
var label = props.label, rightSide = props.rightSide, leftSide = props.leftSide, _a = props.size, size = _a === void 0 ? contextMenuDefaultSize : _a, _b = props.as, as = _b === void 0 ? 'div' : _b, disabled = props.disabled, status = props.status, withSubMenu = props.withSubMenu, className = props.className, active = props.active, leftIcon = props.leftIcon, rightIcon = props.rightIcon, otherProps = __rest(props, ["label", "rightSide", "leftSide", "size", "as", "disabled", "status", "withSubMenu", "className", "active", "leftIcon", "rightIcon"]);
|
|
36
|
+
var view = (disabled ? undefined : status) || 'primary';
|
|
37
|
+
return (React.createElement(Text, __assign({ className: cnContextMenuItem({ size: size, active: active, disabled: disabled }, [className]), as: as, size: size, view: view, lineHeight: "xs", ref: ref }, otherProps),
|
|
38
|
+
renderSide(leftSide, 'left', false, size, leftIcon),
|
|
39
|
+
!rightSide && !leftSide && !withSubMenu && !leftIcon && !rightIcon ? (label) : (React.createElement("div", { className: cnContextMenuItem('Slot', { position: 'center' }), key: "center" }, label)),
|
|
40
|
+
renderSide(rightSide, 'right', withSubMenu, size, rightIcon)));
|
|
41
|
+
}
|
|
42
|
+
export var ContextMenuItem = React.forwardRef(ContextMenuItemRender);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.ContextMenuLevelCanary {
|
|
2
|
+
-webkit-box-sizing: border-box;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
width: 240px;
|
|
5
|
+
padding: var(--space-xs) 0;
|
|
6
|
+
background: var(--color-bg-default);
|
|
7
|
+
border: var(--control-border-width) solid var(--color-control-bg-border-default);
|
|
8
|
+
border-radius: var(--control-radius);
|
|
9
|
+
-webkit-box-shadow: var(--shadow-layer);
|
|
10
|
+
box-shadow: var(--shadow-layer);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_rightStartUp,
|
|
14
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_leftStartUp {
|
|
15
|
+
-webkit-transform: translateY(calc(-1 * (var(--space-xs) + 1px)));
|
|
16
|
+
transform: translateY(calc(-1 * (var(--space-xs) + 1px)));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_rightStartDown,
|
|
20
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_leftStartDown {
|
|
21
|
+
-webkit-transform: translateY(calc(var(--space-xs) + 1px));
|
|
22
|
+
transform: translateY(calc(var(--space-xs) + 1px));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ContextMenuLevelCanary-Divider {
|
|
26
|
+
--vertical-space: 0;
|
|
27
|
+
height: var(--control-border-width);
|
|
28
|
+
margin: var(--vertical-space) var(--space-s);
|
|
29
|
+
background: var(--color-control-bg-border-default);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ContextMenuLevelCanary-Divider_size_l {
|
|
33
|
+
--vertical-space: var(--space-xs);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ContextMenuLevelCanary-Divider_size_m,
|
|
37
|
+
.ContextMenuLevelCanary-Divider_size_s,
|
|
38
|
+
.ContextMenuLevelCanary-Divider_size_xs {
|
|
39
|
+
--vertical-space: var(--space-2xs);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ContextMenuLevelCanary-Group_size_xs > .ContextMenuLevel-Item:not(:last-child) {
|
|
43
|
+
margin-bottom: var(--space-2xs);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ContextMenuLevelCanary-Header {
|
|
47
|
+
--top-space: 0;
|
|
48
|
+
--bottom-space: 0;
|
|
49
|
+
margin: 0 var(--space-s);
|
|
50
|
+
padding: var(--top-space) 0 var(--bottom-space) 0;
|
|
51
|
+
border-bottom: solid var(--control-border-width) var(--color-control-bg-border-default);
|
|
52
|
+
letter-spacing: 0.05em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ContextMenuLevelCanary-Header_size_xs,
|
|
56
|
+
.ContextMenuLevelCanary-Header_size_s {
|
|
57
|
+
--top-space: var(--space-xs);
|
|
58
|
+
--bottom-space: var(--space-2xs);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ContextMenuLevelCanary-Header_size_m {
|
|
62
|
+
--top-space: var(--space-s);
|
|
63
|
+
--bottom-space: var(--space-xs);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ContextMenuLevelCanary-Header_size_l {
|
|
67
|
+
--top-space: var(--space-s);
|
|
68
|
+
--bottom-space: var(--space-s);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ContextMenuLevelCanary-Header_first {
|
|
72
|
+
padding: calc(var(--top-space) - var(--space-xs)) 0 var(--bottom-space) 0;
|
|
73
|
+
}
|