@vibe/core 3.76.1-alpha-00fe2.0 → 3.76.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Menu/MenuItem/MenuItem.d.ts +0 -20
- package/dist/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.d.ts +1 -1
- package/dist/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.types.d.ts +0 -5
- package/dist/metadata.json +0 -59
- package/dist/mocked_classnames/components/Menu/MenuItem/MenuItem.d.ts +0 -20
- package/dist/mocked_classnames/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.d.ts +1 -1
- package/dist/mocked_classnames/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.types.d.ts +0 -5
- package/dist/mocked_classnames/src/components/Menu/MenuItem/MenuItem.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/MenuItem.js.map +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js.map +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.module.scss.js +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.js +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.js +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.js.map +1 -1
- package/dist/src/components/Menu/MenuItem/MenuItem.js +1 -1
- package/dist/src/components/Menu/MenuItem/MenuItem.js.map +1 -1
- package/dist/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js +1 -1
- package/dist/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js.map +1 -1
- package/dist/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.module.scss.js +1 -1
- package/dist/src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.js +1 -1
- package/dist/src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.js.map +1 -1
- package/dist/src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.js +1 -1
- package/dist/src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.js.map +1 -1
- package/package.json +7 -7
|
@@ -28,26 +28,6 @@ export interface MenuItemProps extends VibeComponentProps {
|
|
|
28
28
|
* The background color of the icon.
|
|
29
29
|
*/
|
|
30
30
|
iconBackgroundColor?: string;
|
|
31
|
-
/**
|
|
32
|
-
* The right icon to be displayed.
|
|
33
|
-
*/
|
|
34
|
-
rightIcon?: SubIcon;
|
|
35
|
-
/**
|
|
36
|
-
* The type of right icon.
|
|
37
|
-
*/
|
|
38
|
-
rightIconType?: IconType;
|
|
39
|
-
/**
|
|
40
|
-
* The background color of the right icon.
|
|
41
|
-
*/
|
|
42
|
-
rightIconBackgroundColor?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Class name applied to the icon wrapper.
|
|
45
|
-
*/
|
|
46
|
-
rightIconWrapperClassName?: string;
|
|
47
|
-
/**
|
|
48
|
-
* The label of the menu item for accessibility.
|
|
49
|
-
*/
|
|
50
|
-
rightIconAriaLabel?: AriaAttributes["aria-label"];
|
|
51
31
|
/**
|
|
52
32
|
* If true, the menu item is disabled.
|
|
53
33
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type MenuItemIconProps } from "./MenuItemIcon.types";
|
|
3
|
-
declare const MenuItemIcon: ({ icon,
|
|
3
|
+
declare const MenuItemIcon: ({ icon, type, label, disabled, selected, backgroundColor, wrapperClassName }: MenuItemIconProps) => React.JSX.Element;
|
|
4
4
|
export default MenuItemIcon;
|
package/dist/metadata.json
CHANGED
|
@@ -10781,65 +10781,6 @@
|
|
|
10781
10781
|
"name": "string"
|
|
10782
10782
|
}
|
|
10783
10783
|
},
|
|
10784
|
-
"rightIcon": {
|
|
10785
|
-
"defaultValue": {
|
|
10786
|
-
"value": ""
|
|
10787
|
-
},
|
|
10788
|
-
"description": "The right icon to be displayed.",
|
|
10789
|
-
"name": "rightIcon",
|
|
10790
|
-
"required": false,
|
|
10791
|
-
"type": {
|
|
10792
|
-
"name": "SubIcon"
|
|
10793
|
-
}
|
|
10794
|
-
},
|
|
10795
|
-
"rightIconType": {
|
|
10796
|
-
"defaultValue": null,
|
|
10797
|
-
"description": "The type of right icon.",
|
|
10798
|
-
"name": "rightIconType",
|
|
10799
|
-
"required": false,
|
|
10800
|
-
"type": {
|
|
10801
|
-
"name": "enum",
|
|
10802
|
-
"raw": "IconType",
|
|
10803
|
-
"value": [
|
|
10804
|
-
{
|
|
10805
|
-
"value": "\"svg\""
|
|
10806
|
-
},
|
|
10807
|
-
{
|
|
10808
|
-
"value": "\"font\""
|
|
10809
|
-
},
|
|
10810
|
-
{
|
|
10811
|
-
"value": "\"src\""
|
|
10812
|
-
}
|
|
10813
|
-
]
|
|
10814
|
-
}
|
|
10815
|
-
},
|
|
10816
|
-
"rightIconBackgroundColor": {
|
|
10817
|
-
"defaultValue": null,
|
|
10818
|
-
"description": "The background color of the right icon.",
|
|
10819
|
-
"name": "rightIconBackgroundColor",
|
|
10820
|
-
"required": false,
|
|
10821
|
-
"type": {
|
|
10822
|
-
"name": "string"
|
|
10823
|
-
}
|
|
10824
|
-
},
|
|
10825
|
-
"rightIconWrapperClassName": {
|
|
10826
|
-
"defaultValue": null,
|
|
10827
|
-
"description": "Class name applied to the icon wrapper.",
|
|
10828
|
-
"name": "rightIconWrapperClassName",
|
|
10829
|
-
"required": false,
|
|
10830
|
-
"type": {
|
|
10831
|
-
"name": "string"
|
|
10832
|
-
}
|
|
10833
|
-
},
|
|
10834
|
-
"rightIconAriaLabel": {
|
|
10835
|
-
"defaultValue": null,
|
|
10836
|
-
"description": "The label of the menu item for accessibility.",
|
|
10837
|
-
"name": "rightIconAriaLabel",
|
|
10838
|
-
"required": false,
|
|
10839
|
-
"type": {
|
|
10840
|
-
"name": "string"
|
|
10841
|
-
}
|
|
10842
|
-
},
|
|
10843
10784
|
"disabled": {
|
|
10844
10785
|
"defaultValue": {
|
|
10845
10786
|
"value": "false"
|
|
@@ -28,26 +28,6 @@ export interface MenuItemProps extends VibeComponentProps {
|
|
|
28
28
|
* The background color of the icon.
|
|
29
29
|
*/
|
|
30
30
|
iconBackgroundColor?: string;
|
|
31
|
-
/**
|
|
32
|
-
* The right icon to be displayed.
|
|
33
|
-
*/
|
|
34
|
-
rightIcon?: SubIcon;
|
|
35
|
-
/**
|
|
36
|
-
* The type of right icon.
|
|
37
|
-
*/
|
|
38
|
-
rightIconType?: IconType;
|
|
39
|
-
/**
|
|
40
|
-
* The background color of the right icon.
|
|
41
|
-
*/
|
|
42
|
-
rightIconBackgroundColor?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Class name applied to the icon wrapper.
|
|
45
|
-
*/
|
|
46
|
-
rightIconWrapperClassName?: string;
|
|
47
|
-
/**
|
|
48
|
-
* The label of the menu item for accessibility.
|
|
49
|
-
*/
|
|
50
|
-
rightIconAriaLabel?: AriaAttributes["aria-label"];
|
|
51
31
|
/**
|
|
52
32
|
* If true, the menu item is disabled.
|
|
53
33
|
*/
|
package/dist/mocked_classnames/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type MenuItemIconProps } from "./MenuItemIcon.types";
|
|
3
|
-
declare const MenuItemIcon: ({ icon,
|
|
3
|
+
declare const MenuItemIcon: ({ icon, type, label, disabled, selected, backgroundColor, wrapperClassName }: MenuItemIconProps) => React.JSX.Element;
|
|
4
4
|
export default MenuItemIcon;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import o,{forwardRef as t,useRef as i,useMemo as
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import o,{forwardRef as t,useRef as i,useMemo as s}from"react";import l from"../../Tooltip/Tooltip.js";import n from"../../../hooks/useIsOverflowing/useIsOverflowing.js";import{withStaticProps as r}from"../../../types/withStaticProps.js";import"../../../utils/colors-vars-map.js";import a from"../../Label/Label.js";import c from"./MenuItem.module.scss.js";import p from"./components/BaseMenuItem/BaseMenuItem.js";import m from"./components/MenuItemIcon/MenuItemIcon.js";import{TooltipPositions as d}from"../../Tooltip/TooltipConstants.js";import u from"../../../../components/icon/dist/Icon/Icon.js";var f=t((function(t,r){var d=t.className,u=t.iconWrapperClassName,f=t.title,b=void 0===f?"":f,v=t.label,j=void 0===v?"":v,y=t.icon,I=void 0===y?"":y,g=t.iconType,C=t.iconBackgroundColor,h=t.disabled,k=void 0!==h&&h,w=t.disableReason,M=t.selected,N=void 0!==M&&M,T=t.key,E=t.children,P=t.tooltipContent,O=t.tooltipPosition,B=void 0===O?"right":O,S=t.tooltipShowDelay,D=void 0===S?300:S,x=t.tooltipProps,L=t["aria-label"],R=e(t,["className","iconWrapperClassName","title","label","icon","iconType","iconBackgroundColor","disabled","disableReason","selected","key","children","tooltipContent","tooltipPosition","tooltipShowDelay","tooltipProps","aria-label"]),W=i(),_=null!=L?L:b,V=n({ref:W})||k||P,q=s((function(){return k?w:P||b}),[w,k,b,P]),z=s((function(){if(j)return"string"==typeof j?o.createElement(a,{kind:"line",text:j}):o.isValidElement(j)&&j.type===a?j:void 0}),[j]);return o.createElement(l,Object.assign({content:V?q:null,position:B,showDelay:D},x),o.createElement(p,Object.assign({key:T,ref:r,subMenu:E,className:d,disabled:k,selected:N},R),!!I&&o.createElement(m,{icon:I,type:g,label:_,disabled:k,selected:N,backgroundColor:C,wrapperClassName:u}),o.createElement("div",{ref:W,className:c.title},b),z))}));Object.assign(f,{isSelectable:!0,isMenuChild:!0});var b=r(f,{iconType:u.type,tooltipPositions:d});export{b as default};
|
|
2
2
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../../../../src/components/Menu/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { type AriaAttributes, type ForwardedRef, type ReactElement, forwardRef, useMemo, useRef } from \"react\";\nimport Tooltip, { type TooltipProps } from \"../../../components/Tooltip/Tooltip\";\nimport { type IconType, Icon, type SubIcon } from \"@vibe/icon\";\nimport useIsOverflowing from \"../../../hooks/useIsOverflowing/useIsOverflowing\";\nimport { type VibeComponentProps, withStaticProps } from \"../../../types\";\nimport { type CloseMenuOption, type MenuChild } from \"../Menu/MenuConstants\";\nimport Label from \"../../Label/Label\";\nimport styles from \"./MenuItem.module.scss\";\nimport BaseMenuItem from \"./components/BaseMenuItem/BaseMenuItem\";\nimport MenuItemIcon from \"./components/MenuItemIcon/MenuItemIcon\";\nimport { type TooltipPositions } from \"../../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../../Tooltip/TooltipConstants\";\nimport { type SubmenuPosition } from \"./MenuItem.types\";\nimport Flex from \"../../Flex/Flex\";\n\nexport interface MenuItemProps extends VibeComponentProps {\n /**\n * The title of the menu item.\n */\n title?: string;\n /**\n * The label displayed alongside the title.\n */\n label?: string | React.ReactElement<typeof Label>;\n /**\n * The icon displayed in the menu item.\n */\n icon?: SubIcon;\n /**\n * The type of icon.\n */\n iconType?: IconType;\n /**\n * The background color of the icon.\n */\n iconBackgroundColor?: string;\n /**\n * The right icon to be displayed.\n */\n rightIcon?: SubIcon;\n /**\n * The type of right icon.\n */\n rightIconType?: IconType;\n /**\n * The background color of the right icon.\n */\n rightIconBackgroundColor?: string;\n /**\n * Class name applied to the icon wrapper.\n */\n rightIconWrapperClassName?: string;\n /**\n * The label of the menu item for accessibility.\n */\n rightIconAriaLabel?: AriaAttributes[\"aria-label\"];\n /**\n * If true, the menu item is disabled.\n */\n disabled?: boolean;\n /**\n * The reason for disabling the item, shown in a tooltip.\n */\n disableReason?: string;\n /**\n * If true, the menu item is selected.\n */\n selected?: boolean;\n /**\n * Callback fired when the menu item is clicked.\n */\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n /**\n * The active item index in the menu.\n */\n activeItemIndex?: number;\n /**\n * Callback to set the active item index.\n */\n setActiveItemIndex?: (index: number) => void;\n /**\n * The index of the menu item.\n */\n index?: number;\n /**\n * The key of the menu item.\n */\n key?: string;\n /**\n * If true, the parent menu is visible.\n */\n isParentMenuVisible?: boolean;\n /**\n * Callback to reset the open submenu index.\n */\n resetOpenSubMenuIndex?: () => void;\n /**\n * If true, a submenu is open.\n */\n hasOpenSubMenu?: boolean;\n /**\n * Callback to open or close a submenu by index.\n */\n setSubMenuIsOpenByIndex?: (index: number, isOpen: boolean) => void;\n /**\n * If true, document event listeners are used for handling interactions.\n */\n useDocumentEventListeners?: boolean;\n /**\n * The tooltip content for the menu item.\n */\n tooltipContent?: string;\n /**\n * The position of the tooltip.\n */\n tooltipPosition?: TooltipPositions;\n /**\n * The delay in milliseconds before the tooltip shows.\n */\n tooltipShowDelay?: number;\n /**\n * Additional props for customizing the tooltip.\n */\n tooltipProps?: Partial<TooltipProps>;\n /**\n * Callback fired when the mouse leaves the item.\n */\n onMouseLeave?: (event: React.MouseEvent) => void;\n /**\n * Callback fired when the mouse enters the item.\n */\n onMouseEnter?: (event: React.MouseEvent) => void;\n /**\n * Class name applied to the icon wrapper.\n */\n iconWrapperClassName?: string;\n /**\n * If true, the menu item starts as selected.\n */\n isInitialSelectedState?: boolean;\n /**\n * If true, the menu scrolls to ensure visibility.\n */\n shouldScrollMenu?: boolean;\n /**\n * Function to close the menu with a given option.\n */\n closeMenu?: (option: CloseMenuOption) => void;\n /**\n * Reference to the menu container.\n */\n menuRef?: React.RefObject<HTMLElement>;\n /**\n * The submenu items, if applicable.\n */\n children?: MenuChild | MenuChild[];\n /**\n * If true, enables a split menu item interaction where the main area triggers an action,\n * while the icon button opens the submenu.\n */\n splitMenuItem?: boolean;\n /**\n * The label of the menu item for accessibility.\n */\n \"aria-label\"?: AriaAttributes[\"aria-label\"];\n /**\n * The position of a submenu relative to the menu item.\n */\n submenuPosition?: SubmenuPosition;\n /**\n * If true, automatically repositions the submenu when its content changes.\n */\n autoAdjustOnSubMenuContentResize?: boolean;\n}\n\nexport interface MenuItemTitleComponentProps extends Omit<MenuItemProps, \"title\"> {\n title: ReactElement;\n \"aria-label\": NonNullable<AriaAttributes[\"aria-label\"]>;\n}\n\nconst MenuItem = forwardRef(\n (\n {\n className,\n iconWrapperClassName,\n rightIconWrapperClassName,\n title = \"\",\n label = \"\",\n icon = \"\",\n rightIcon = \"\",\n rightIconType,\n rightIconBackgroundColor,\n rightIconAriaLabel,\n iconType,\n iconBackgroundColor,\n disabled = false,\n disableReason,\n selected = false,\n key,\n children,\n tooltipContent,\n tooltipPosition = \"right\",\n tooltipShowDelay = 300,\n tooltipProps,\n \"aria-label\": ariaLabel,\n ...baseMenuProps\n }: MenuItemProps | MenuItemTitleComponentProps,\n ref: ForwardedRef<HTMLElement>\n ) => {\n const titleRef = useRef();\n\n // if \"title\" is a component ariaLabel is mandatory\n const iconLabel = ariaLabel ?? (title as string);\n const rightIconLabel = rightIconAriaLabel ?? (title as string);\n\n const isTitleHoveredAndOverflowing = useIsOverflowing({ ref: titleRef });\n const shouldShowTooltip = isTitleHoveredAndOverflowing || disabled || tooltipContent;\n\n const finalTooltipContent = useMemo(() => {\n if (disabled) return disableReason;\n if (tooltipContent) return tooltipContent;\n return title;\n }, [disableReason, disabled, title, tooltipContent]);\n\n const renderLabel = useMemo(() => {\n if (!label) return;\n if (typeof label === \"string\") {\n return <Label kind=\"line\" text={label} />;\n }\n if (React.isValidElement(label) && label.type === Label) {\n return label;\n }\n }, [label]);\n\n return (\n <Tooltip\n content={shouldShowTooltip ? finalTooltipContent : null}\n position={tooltipPosition}\n showDelay={tooltipShowDelay}\n {...tooltipProps}\n >\n <BaseMenuItem\n key={key}\n ref={ref}\n subMenu={children}\n className={className}\n disabled={disabled}\n selected={selected}\n {...baseMenuProps}\n >\n {Boolean(icon) && (\n <MenuItemIcon\n icon={icon}\n type={iconType}\n label={iconLabel}\n disabled={disabled}\n selected={selected}\n backgroundColor={iconBackgroundColor}\n wrapperClassName={iconWrapperClassName}\n />\n )}\n <div ref={titleRef} className={styles.title}>\n {title}\n </div>\n <Flex gap=\"xs\">\n {Boolean(rightIcon) && !children && (\n <MenuItemIcon\n icon={rightIcon}\n type={rightIconType}\n label={rightIconLabel}\n disabled={disabled}\n selected={selected}\n backgroundColor={rightIconBackgroundColor}\n isRightIcon={true}\n wrapperClassName={rightIconWrapperClassName}\n />\n )}\n {renderLabel}\n </Flex>\n </BaseMenuItem>\n </Tooltip>\n );\n }\n);\n\nObject.assign(MenuItem, {\n isSelectable: true,\n isMenuChild: true\n});\n\ninterface MenuItemStaticProps {\n iconType: typeof Icon.type;\n tooltipPositions: typeof TooltipPositionsEnum;\n}\n\nexport default withStaticProps<MenuItemProps | MenuItemTitleComponentProps, MenuItemStaticProps>(MenuItem, {\n iconType: Icon.type,\n tooltipPositions: TooltipPositionsEnum\n});\n"],"names":["MenuItem","forwardRef","_a","ref","className","iconWrapperClassName","rightIconWrapperClassName","_a$title","title","_a$label","label","_a$icon","icon","_a$rightIcon","rightIcon","rightIconType","rightIconBackgroundColor","rightIconAriaLabel","iconType","iconBackgroundColor","_a$disabled","disabled","disableReason","_a$selected","selected","key","children","tooltipContent","_a$tooltipPosition","tooltipPosition","_a$tooltipShowDelay","tooltipShowDelay","tooltipProps","ariaLabel","baseMenuProps","__rest","titleRef","useRef","iconLabel","rightIconLabel","shouldShowTooltip","useIsOverflowing","finalTooltipContent","useMemo","renderLabel","React","createElement","Label","kind","text","isValidElement","type","Tooltip","Object","assign","content","position","showDelay","BaseMenuItem","subMenu","MenuItemIcon","backgroundColor","wrapperClassName","styles","Flex","gap","isRightIcon","isSelectable","isMenuChild","withStaticProps","Icon","tooltipPositions","TooltipPositionsEnum"],"mappings":"mrBAoLA,IAAMA,EAAWC,GACf,SACEC,EAyBAC,GAzBA,IACEC,EAuB4CF,EAvB5CE,UACAC,EAsB4CH,EAtB5CG,qBACAC,EAqB4CJ,EArB5CI,0BAAyBC,EAqBmBL,EApB5CM,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAoBkCP,EAnB5CQ,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAmBkCT,EAlB5CU,KAAAA,OAAO,IAAHD,EAAG,GAAEA,EAAAE,EAkBmCX,EAjB5CY,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EACdE,EAgB4Cb,EAhB5Ca,cACAC,EAe4Cd,EAf5Cc,yBACAC,EAc4Cf,EAd5Ce,mBACAC,EAa4ChB,EAb5CgB,SACAC,EAY4CjB,EAZ5CiB,oBAAmBC,EAYyBlB,EAX5CmB,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAU4CpB,EAV5CoB,cAAaC,EAU+BrB,EAT5CsB,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAQ4CvB,EAR5CuB,IACAC,EAO4CxB,EAP5CwB,SACAC,EAM4CzB,EAN5CyB,eAAcC,EAM8B1B,EAL5C2B,gBAAAA,OAAkB,IAAHD,EAAG,QAAOA,EAAAE,EAKmB5B,EAJ5C6B,iBAAAA,OAAmB,IAAHD,EAAG,IAAGA,EACtBE,EAG4C9B,EAH5C8B,aACcC,EAE8B/B,EAF5C,cACGgC,EAAaC,EAAAjC,EAvBlB,+UA2BMkC,EAAWC,IAGXC,EAAYL,QAAAA,EAAczB,EAC1B+B,EAAiBtB,QAAAA,EAAuBT,EAGxCgC,EAD+BC,EAAiB,CAAEtC,IAAKiC,KACHf,GAAYM,EAEhEe,EAAsBC,GAAQ,WAClC,OAAItB,EAAiBC,EACjBK,GACGnB,CACR,GAAE,CAACc,EAAeD,EAAUb,EAAOmB,IAE9BiB,EAAcD,GAAQ,WAC1B,GAAKjC,EACL,MAAqB,iBAAVA,EACFmC,EAAAC,cAACC,EAAK,CAACC,KAAK,OAAOC,KAAMvC,IAE9BmC,EAAMK,eAAexC,IAAUA,EAAMyC,OAASJ,EACzCrC,OADT,CAGF,GAAG,CAACA,IAEJ,OACEmC,EAACC,cAAAM,EACCC,OAAAC,OAAA,CAAAC,QAASf,EAAoBE,EAAsB,KACnDc,SAAU3B,EACV4B,UAAW1B,GACPC,GAEJa,EAACC,cAAAY,EACCL,OAAAC,OAAA,CAAA7B,IAAKA,EACLtB,IAAKA,EACLwD,QAASjC,EACTtB,UAAWA,EACXiB,SAAUA,EACVG,SAAUA,GACNU,KAEKtB,GACPiC,gBAACe,EAAY,CACXhD,KAAMA,EACNuC,KAAMjC,EACNR,MAAO4B,EACPjB,SAAUA,EACVG,SAAUA,EACVqC,gBAAiB1C,EACjB2C,iBAAkBzD,IAGtBwC,EAAKC,cAAA,MAAA,CAAA3C,IAAKiC,EAAUhC,UAAW2D,EAAOvD,OACnCA,GAEHqC,EAAAC,cAACkB,EAAI,CAACC,IAAI,QACCnD,IAAeY,GACtBmB,EAAAC,cAACc,EACC,CAAAhD,KAAME,EACNqC,KAAMpC,EACNL,MAAO6B,EACPlB,SAAUA,EACVG,SAAUA,EACVqC,gBAAiB7C,EACjBkD,aAAa,EACbJ,iBAAkBxD,IAGrBsC,IAKX,IAGFS,OAAOC,OAAOtD,EAAU,CACtBmE,cAAc,EACdC,aAAa,IAQf,IAAeC,EAAAA,EAAkFrE,EAAU,CACzGkB,SAAUoD,EAAKnB,KACfoB,iBAAkBC"}
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../../../src/components/Menu/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { type AriaAttributes, type ForwardedRef, type ReactElement, forwardRef, useMemo, useRef } from \"react\";\nimport Tooltip, { type TooltipProps } from \"../../../components/Tooltip/Tooltip\";\nimport { type IconType, Icon, type SubIcon } from \"@vibe/icon\";\nimport useIsOverflowing from \"../../../hooks/useIsOverflowing/useIsOverflowing\";\nimport { type VibeComponentProps, withStaticProps } from \"../../../types\";\nimport { type CloseMenuOption, type MenuChild } from \"../Menu/MenuConstants\";\nimport Label from \"../../Label/Label\";\nimport styles from \"./MenuItem.module.scss\";\nimport BaseMenuItem from \"./components/BaseMenuItem/BaseMenuItem\";\nimport MenuItemIcon from \"./components/MenuItemIcon/MenuItemIcon\";\nimport { type TooltipPositions } from \"../../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../../Tooltip/TooltipConstants\";\nimport { type SubmenuPosition } from \"./MenuItem.types\";\n\nexport interface MenuItemProps extends VibeComponentProps {\n /**\n * The title of the menu item.\n */\n title?: string;\n /**\n * The label displayed alongside the title.\n */\n label?: string | React.ReactElement<typeof Label>;\n /**\n * The icon displayed in the menu item.\n */\n icon?: SubIcon;\n /**\n * The type of icon.\n */\n iconType?: IconType;\n /**\n * The background color of the icon.\n */\n iconBackgroundColor?: string;\n /**\n * If true, the menu item is disabled.\n */\n disabled?: boolean;\n /**\n * The reason for disabling the item, shown in a tooltip.\n */\n disableReason?: string;\n /**\n * If true, the menu item is selected.\n */\n selected?: boolean;\n /**\n * Callback fired when the menu item is clicked.\n */\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n /**\n * The active item index in the menu.\n */\n activeItemIndex?: number;\n /**\n * Callback to set the active item index.\n */\n setActiveItemIndex?: (index: number) => void;\n /**\n * The index of the menu item.\n */\n index?: number;\n /**\n * The key of the menu item.\n */\n key?: string;\n /**\n * If true, the parent menu is visible.\n */\n isParentMenuVisible?: boolean;\n /**\n * Callback to reset the open submenu index.\n */\n resetOpenSubMenuIndex?: () => void;\n /**\n * If true, a submenu is open.\n */\n hasOpenSubMenu?: boolean;\n /**\n * Callback to open or close a submenu by index.\n */\n setSubMenuIsOpenByIndex?: (index: number, isOpen: boolean) => void;\n /**\n * If true, document event listeners are used for handling interactions.\n */\n useDocumentEventListeners?: boolean;\n /**\n * The tooltip content for the menu item.\n */\n tooltipContent?: string;\n /**\n * The position of the tooltip.\n */\n tooltipPosition?: TooltipPositions;\n /**\n * The delay in milliseconds before the tooltip shows.\n */\n tooltipShowDelay?: number;\n /**\n * Additional props for customizing the tooltip.\n */\n tooltipProps?: Partial<TooltipProps>;\n /**\n * Callback fired when the mouse leaves the item.\n */\n onMouseLeave?: (event: React.MouseEvent) => void;\n /**\n * Callback fired when the mouse enters the item.\n */\n onMouseEnter?: (event: React.MouseEvent) => void;\n /**\n * Class name applied to the icon wrapper.\n */\n iconWrapperClassName?: string;\n /**\n * If true, the menu item starts as selected.\n */\n isInitialSelectedState?: boolean;\n /**\n * If true, the menu scrolls to ensure visibility.\n */\n shouldScrollMenu?: boolean;\n /**\n * Function to close the menu with a given option.\n */\n closeMenu?: (option: CloseMenuOption) => void;\n /**\n * Reference to the menu container.\n */\n menuRef?: React.RefObject<HTMLElement>;\n /**\n * The submenu items, if applicable.\n */\n children?: MenuChild | MenuChild[];\n /**\n * If true, enables a split menu item interaction where the main area triggers an action,\n * while the icon button opens the submenu.\n */\n splitMenuItem?: boolean;\n /**\n * The label of the menu item for accessibility.\n */\n \"aria-label\"?: AriaAttributes[\"aria-label\"];\n /**\n * The position of a submenu relative to the menu item.\n */\n submenuPosition?: SubmenuPosition;\n /**\n * If true, automatically repositions the submenu when its content changes.\n */\n autoAdjustOnSubMenuContentResize?: boolean;\n}\n\nexport interface MenuItemTitleComponentProps extends Omit<MenuItemProps, \"title\"> {\n title: ReactElement;\n \"aria-label\": NonNullable<AriaAttributes[\"aria-label\"]>;\n}\n\nconst MenuItem = forwardRef(\n (\n {\n className,\n iconWrapperClassName,\n title = \"\",\n label = \"\",\n icon = \"\",\n iconType,\n iconBackgroundColor,\n disabled = false,\n disableReason,\n selected = false,\n key,\n children,\n tooltipContent,\n tooltipPosition = \"right\",\n tooltipShowDelay = 300,\n tooltipProps,\n \"aria-label\": ariaLabel,\n ...baseMenuProps\n }: MenuItemProps | MenuItemTitleComponentProps,\n ref: ForwardedRef<HTMLElement>\n ) => {\n const titleRef = useRef();\n\n // if \"title\" is a component ariaLabel is mandatory\n const iconLabel = ariaLabel ?? (title as string);\n\n const isTitleHoveredAndOverflowing = useIsOverflowing({ ref: titleRef });\n const shouldShowTooltip = isTitleHoveredAndOverflowing || disabled || tooltipContent;\n\n const finalTooltipContent = useMemo(() => {\n if (disabled) return disableReason;\n if (tooltipContent) return tooltipContent;\n return title;\n }, [disableReason, disabled, title, tooltipContent]);\n\n const renderLabel = useMemo(() => {\n if (!label) return;\n if (typeof label === \"string\") {\n return <Label kind=\"line\" text={label} />;\n }\n if (React.isValidElement(label) && label.type === Label) {\n return label;\n }\n }, [label]);\n\n return (\n <Tooltip\n content={shouldShowTooltip ? finalTooltipContent : null}\n position={tooltipPosition}\n showDelay={tooltipShowDelay}\n {...tooltipProps}\n >\n <BaseMenuItem\n key={key}\n ref={ref}\n subMenu={children}\n className={className}\n disabled={disabled}\n selected={selected}\n {...baseMenuProps}\n >\n {Boolean(icon) && (\n <MenuItemIcon\n icon={icon}\n type={iconType}\n label={iconLabel}\n disabled={disabled}\n selected={selected}\n backgroundColor={iconBackgroundColor}\n wrapperClassName={iconWrapperClassName}\n />\n )}\n <div ref={titleRef} className={styles.title}>\n {title}\n </div>\n {renderLabel}\n </BaseMenuItem>\n </Tooltip>\n );\n }\n);\n\nObject.assign(MenuItem, {\n isSelectable: true,\n isMenuChild: true\n});\n\ninterface MenuItemStaticProps {\n iconType: typeof Icon.type;\n tooltipPositions: typeof TooltipPositionsEnum;\n}\n\nexport default withStaticProps<MenuItemProps | MenuItemTitleComponentProps, MenuItemStaticProps>(MenuItem, {\n iconType: Icon.type,\n tooltipPositions: TooltipPositionsEnum\n});\n"],"names":["MenuItem","forwardRef","_a","ref","className","iconWrapperClassName","_a$title","title","_a$label","label","_a$icon","icon","iconType","iconBackgroundColor","_a$disabled","disabled","disableReason","_a$selected","selected","key","children","tooltipContent","_a$tooltipPosition","tooltipPosition","_a$tooltipShowDelay","tooltipShowDelay","tooltipProps","ariaLabel","baseMenuProps","__rest","titleRef","useRef","iconLabel","shouldShowTooltip","useIsOverflowing","finalTooltipContent","useMemo","renderLabel","React","createElement","Label","kind","text","isValidElement","type","Tooltip","Object","assign","content","position","showDelay","BaseMenuItem","subMenu","MenuItemIcon","backgroundColor","wrapperClassName","styles","isSelectable","isMenuChild","withStaticProps","Icon","tooltipPositions","TooltipPositionsEnum"],"mappings":"ipBA+JA,IAAMA,EAAWC,GACf,SACEC,EAoBAC,OAnBEC,EAgBuBF,EAhBvBE,UACAC,EAeuBH,EAfvBG,qBAAoBC,EAeGJ,EAdvBK,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAcaN,EAbvBO,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAaaR,EAZvBS,KAAAA,OAAO,IAAHD,EAAG,GAAEA,EACTE,EAWuBV,EAXvBU,SACAC,EAUuBX,EAVvBW,oBAAmBC,EAUIZ,EATvBa,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAQuBd,EARvBc,cAAaC,EAQUf,EAPvBgB,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAMuBjB,EANvBiB,IACAC,EAKuBlB,EALvBkB,SACAC,EAIuBnB,EAJvBmB,eAAcC,EAISpB,EAHvBqB,gBAAAA,OAAkB,IAAHD,EAAG,QAAOA,EAAAE,EAGFtB,EAFvBuB,iBAAAA,OAAmB,IAAHD,EAAG,IAAGA,EACtBE,EACuBxB,EADvBwB,aACcC,EAASzB,EAAvB,cACG0B,EAlBLC,EAAA3B,EAAA,CAAA,YAAA,uBAAA,QAAA,QAAA,OAAA,WAAA,sBAAA,WAAA,gBAAA,WAAA,MAAA,WAAA,iBAAA,kBAAA,mBAAA,eAAA,eAsBM4B,EAAWC,IAGXC,EAAYL,QAAAA,EAAcpB,EAG1B0B,EAD+BC,EAAiB,CAAE/B,IAAK2B,KACHf,GAAYM,EAEhEc,EAAsBC,GAAQ,WAClC,OAAIrB,EAAiBC,EACjBK,GACGd,CACR,GAAE,CAACS,EAAeD,EAAUR,EAAOc,IAE9BgB,EAAcD,GAAQ,WAC1B,GAAK3B,EACL,MAAqB,iBAAVA,EACF6B,EAAAC,cAACC,EAAK,CAACC,KAAK,OAAOC,KAAMjC,IAE9B6B,EAAMK,eAAelC,IAAUA,EAAMmC,OAASJ,EACzC/B,OADT,CAGF,GAAG,CAACA,IAEJ,OACE6B,EAACC,cAAAM,EACCC,OAAAC,OAAA,CAAAC,QAASf,EAAoBE,EAAsB,KACnDc,SAAU1B,EACV2B,UAAWzB,GACPC,GAEJY,EAACC,cAAAY,EACCL,OAAAC,OAAA,CAAA5B,IAAKA,EACLhB,IAAKA,EACLiD,QAAShC,EACThB,UAAWA,EACXW,SAAUA,EACVG,SAAUA,GACNU,KAEKjB,GACP2B,gBAACe,EAAY,CACX1C,KAAMA,EACNiC,KAAMhC,EACNH,MAAOuB,EACPjB,SAAUA,EACVG,SAAUA,EACVoC,gBAAiBzC,EACjB0C,iBAAkBlD,IAGtBiC,EAAKC,cAAA,MAAA,CAAApC,IAAK2B,EAAU1B,UAAWoD,EAAOjD,OACnCA,GAEF8B,GAIT,IAGFS,OAAOC,OAAO/C,EAAU,CACtByD,cAAc,EACdC,aAAa,IAQf,IAAeC,EAAAA,EAAkF3D,EAAU,CACzGY,SAAUgD,EAAKhB,KACfiB,iBAAkBC"}
|
package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineProperty as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import o from"react";import r from"../../../../Flex/Flex.js";import t from"classnames";import
|
|
1
|
+
import{defineProperty as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import o from"react";import r from"../../../../Flex/Flex.js";import t from"classnames";import s from"./MenuItemIcon.module.scss.js";import n from"../../../../../../components/icon/dist/Icon/Icon.js";var c=function(c){var a=c.icon,i=c.type,l=c.disabled,m=c.selected,p=c.backgroundColor,u=c.wrapperClassName;return o.createElement(r,{justify:"center",className:t(s.iconWrapper,e(e({},s.disabled,l),s.withBackgroundColor,!!p),u),style:Object.assign({},p&&{backgroundColor:p})},o.createElement(n,{iconType:i||("function"==typeof a?"svg":"font"),icon:a,className:t(s.icon,e({},s.selected,!l&&m)),ignoreFocusStyle:!0,iconSize:18}))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=MenuItemIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemIcon.js","sources":["../../../../../../../../src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon } from \"@vibe/icon\";\nimport Flex from \"../../../../Flex/Flex\";\nimport cx from \"classnames\";\nimport styles from \"./MenuItemIcon.module.scss\";\nimport { type MenuItemIconProps } from \"./MenuItemIcon.types\";\n\nconst MenuItemIcon = ({\n icon,\n
|
|
1
|
+
{"version":3,"file":"MenuItemIcon.js","sources":["../../../../../../../../src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon } from \"@vibe/icon\";\nimport Flex from \"../../../../Flex/Flex\";\nimport cx from \"classnames\";\nimport styles from \"./MenuItemIcon.module.scss\";\nimport { type MenuItemIconProps } from \"./MenuItemIcon.types\";\n\nconst MenuItemIcon = ({\n icon,\n type,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n disabled,\n selected,\n backgroundColor,\n wrapperClassName\n}: MenuItemIconProps) => (\n <Flex\n justify=\"center\"\n className={cx(\n styles.iconWrapper,\n {\n [styles.disabled]: disabled,\n [styles.withBackgroundColor]: !!backgroundColor\n },\n wrapperClassName\n )}\n style={{ ...(backgroundColor && { backgroundColor }) }}\n >\n <Icon\n iconType={type || (typeof icon === \"function\" ? \"svg\" : \"font\")}\n icon={icon}\n className={cx(styles.icon, { [styles.selected]: !disabled && selected })}\n ignoreFocusStyle\n iconSize={18}\n />\n </Flex>\n);\n\nexport default MenuItemIcon;\n"],"names":["MenuItemIcon","_ref","icon","type","disabled","selected","backgroundColor","wrapperClassName","React","createElement","Flex","justify","className","cx","styles","iconWrapper","_defineProperty","withBackgroundColor","style","Object","assign","Icon","iconType","ignoreFocusStyle","iconSize"],"mappings":"gSAOA,IAAMA,EAAe,SAAHC,GAAA,IAChBC,EAAID,EAAJC,KACAC,EAAIF,EAAJE,KAGAC,EAAQH,EAARG,SACAC,EAAQJ,EAARI,SACAC,EAAeL,EAAfK,gBACAC,EAAgBN,EAAhBM,iBAAgB,OAEhBC,EAACC,cAAAC,EACC,CAAAC,QAAQ,SACRC,UAAWC,EACTC,EAAOC,YAAWC,EAAAA,EAAA,GAEfF,EAAOV,SAAWA,GAClBU,EAAOG,sBAAwBX,GAElCC,GAEFW,MAAKC,OAAAC,OAAA,CAAA,EAAQd,GAAmB,CAAEA,gBAAAA,KAElCE,EAACC,cAAAY,EACC,CAAAC,SAAUnB,IAAyB,mBAATD,EAAsB,MAAQ,QACxDA,KAAMA,EACNU,UAAWC,EAAGC,EAAOZ,KAAIc,EAAA,GAAKF,EAAOT,UAAYD,GAAYC,IAC7DkB,kBAAgB,EAChBC,SAAU,KAEP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e={iconWrapper:"iconWrapper",withBackgroundColor:"withBackgroundColor",disabled:"disabled",icon:"icon",selected:"selected"};!function(e){const o="s_id-f26daa2191ad_3_76_0";if("undefined"!=typeof document){const n=document.head||document.getElementsByTagName("head")[0];if(n.querySelector("#"+o))return;const r=document.createElement("style");r.id=o,n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.appendChild(document.createTextNode(e))}else globalThis.injectedStyles&&(globalThis.injectedStyles[o]=e)}(".iconWrapper {\n margin-right: var(--spacing-small);\n}\n.iconWrapper.withBackgroundColor {\n border-radius: var(--spacing-xs);\n}\n.iconWrapper.withBackgroundColor.disabled {\n opacity: 0.4;\n}\n.iconWrapper.withBackgroundColor .icon {\n color: var(--text-color-on-primary);\n}\n.iconWrapper.disabled .icon {\n cursor: not-allowed;\n color: var(--disabled-text-color);\n}\n.iconWrapper .icon {\n color: var(--icon-color);\n}\n.iconWrapper .icon.selected {\n color: var(--primary-color);\n}");export{e as default};
|
|
2
2
|
//# sourceMappingURL=MenuItemIcon.module.scss.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"react";import e from"../../../../Flex/Flex.js";import o from"../../../../Text/Text.js";import n from"../../components/AttentionBoxButton/AttentionBoxButton.js";import i from"../../components/AttentionBoxLink/AttentionBoxLink.js";import s from"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton.js";import a from"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js";import
|
|
1
|
+
import t from"react";import e from"../../../../Flex/Flex.js";import o from"../../../../Text/Text.js";import n from"../../components/AttentionBoxButton/AttentionBoxButton.js";import i from"../../components/AttentionBoxLink/AttentionBoxLink.js";import s from"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton.js";import a from"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js";import r from"./AttentionBoxCompact.module.scss.js";var c=function(c){var m=c.icon,l=c.onClose,p=c.closeButtonAriaLabel,x=void 0===p?"Close":p,B=c.action,f=c.link,u=c.content,A=!(!B&&!f);return t.createElement(e,{align:"center",className:r.container},t.createElement(e,{gap:"xs",flex:"1",className:r.mainContentGroup},m&&t.createElement(a,{icon:m,iconType:c.iconType,className:r.leadingIcon}),t.createElement(o,{type:"text2",element:"string"==typeof u?"p":void 0,ellipsis:!0},u)),(A||!!l)&&t.createElement(e,{className:r.actionsGroup},f&&t.createElement(i,Object.assign({},f,{inlineText:!1})),B&&t.createElement(n,Object.assign({},B)),!!l&&t.createElement(s,{onClose:l,closeButtonAriaLabel:x})))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=AttentionBoxCompact.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttentionBoxCompact.js","sources":["../../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.tsx"],"sourcesContent":["import React from \"react\";\nimport Flex from \"../../../../Flex/Flex\";\nimport Text from \"../../../../Text/Text\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxCompact.module.scss\";\nimport type { AttentionBoxLayoutSharedProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxCompactProps = AttentionBoxLayoutSharedProps;\n\nconst AttentionBoxCompact = ({\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxCompactProps) => {\n const hasActions = !!(action || link);\n\n return (\n <Flex align=\"center\" className={styles.container}>\n <Flex gap=\"xs\" flex=\"1\" className={styles.mainContentGroup}>\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.leadingIcon} />}\n <Text type=\"text2\" element
|
|
1
|
+
{"version":3,"file":"AttentionBoxCompact.js","sources":["../../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.tsx"],"sourcesContent":["import React from \"react\";\nimport Flex from \"../../../../Flex/Flex\";\nimport Text from \"../../../../Text/Text\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxCompact.module.scss\";\nimport type { AttentionBoxLayoutSharedProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxCompactProps = AttentionBoxLayoutSharedProps;\n\nconst AttentionBoxCompact = ({\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxCompactProps) => {\n const hasActions = !!(action || link);\n\n return (\n <Flex align=\"center\" className={styles.container}>\n <Flex gap=\"xs\" flex=\"1\" className={styles.mainContentGroup}>\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.leadingIcon} />}\n <Text type=\"text2\" element={typeof content === \"string\" ? \"p\" : undefined} ellipsis>\n {content}\n </Text>\n </Flex>\n {(hasActions || !!onClose) && (\n <Flex className={styles.actionsGroup}>\n {link && <AttentionBoxLink {...link} inlineText={false} />}\n {action && <AttentionBoxButton {...action} />}\n {!!onClose && <AttentionBoxCloseButton onClose={onClose} closeButtonAriaLabel={closeButtonAriaLabel} />}\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default AttentionBoxCompact;\n"],"names":["AttentionBoxCompact","_ref","icon","onClose","_ref$closeButtonAriaL","closeButtonAriaLabel","action","link","content","hasActions","React","createElement","Flex","align","className","styles","container","gap","flex","mainContentGroup","AttentionBoxLeadingIcon","iconType","leadingIcon","Text","type","element","undefined","ellipsis","actionsGroup","AttentionBoxLink","Object","assign","inlineText","AttentionBoxButton","AttentionBoxCloseButton"],"mappings":"6cAYA,IAAMA,EAAsB,SAAHC,GAQM,IAP7BC,EAAID,EAAJC,KAEAC,EAAOF,EAAPE,QAAOC,EAAAH,EACPI,qBAAAA,OAAuB,IAAHD,EAAG,QAAOA,EAC9BE,EAAML,EAANK,OACAC,EAAIN,EAAJM,KACAC,EAAOP,EAAPO,QAEMC,KAAgBH,IAAUC,GAEhC,OACEG,EAAAC,cAACC,EAAI,CAACC,MAAM,SAASC,UAAWC,EAAOC,WACrCN,EAAAC,cAACC,EAAI,CAACK,IAAI,KAAKC,KAAK,IAAIJ,UAAWC,EAAOI,kBACvCjB,GAAQQ,EAACC,cAAAS,EAAwB,CAAAlB,KAAMA,EAAMmB,SAZ5CpB,EAARoB,SAYwEP,UAAWC,EAAOO,cACpFZ,EAACC,cAAAY,EAAK,CAAAC,KAAK,QAAQC,QAA4B,iBAAZjB,EAAuB,SAAMkB,EAAWC,UAAQ,GAChFnB,KAGHC,KAAgBN,IAChBO,EAAAC,cAACC,EAAK,CAAAE,UAAWC,EAAOa,cACrBrB,GAAQG,gBAACmB,EAAgBC,OAAAC,OAAA,CAAA,EAAKxB,EAAM,CAAAyB,YAAY,KAChD1B,GAAUI,EAAAC,cAACsB,EAAkBH,OAAAC,OAAA,CAAA,EAAKzB,MAChCH,GAAWO,gBAACwB,EAAuB,CAAC/B,QAASA,EAASE,qBAAsBA,KAKzF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineProperty as t}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import e from"react";import o from"classnames";import n from"../../../../Text/Text.js";import
|
|
1
|
+
import{defineProperty as t}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import e from"react";import o from"classnames";import n from"../../../../Text/Text.js";import i from"../../../../Flex/Flex.js";import s from"../../components/AttentionBoxButton/AttentionBoxButton.js";import a from"../../components/AttentionBoxLink/AttentionBoxLink.js";import l from"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton.js";import m from"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js";import r from"./AttentionBoxDefault.module.scss.js";var c=function(c){var p=c.title,u=c.icon,x=c.iconType,B=c.onClose,f=c.closeButtonAriaLabel,A=void 0===f?"Close":f,d=c.action,j=c.link,g=c.content,E=d||j;return e.createElement("div",{className:o(r.container,t(t(t(t({},r.hasIcon,!!u),r.hasTitle,!!p),r.hasActions,E),r.hasCloseButton,!!B))},u&&e.createElement(m,{icon:u,iconType:x,className:r.icon}),p&&e.createElement(n,{type:"text1",weight:"medium",className:r.title},p),!!B&&e.createElement(l,{onClose:B,closeButtonAriaLabel:A,className:r.closeButton}),e.createElement(n,{type:"text2",className:r.text,ellipsis:!1,element:"string"==typeof g?"p":void 0},g),E&&e.createElement(i,{gap:"medium",className:r.actions},j&&e.createElement(a,Object.assign({},j,{inlineText:!1})),d&&e.createElement(s,Object.assign({},d))))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=AttentionBoxDefault.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttentionBoxDefault.js","sources":["../../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { Text } from \"../../../../Text\";\nimport { Flex } from \"../../../../Flex\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxDefault.module.scss\";\nimport type { AttentionBoxLayoutSharedProps, AttentionBoxProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxDefaultProps = AttentionBoxLayoutSharedProps & Pick<AttentionBoxProps, \"title\">;\n\nconst AttentionBoxDefault = ({\n title,\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxDefaultProps) => {\n const hasActions = action || link;\n\n return (\n <div\n className={cx(styles.container, {\n [styles.hasIcon]: !!icon,\n [styles.hasTitle]: !!title,\n [styles.hasActions]: hasActions,\n [styles.hasCloseButton]: !!onClose\n })}\n >\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.icon} />}\n\n {title && (\n <Text type=\"text1\" weight=\"medium\" className={styles.title}>\n {title}\n </Text>\n )}\n\n {!!onClose && (\n <AttentionBoxCloseButton\n onClose={onClose}\n closeButtonAriaLabel={closeButtonAriaLabel}\n className={styles.closeButton}\n />\n )}\n\n <Text
|
|
1
|
+
{"version":3,"file":"AttentionBoxDefault.js","sources":["../../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { Text } from \"../../../../Text\";\nimport { Flex } from \"../../../../Flex\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxDefault.module.scss\";\nimport type { AttentionBoxLayoutSharedProps, AttentionBoxProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxDefaultProps = AttentionBoxLayoutSharedProps & Pick<AttentionBoxProps, \"title\">;\n\nconst AttentionBoxDefault = ({\n title,\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxDefaultProps) => {\n const hasActions = action || link;\n\n return (\n <div\n className={cx(styles.container, {\n [styles.hasIcon]: !!icon,\n [styles.hasTitle]: !!title,\n [styles.hasActions]: hasActions,\n [styles.hasCloseButton]: !!onClose\n })}\n >\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.icon} />}\n\n {title && (\n <Text type=\"text1\" weight=\"medium\" className={styles.title}>\n {title}\n </Text>\n )}\n\n {!!onClose && (\n <AttentionBoxCloseButton\n onClose={onClose}\n closeButtonAriaLabel={closeButtonAriaLabel}\n className={styles.closeButton}\n />\n )}\n\n <Text\n type=\"text2\"\n className={styles.text}\n ellipsis={false}\n element={typeof content === \"string\" ? \"p\" : undefined}\n >\n {content}\n </Text>\n\n {hasActions && (\n <Flex gap=\"medium\" className={styles.actions}>\n {link && <AttentionBoxLink {...link} inlineText={false} />}\n {action && <AttentionBoxButton {...action} />}\n </Flex>\n )}\n </div>\n );\n};\n\nexport default AttentionBoxDefault;\n"],"names":["AttentionBoxDefault","_ref","title","icon","iconType","onClose","_ref$closeButtonAriaL","closeButtonAriaLabel","action","link","content","hasActions","React","className","cx","styles","container","_defineProperty","hasIcon","hasTitle","hasCloseButton","createElement","AttentionBoxLeadingIcon","Text","type","weight","AttentionBoxCloseButton","closeButton","text","ellipsis","element","undefined","Flex","gap","actions","AttentionBoxLink","Object","assign","inlineText","AttentionBoxButton"],"mappings":"gkBAaA,IAAMA,EAAsB,SAAHC,GASM,IAR7BC,EAAKD,EAALC,MACAC,EAAIF,EAAJE,KACAC,EAAQH,EAARG,SACAC,EAAOJ,EAAPI,QAAOC,EAAAL,EACPM,qBAAAA,OAAuB,IAAHD,EAAG,QAAOA,EAC9BE,EAAMP,EAANO,OACAC,EAAIR,EAAJQ,KACAC,EAAOT,EAAPS,QAEMC,EAAaH,GAAUC,EAE7B,OACEG,uBACEC,UAAWC,EAAGC,EAAOC,UAASC,EAAAA,EAAAA,EAAAA,EAC3BF,CAAAA,EAAAA,EAAOG,UAAYf,GACnBY,EAAOI,WAAajB,GACpBa,EAAOJ,WAAaA,GACpBI,EAAOK,iBAAmBf,KAG5BF,GAAQS,EAACS,cAAAC,EAAwB,CAAAnB,KAAMA,EAAMC,SAAUA,EAAUS,UAAWE,EAAOZ,OAEnFD,GACCU,EAACS,cAAAE,GAAKC,KAAK,QAAQC,OAAO,SAASZ,UAAWE,EAAOb,OAClDA,KAIFG,GACDO,gBAACc,EAAuB,CACtBrB,QAASA,EACTE,qBAAsBA,EACtBM,UAAWE,EAAOY,cAItBf,EAAAS,cAACE,EAAI,CACHC,KAAK,QACLX,UAAWE,EAAOa,KAClBC,UAAU,EACVC,QAA4B,iBAAZpB,EAAuB,SAAMqB,GAE5CrB,GAGFC,GACCC,EAACS,cAAAW,EAAK,CAAAC,IAAI,SAASpB,UAAWE,EAAOmB,SAClCzB,GAAQG,gBAACuB,EAAgBC,OAAAC,OAAA,CAAA,EAAK5B,EAAM,CAAA6B,YAAY,KAChD9B,GAAUI,EAACS,cAAAkB,EAAuBH,OAAAC,OAAA,CAAA,EAAA7B,KAK7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import o,{forwardRef as t,useRef as i,useMemo as
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import o,{forwardRef as t,useRef as i,useMemo as s}from"react";import l from"../../Tooltip/Tooltip.js";import n from"../../../hooks/useIsOverflowing/useIsOverflowing.js";import{withStaticProps as r}from"../../../types/withStaticProps.js";import"../../../utils/colors-vars-map.js";import a from"../../Label/Label.js";import c from"./MenuItem.module.scss.js";import p from"./components/BaseMenuItem/BaseMenuItem.js";import m from"./components/MenuItemIcon/MenuItemIcon.js";import{TooltipPositions as d}from"../../Tooltip/TooltipConstants.js";import u from"../../../../components/icon/dist/Icon/Icon.js";var f=t((function(t,r){var d=t.className,u=t.iconWrapperClassName,f=t.title,b=void 0===f?"":f,v=t.label,j=void 0===v?"":v,y=t.icon,I=void 0===y?"":y,g=t.iconType,C=t.iconBackgroundColor,h=t.disabled,k=void 0!==h&&h,w=t.disableReason,M=t.selected,N=void 0!==M&&M,T=t.key,E=t.children,P=t.tooltipContent,O=t.tooltipPosition,B=void 0===O?"right":O,S=t.tooltipShowDelay,D=void 0===S?300:S,x=t.tooltipProps,L=t["aria-label"],R=e(t,["className","iconWrapperClassName","title","label","icon","iconType","iconBackgroundColor","disabled","disableReason","selected","key","children","tooltipContent","tooltipPosition","tooltipShowDelay","tooltipProps","aria-label"]),W=i(),_=null!=L?L:b,V=n({ref:W})||k||P,q=s((function(){return k?w:P||b}),[w,k,b,P]),z=s((function(){if(j)return"string"==typeof j?o.createElement(a,{kind:"line",text:j}):o.isValidElement(j)&&j.type===a?j:void 0}),[j]);return o.createElement(l,Object.assign({content:V?q:null,position:B,showDelay:D},x),o.createElement(p,Object.assign({key:T,ref:r,subMenu:E,className:d,disabled:k,selected:N},R),!!I&&o.createElement(m,{icon:I,type:g,label:_,disabled:k,selected:N,backgroundColor:C,wrapperClassName:u}),o.createElement("div",{ref:W,className:c.title},b),z))}));Object.assign(f,{isSelectable:!0,isMenuChild:!0});var b=r(f,{iconType:u.type,tooltipPositions:d});export{b as default};
|
|
2
2
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../../../src/components/Menu/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { type AriaAttributes, type ForwardedRef, type ReactElement, forwardRef, useMemo, useRef } from \"react\";\nimport Tooltip, { type TooltipProps } from \"../../../components/Tooltip/Tooltip\";\nimport { type IconType, Icon, type SubIcon } from \"@vibe/icon\";\nimport useIsOverflowing from \"../../../hooks/useIsOverflowing/useIsOverflowing\";\nimport { type VibeComponentProps, withStaticProps } from \"../../../types\";\nimport { type CloseMenuOption, type MenuChild } from \"../Menu/MenuConstants\";\nimport Label from \"../../Label/Label\";\nimport styles from \"./MenuItem.module.scss\";\nimport BaseMenuItem from \"./components/BaseMenuItem/BaseMenuItem\";\nimport MenuItemIcon from \"./components/MenuItemIcon/MenuItemIcon\";\nimport { type TooltipPositions } from \"../../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../../Tooltip/TooltipConstants\";\nimport { type SubmenuPosition } from \"./MenuItem.types\";\nimport Flex from \"../../Flex/Flex\";\n\nexport interface MenuItemProps extends VibeComponentProps {\n /**\n * The title of the menu item.\n */\n title?: string;\n /**\n * The label displayed alongside the title.\n */\n label?: string | React.ReactElement<typeof Label>;\n /**\n * The icon displayed in the menu item.\n */\n icon?: SubIcon;\n /**\n * The type of icon.\n */\n iconType?: IconType;\n /**\n * The background color of the icon.\n */\n iconBackgroundColor?: string;\n /**\n * The right icon to be displayed.\n */\n rightIcon?: SubIcon;\n /**\n * The type of right icon.\n */\n rightIconType?: IconType;\n /**\n * The background color of the right icon.\n */\n rightIconBackgroundColor?: string;\n /**\n * Class name applied to the icon wrapper.\n */\n rightIconWrapperClassName?: string;\n /**\n * The label of the menu item for accessibility.\n */\n rightIconAriaLabel?: AriaAttributes[\"aria-label\"];\n /**\n * If true, the menu item is disabled.\n */\n disabled?: boolean;\n /**\n * The reason for disabling the item, shown in a tooltip.\n */\n disableReason?: string;\n /**\n * If true, the menu item is selected.\n */\n selected?: boolean;\n /**\n * Callback fired when the menu item is clicked.\n */\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n /**\n * The active item index in the menu.\n */\n activeItemIndex?: number;\n /**\n * Callback to set the active item index.\n */\n setActiveItemIndex?: (index: number) => void;\n /**\n * The index of the menu item.\n */\n index?: number;\n /**\n * The key of the menu item.\n */\n key?: string;\n /**\n * If true, the parent menu is visible.\n */\n isParentMenuVisible?: boolean;\n /**\n * Callback to reset the open submenu index.\n */\n resetOpenSubMenuIndex?: () => void;\n /**\n * If true, a submenu is open.\n */\n hasOpenSubMenu?: boolean;\n /**\n * Callback to open or close a submenu by index.\n */\n setSubMenuIsOpenByIndex?: (index: number, isOpen: boolean) => void;\n /**\n * If true, document event listeners are used for handling interactions.\n */\n useDocumentEventListeners?: boolean;\n /**\n * The tooltip content for the menu item.\n */\n tooltipContent?: string;\n /**\n * The position of the tooltip.\n */\n tooltipPosition?: TooltipPositions;\n /**\n * The delay in milliseconds before the tooltip shows.\n */\n tooltipShowDelay?: number;\n /**\n * Additional props for customizing the tooltip.\n */\n tooltipProps?: Partial<TooltipProps>;\n /**\n * Callback fired when the mouse leaves the item.\n */\n onMouseLeave?: (event: React.MouseEvent) => void;\n /**\n * Callback fired when the mouse enters the item.\n */\n onMouseEnter?: (event: React.MouseEvent) => void;\n /**\n * Class name applied to the icon wrapper.\n */\n iconWrapperClassName?: string;\n /**\n * If true, the menu item starts as selected.\n */\n isInitialSelectedState?: boolean;\n /**\n * If true, the menu scrolls to ensure visibility.\n */\n shouldScrollMenu?: boolean;\n /**\n * Function to close the menu with a given option.\n */\n closeMenu?: (option: CloseMenuOption) => void;\n /**\n * Reference to the menu container.\n */\n menuRef?: React.RefObject<HTMLElement>;\n /**\n * The submenu items, if applicable.\n */\n children?: MenuChild | MenuChild[];\n /**\n * If true, enables a split menu item interaction where the main area triggers an action,\n * while the icon button opens the submenu.\n */\n splitMenuItem?: boolean;\n /**\n * The label of the menu item for accessibility.\n */\n \"aria-label\"?: AriaAttributes[\"aria-label\"];\n /**\n * The position of a submenu relative to the menu item.\n */\n submenuPosition?: SubmenuPosition;\n /**\n * If true, automatically repositions the submenu when its content changes.\n */\n autoAdjustOnSubMenuContentResize?: boolean;\n}\n\nexport interface MenuItemTitleComponentProps extends Omit<MenuItemProps, \"title\"> {\n title: ReactElement;\n \"aria-label\": NonNullable<AriaAttributes[\"aria-label\"]>;\n}\n\nconst MenuItem = forwardRef(\n (\n {\n className,\n iconWrapperClassName,\n rightIconWrapperClassName,\n title = \"\",\n label = \"\",\n icon = \"\",\n rightIcon = \"\",\n rightIconType,\n rightIconBackgroundColor,\n rightIconAriaLabel,\n iconType,\n iconBackgroundColor,\n disabled = false,\n disableReason,\n selected = false,\n key,\n children,\n tooltipContent,\n tooltipPosition = \"right\",\n tooltipShowDelay = 300,\n tooltipProps,\n \"aria-label\": ariaLabel,\n ...baseMenuProps\n }: MenuItemProps | MenuItemTitleComponentProps,\n ref: ForwardedRef<HTMLElement>\n ) => {\n const titleRef = useRef();\n\n // if \"title\" is a component ariaLabel is mandatory\n const iconLabel = ariaLabel ?? (title as string);\n const rightIconLabel = rightIconAriaLabel ?? (title as string);\n\n const isTitleHoveredAndOverflowing = useIsOverflowing({ ref: titleRef });\n const shouldShowTooltip = isTitleHoveredAndOverflowing || disabled || tooltipContent;\n\n const finalTooltipContent = useMemo(() => {\n if (disabled) return disableReason;\n if (tooltipContent) return tooltipContent;\n return title;\n }, [disableReason, disabled, title, tooltipContent]);\n\n const renderLabel = useMemo(() => {\n if (!label) return;\n if (typeof label === \"string\") {\n return <Label kind=\"line\" text={label} />;\n }\n if (React.isValidElement(label) && label.type === Label) {\n return label;\n }\n }, [label]);\n\n return (\n <Tooltip\n content={shouldShowTooltip ? finalTooltipContent : null}\n position={tooltipPosition}\n showDelay={tooltipShowDelay}\n {...tooltipProps}\n >\n <BaseMenuItem\n key={key}\n ref={ref}\n subMenu={children}\n className={className}\n disabled={disabled}\n selected={selected}\n {...baseMenuProps}\n >\n {Boolean(icon) && (\n <MenuItemIcon\n icon={icon}\n type={iconType}\n label={iconLabel}\n disabled={disabled}\n selected={selected}\n backgroundColor={iconBackgroundColor}\n wrapperClassName={iconWrapperClassName}\n />\n )}\n <div ref={titleRef} className={styles.title}>\n {title}\n </div>\n <Flex gap=\"xs\">\n {Boolean(rightIcon) && !children && (\n <MenuItemIcon\n icon={rightIcon}\n type={rightIconType}\n label={rightIconLabel}\n disabled={disabled}\n selected={selected}\n backgroundColor={rightIconBackgroundColor}\n isRightIcon={true}\n wrapperClassName={rightIconWrapperClassName}\n />\n )}\n {renderLabel}\n </Flex>\n </BaseMenuItem>\n </Tooltip>\n );\n }\n);\n\nObject.assign(MenuItem, {\n isSelectable: true,\n isMenuChild: true\n});\n\ninterface MenuItemStaticProps {\n iconType: typeof Icon.type;\n tooltipPositions: typeof TooltipPositionsEnum;\n}\n\nexport default withStaticProps<MenuItemProps | MenuItemTitleComponentProps, MenuItemStaticProps>(MenuItem, {\n iconType: Icon.type,\n tooltipPositions: TooltipPositionsEnum\n});\n"],"names":["MenuItem","forwardRef","_a","ref","className","iconWrapperClassName","rightIconWrapperClassName","_a$title","title","_a$label","label","_a$icon","icon","_a$rightIcon","rightIcon","rightIconType","rightIconBackgroundColor","rightIconAriaLabel","iconType","iconBackgroundColor","_a$disabled","disabled","disableReason","_a$selected","selected","key","children","tooltipContent","_a$tooltipPosition","tooltipPosition","_a$tooltipShowDelay","tooltipShowDelay","tooltipProps","ariaLabel","baseMenuProps","__rest","titleRef","useRef","iconLabel","rightIconLabel","shouldShowTooltip","useIsOverflowing","finalTooltipContent","useMemo","renderLabel","React","createElement","Label","kind","text","isValidElement","type","Tooltip","Object","assign","content","position","showDelay","BaseMenuItem","subMenu","MenuItemIcon","backgroundColor","wrapperClassName","styles","Flex","gap","isRightIcon","isSelectable","isMenuChild","withStaticProps","Icon","tooltipPositions","TooltipPositionsEnum"],"mappings":"mrBAoLA,IAAMA,EAAWC,GACf,SACEC,EAyBAC,GAzBA,IACEC,EAuB4CF,EAvB5CE,UACAC,EAsB4CH,EAtB5CG,qBACAC,EAqB4CJ,EArB5CI,0BAAyBC,EAqBmBL,EApB5CM,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAoBkCP,EAnB5CQ,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAmBkCT,EAlB5CU,KAAAA,OAAO,IAAHD,EAAG,GAAEA,EAAAE,EAkBmCX,EAjB5CY,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EACdE,EAgB4Cb,EAhB5Ca,cACAC,EAe4Cd,EAf5Cc,yBACAC,EAc4Cf,EAd5Ce,mBACAC,EAa4ChB,EAb5CgB,SACAC,EAY4CjB,EAZ5CiB,oBAAmBC,EAYyBlB,EAX5CmB,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAU4CpB,EAV5CoB,cAAaC,EAU+BrB,EAT5CsB,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAQ4CvB,EAR5CuB,IACAC,EAO4CxB,EAP5CwB,SACAC,EAM4CzB,EAN5CyB,eAAcC,EAM8B1B,EAL5C2B,gBAAAA,OAAkB,IAAHD,EAAG,QAAOA,EAAAE,EAKmB5B,EAJ5C6B,iBAAAA,OAAmB,IAAHD,EAAG,IAAGA,EACtBE,EAG4C9B,EAH5C8B,aACcC,EAE8B/B,EAF5C,cACGgC,EAAaC,EAAAjC,EAvBlB,+UA2BMkC,EAAWC,IAGXC,EAAYL,QAAAA,EAAczB,EAC1B+B,EAAiBtB,QAAAA,EAAuBT,EAGxCgC,EAD+BC,EAAiB,CAAEtC,IAAKiC,KACHf,GAAYM,EAEhEe,EAAsBC,GAAQ,WAClC,OAAItB,EAAiBC,EACjBK,GACGnB,CACR,GAAE,CAACc,EAAeD,EAAUb,EAAOmB,IAE9BiB,EAAcD,GAAQ,WAC1B,GAAKjC,EACL,MAAqB,iBAAVA,EACFmC,EAAAC,cAACC,EAAK,CAACC,KAAK,OAAOC,KAAMvC,IAE9BmC,EAAMK,eAAexC,IAAUA,EAAMyC,OAASJ,EACzCrC,OADT,CAGF,GAAG,CAACA,IAEJ,OACEmC,EAACC,cAAAM,EACCC,OAAAC,OAAA,CAAAC,QAASf,EAAoBE,EAAsB,KACnDc,SAAU3B,EACV4B,UAAW1B,GACPC,GAEJa,EAACC,cAAAY,EACCL,OAAAC,OAAA,CAAA7B,IAAKA,EACLtB,IAAKA,EACLwD,QAASjC,EACTtB,UAAWA,EACXiB,SAAUA,EACVG,SAAUA,GACNU,KAEKtB,GACPiC,gBAACe,EAAY,CACXhD,KAAMA,EACNuC,KAAMjC,EACNR,MAAO4B,EACPjB,SAAUA,EACVG,SAAUA,EACVqC,gBAAiB1C,EACjB2C,iBAAkBzD,IAGtBwC,EAAKC,cAAA,MAAA,CAAA3C,IAAKiC,EAAUhC,UAAW2D,EAAOvD,OACnCA,GAEHqC,EAAAC,cAACkB,EAAI,CAACC,IAAI,QACCnD,IAAeY,GACtBmB,EAAAC,cAACc,EACC,CAAAhD,KAAME,EACNqC,KAAMpC,EACNL,MAAO6B,EACPlB,SAAUA,EACVG,SAAUA,EACVqC,gBAAiB7C,EACjBkD,aAAa,EACbJ,iBAAkBxD,IAGrBsC,IAKX,IAGFS,OAAOC,OAAOtD,EAAU,CACtBmE,cAAc,EACdC,aAAa,IAQf,IAAeC,EAAAA,EAAkFrE,EAAU,CACzGkB,SAAUoD,EAAKnB,KACfoB,iBAAkBC"}
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../../src/components/Menu/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { type AriaAttributes, type ForwardedRef, type ReactElement, forwardRef, useMemo, useRef } from \"react\";\nimport Tooltip, { type TooltipProps } from \"../../../components/Tooltip/Tooltip\";\nimport { type IconType, Icon, type SubIcon } from \"@vibe/icon\";\nimport useIsOverflowing from \"../../../hooks/useIsOverflowing/useIsOverflowing\";\nimport { type VibeComponentProps, withStaticProps } from \"../../../types\";\nimport { type CloseMenuOption, type MenuChild } from \"../Menu/MenuConstants\";\nimport Label from \"../../Label/Label\";\nimport styles from \"./MenuItem.module.scss\";\nimport BaseMenuItem from \"./components/BaseMenuItem/BaseMenuItem\";\nimport MenuItemIcon from \"./components/MenuItemIcon/MenuItemIcon\";\nimport { type TooltipPositions } from \"../../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../../Tooltip/TooltipConstants\";\nimport { type SubmenuPosition } from \"./MenuItem.types\";\n\nexport interface MenuItemProps extends VibeComponentProps {\n /**\n * The title of the menu item.\n */\n title?: string;\n /**\n * The label displayed alongside the title.\n */\n label?: string | React.ReactElement<typeof Label>;\n /**\n * The icon displayed in the menu item.\n */\n icon?: SubIcon;\n /**\n * The type of icon.\n */\n iconType?: IconType;\n /**\n * The background color of the icon.\n */\n iconBackgroundColor?: string;\n /**\n * If true, the menu item is disabled.\n */\n disabled?: boolean;\n /**\n * The reason for disabling the item, shown in a tooltip.\n */\n disableReason?: string;\n /**\n * If true, the menu item is selected.\n */\n selected?: boolean;\n /**\n * Callback fired when the menu item is clicked.\n */\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n /**\n * The active item index in the menu.\n */\n activeItemIndex?: number;\n /**\n * Callback to set the active item index.\n */\n setActiveItemIndex?: (index: number) => void;\n /**\n * The index of the menu item.\n */\n index?: number;\n /**\n * The key of the menu item.\n */\n key?: string;\n /**\n * If true, the parent menu is visible.\n */\n isParentMenuVisible?: boolean;\n /**\n * Callback to reset the open submenu index.\n */\n resetOpenSubMenuIndex?: () => void;\n /**\n * If true, a submenu is open.\n */\n hasOpenSubMenu?: boolean;\n /**\n * Callback to open or close a submenu by index.\n */\n setSubMenuIsOpenByIndex?: (index: number, isOpen: boolean) => void;\n /**\n * If true, document event listeners are used for handling interactions.\n */\n useDocumentEventListeners?: boolean;\n /**\n * The tooltip content for the menu item.\n */\n tooltipContent?: string;\n /**\n * The position of the tooltip.\n */\n tooltipPosition?: TooltipPositions;\n /**\n * The delay in milliseconds before the tooltip shows.\n */\n tooltipShowDelay?: number;\n /**\n * Additional props for customizing the tooltip.\n */\n tooltipProps?: Partial<TooltipProps>;\n /**\n * Callback fired when the mouse leaves the item.\n */\n onMouseLeave?: (event: React.MouseEvent) => void;\n /**\n * Callback fired when the mouse enters the item.\n */\n onMouseEnter?: (event: React.MouseEvent) => void;\n /**\n * Class name applied to the icon wrapper.\n */\n iconWrapperClassName?: string;\n /**\n * If true, the menu item starts as selected.\n */\n isInitialSelectedState?: boolean;\n /**\n * If true, the menu scrolls to ensure visibility.\n */\n shouldScrollMenu?: boolean;\n /**\n * Function to close the menu with a given option.\n */\n closeMenu?: (option: CloseMenuOption) => void;\n /**\n * Reference to the menu container.\n */\n menuRef?: React.RefObject<HTMLElement>;\n /**\n * The submenu items, if applicable.\n */\n children?: MenuChild | MenuChild[];\n /**\n * If true, enables a split menu item interaction where the main area triggers an action,\n * while the icon button opens the submenu.\n */\n splitMenuItem?: boolean;\n /**\n * The label of the menu item for accessibility.\n */\n \"aria-label\"?: AriaAttributes[\"aria-label\"];\n /**\n * The position of a submenu relative to the menu item.\n */\n submenuPosition?: SubmenuPosition;\n /**\n * If true, automatically repositions the submenu when its content changes.\n */\n autoAdjustOnSubMenuContentResize?: boolean;\n}\n\nexport interface MenuItemTitleComponentProps extends Omit<MenuItemProps, \"title\"> {\n title: ReactElement;\n \"aria-label\": NonNullable<AriaAttributes[\"aria-label\"]>;\n}\n\nconst MenuItem = forwardRef(\n (\n {\n className,\n iconWrapperClassName,\n title = \"\",\n label = \"\",\n icon = \"\",\n iconType,\n iconBackgroundColor,\n disabled = false,\n disableReason,\n selected = false,\n key,\n children,\n tooltipContent,\n tooltipPosition = \"right\",\n tooltipShowDelay = 300,\n tooltipProps,\n \"aria-label\": ariaLabel,\n ...baseMenuProps\n }: MenuItemProps | MenuItemTitleComponentProps,\n ref: ForwardedRef<HTMLElement>\n ) => {\n const titleRef = useRef();\n\n // if \"title\" is a component ariaLabel is mandatory\n const iconLabel = ariaLabel ?? (title as string);\n\n const isTitleHoveredAndOverflowing = useIsOverflowing({ ref: titleRef });\n const shouldShowTooltip = isTitleHoveredAndOverflowing || disabled || tooltipContent;\n\n const finalTooltipContent = useMemo(() => {\n if (disabled) return disableReason;\n if (tooltipContent) return tooltipContent;\n return title;\n }, [disableReason, disabled, title, tooltipContent]);\n\n const renderLabel = useMemo(() => {\n if (!label) return;\n if (typeof label === \"string\") {\n return <Label kind=\"line\" text={label} />;\n }\n if (React.isValidElement(label) && label.type === Label) {\n return label;\n }\n }, [label]);\n\n return (\n <Tooltip\n content={shouldShowTooltip ? finalTooltipContent : null}\n position={tooltipPosition}\n showDelay={tooltipShowDelay}\n {...tooltipProps}\n >\n <BaseMenuItem\n key={key}\n ref={ref}\n subMenu={children}\n className={className}\n disabled={disabled}\n selected={selected}\n {...baseMenuProps}\n >\n {Boolean(icon) && (\n <MenuItemIcon\n icon={icon}\n type={iconType}\n label={iconLabel}\n disabled={disabled}\n selected={selected}\n backgroundColor={iconBackgroundColor}\n wrapperClassName={iconWrapperClassName}\n />\n )}\n <div ref={titleRef} className={styles.title}>\n {title}\n </div>\n {renderLabel}\n </BaseMenuItem>\n </Tooltip>\n );\n }\n);\n\nObject.assign(MenuItem, {\n isSelectable: true,\n isMenuChild: true\n});\n\ninterface MenuItemStaticProps {\n iconType: typeof Icon.type;\n tooltipPositions: typeof TooltipPositionsEnum;\n}\n\nexport default withStaticProps<MenuItemProps | MenuItemTitleComponentProps, MenuItemStaticProps>(MenuItem, {\n iconType: Icon.type,\n tooltipPositions: TooltipPositionsEnum\n});\n"],"names":["MenuItem","forwardRef","_a","ref","className","iconWrapperClassName","_a$title","title","_a$label","label","_a$icon","icon","iconType","iconBackgroundColor","_a$disabled","disabled","disableReason","_a$selected","selected","key","children","tooltipContent","_a$tooltipPosition","tooltipPosition","_a$tooltipShowDelay","tooltipShowDelay","tooltipProps","ariaLabel","baseMenuProps","__rest","titleRef","useRef","iconLabel","shouldShowTooltip","useIsOverflowing","finalTooltipContent","useMemo","renderLabel","React","createElement","Label","kind","text","isValidElement","type","Tooltip","Object","assign","content","position","showDelay","BaseMenuItem","subMenu","MenuItemIcon","backgroundColor","wrapperClassName","styles","isSelectable","isMenuChild","withStaticProps","Icon","tooltipPositions","TooltipPositionsEnum"],"mappings":"ipBA+JA,IAAMA,EAAWC,GACf,SACEC,EAoBAC,OAnBEC,EAgBuBF,EAhBvBE,UACAC,EAeuBH,EAfvBG,qBAAoBC,EAeGJ,EAdvBK,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAcaN,EAbvBO,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAaaR,EAZvBS,KAAAA,OAAO,IAAHD,EAAG,GAAEA,EACTE,EAWuBV,EAXvBU,SACAC,EAUuBX,EAVvBW,oBAAmBC,EAUIZ,EATvBa,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAQuBd,EARvBc,cAAaC,EAQUf,EAPvBgB,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAMuBjB,EANvBiB,IACAC,EAKuBlB,EALvBkB,SACAC,EAIuBnB,EAJvBmB,eAAcC,EAISpB,EAHvBqB,gBAAAA,OAAkB,IAAHD,EAAG,QAAOA,EAAAE,EAGFtB,EAFvBuB,iBAAAA,OAAmB,IAAHD,EAAG,IAAGA,EACtBE,EACuBxB,EADvBwB,aACcC,EAASzB,EAAvB,cACG0B,EAlBLC,EAAA3B,EAAA,CAAA,YAAA,uBAAA,QAAA,QAAA,OAAA,WAAA,sBAAA,WAAA,gBAAA,WAAA,MAAA,WAAA,iBAAA,kBAAA,mBAAA,eAAA,eAsBM4B,EAAWC,IAGXC,EAAYL,QAAAA,EAAcpB,EAG1B0B,EAD+BC,EAAiB,CAAE/B,IAAK2B,KACHf,GAAYM,EAEhEc,EAAsBC,GAAQ,WAClC,OAAIrB,EAAiBC,EACjBK,GACGd,CACR,GAAE,CAACS,EAAeD,EAAUR,EAAOc,IAE9BgB,EAAcD,GAAQ,WAC1B,GAAK3B,EACL,MAAqB,iBAAVA,EACF6B,EAAAC,cAACC,EAAK,CAACC,KAAK,OAAOC,KAAMjC,IAE9B6B,EAAMK,eAAelC,IAAUA,EAAMmC,OAASJ,EACzC/B,OADT,CAGF,GAAG,CAACA,IAEJ,OACE6B,EAACC,cAAAM,EACCC,OAAAC,OAAA,CAAAC,QAASf,EAAoBE,EAAsB,KACnDc,SAAU1B,EACV2B,UAAWzB,GACPC,GAEJY,EAACC,cAAAY,EACCL,OAAAC,OAAA,CAAA5B,IAAKA,EACLhB,IAAKA,EACLiD,QAAShC,EACThB,UAAWA,EACXW,SAAUA,EACVG,SAAUA,GACNU,KAEKjB,GACP2B,gBAACe,EAAY,CACX1C,KAAMA,EACNiC,KAAMhC,EACNH,MAAOuB,EACPjB,SAAUA,EACVG,SAAUA,EACVoC,gBAAiBzC,EACjB0C,iBAAkBlD,IAGtBiC,EAAKC,cAAA,MAAA,CAAApC,IAAK2B,EAAU1B,UAAWoD,EAAOjD,OACnCA,GAEF8B,GAIT,IAGFS,OAAOC,OAAO/C,EAAU,CACtByD,cAAc,EACdC,aAAa,IAQf,IAAeC,EAAAA,EAAkF3D,EAAU,CACzGY,SAAUgD,EAAKhB,KACfiB,iBAAkBC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineProperty as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import o from"react";import r from"../../../../Flex/Flex.js";import t from"classnames";import
|
|
1
|
+
import{defineProperty as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import o from"react";import r from"../../../../Flex/Flex.js";import t from"classnames";import s from"./MenuItemIcon.module.scss.js";import n from"../../../../../../components/icon/dist/Icon/Icon.js";var c=function(c){var a=c.icon,i=c.type,l=c.disabled,m=c.selected,p=c.backgroundColor,u=c.wrapperClassName;return o.createElement(r,{justify:"center",className:t(s.iconWrapper,e(e({},s.disabled,l),s.withBackgroundColor,!!p),u),style:Object.assign({},p&&{backgroundColor:p})},o.createElement(n,{iconType:i||("function"==typeof a?"svg":"font"),icon:a,className:t(s.icon,e({},s.selected,!l&&m)),ignoreFocusStyle:!0,iconSize:18}))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=MenuItemIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemIcon.js","sources":["../../../../../../../src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon } from \"@vibe/icon\";\nimport Flex from \"../../../../Flex/Flex\";\nimport cx from \"classnames\";\nimport styles from \"./MenuItemIcon.module.scss\";\nimport { type MenuItemIconProps } from \"./MenuItemIcon.types\";\n\nconst MenuItemIcon = ({\n icon,\n
|
|
1
|
+
{"version":3,"file":"MenuItemIcon.js","sources":["../../../../../../../src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon } from \"@vibe/icon\";\nimport Flex from \"../../../../Flex/Flex\";\nimport cx from \"classnames\";\nimport styles from \"./MenuItemIcon.module.scss\";\nimport { type MenuItemIconProps } from \"./MenuItemIcon.types\";\n\nconst MenuItemIcon = ({\n icon,\n type,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n disabled,\n selected,\n backgroundColor,\n wrapperClassName\n}: MenuItemIconProps) => (\n <Flex\n justify=\"center\"\n className={cx(\n styles.iconWrapper,\n {\n [styles.disabled]: disabled,\n [styles.withBackgroundColor]: !!backgroundColor\n },\n wrapperClassName\n )}\n style={{ ...(backgroundColor && { backgroundColor }) }}\n >\n <Icon\n iconType={type || (typeof icon === \"function\" ? \"svg\" : \"font\")}\n icon={icon}\n className={cx(styles.icon, { [styles.selected]: !disabled && selected })}\n ignoreFocusStyle\n iconSize={18}\n />\n </Flex>\n);\n\nexport default MenuItemIcon;\n"],"names":["MenuItemIcon","_ref","icon","type","disabled","selected","backgroundColor","wrapperClassName","React","createElement","Flex","justify","className","cx","styles","iconWrapper","_defineProperty","withBackgroundColor","style","Object","assign","Icon","iconType","ignoreFocusStyle","iconSize"],"mappings":"gSAOA,IAAMA,EAAe,SAAHC,GAAA,IAChBC,EAAID,EAAJC,KACAC,EAAIF,EAAJE,KAGAC,EAAQH,EAARG,SACAC,EAAQJ,EAARI,SACAC,EAAeL,EAAfK,gBACAC,EAAgBN,EAAhBM,iBAAgB,OAEhBC,EAACC,cAAAC,EACC,CAAAC,QAAQ,SACRC,UAAWC,EACTC,EAAOC,YAAWC,EAAAA,EAAA,GAEfF,EAAOV,SAAWA,GAClBU,EAAOG,sBAAwBX,GAElCC,GAEFW,MAAKC,OAAAC,OAAA,CAAA,EAAQd,GAAmB,CAAEA,gBAAAA,KAElCE,EAACC,cAAAY,EACC,CAAAC,SAAUnB,IAAyB,mBAATD,EAAsB,MAAQ,QACxDA,KAAMA,EACNU,UAAWC,EAAGC,EAAOZ,KAAIc,EAAA,GAAKF,EAAOT,UAAYD,GAAYC,IAC7DkB,kBAAgB,EAChBC,SAAU,KAEP"}
|
package/dist/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.module.scss.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var d={iconWrapper:"iconWrapper_30d38584a6",
|
|
1
|
+
var d={iconWrapper:"iconWrapper_30d38584a6",withBackgroundColor:"withBackgroundColor_9d35d4cdd5",disabled:"disabled_7d3e3763f8",icon:"icon_702fcc27dd",selected:"selected_6d198f9cb4"};!function(d){const e="s_id-f26daa2191ad_3_76_0";if("undefined"!=typeof document){const o=document.head||document.getElementsByTagName("head")[0];if(o.querySelector("#"+e))return;const n=document.createElement("style");n.id=e,o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.appendChild(document.createTextNode(d))}else globalThis.injectedStyles&&(globalThis.injectedStyles[e]=d)}(".iconWrapper_30d38584a6 {\n margin-right: var(--spacing-small);\n}\n.iconWrapper_30d38584a6.withBackgroundColor_9d35d4cdd5 {\n border-radius: var(--spacing-xs);\n}\n.iconWrapper_30d38584a6.withBackgroundColor_9d35d4cdd5.disabled_7d3e3763f8 {\n opacity: 0.4;\n}\n.iconWrapper_30d38584a6.withBackgroundColor_9d35d4cdd5 .icon_702fcc27dd {\n color: var(--text-color-on-primary);\n}\n.iconWrapper_30d38584a6.disabled_7d3e3763f8 .icon_702fcc27dd {\n cursor: not-allowed;\n color: var(--disabled-text-color);\n}\n.iconWrapper_30d38584a6 .icon_702fcc27dd {\n color: var(--icon-color);\n}\n.iconWrapper_30d38584a6 .icon_702fcc27dd.selected_6d198f9cb4 {\n color: var(--primary-color);\n}");export{d as default};
|
|
2
2
|
//# sourceMappingURL=MenuItemIcon.module.scss.js.map
|
package/dist/src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"react";import e from"../../../../Flex/Flex.js";import o from"../../../../Text/Text.js";import n from"../../components/AttentionBoxButton/AttentionBoxButton.js";import i from"../../components/AttentionBoxLink/AttentionBoxLink.js";import s from"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton.js";import a from"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js";import
|
|
1
|
+
import t from"react";import e from"../../../../Flex/Flex.js";import o from"../../../../Text/Text.js";import n from"../../components/AttentionBoxButton/AttentionBoxButton.js";import i from"../../components/AttentionBoxLink/AttentionBoxLink.js";import s from"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton.js";import a from"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js";import r from"./AttentionBoxCompact.module.scss.js";var c=function(c){var m=c.icon,l=c.onClose,p=c.closeButtonAriaLabel,x=void 0===p?"Close":p,B=c.action,f=c.link,u=c.content,A=!(!B&&!f);return t.createElement(e,{align:"center",className:r.container},t.createElement(e,{gap:"xs",flex:"1",className:r.mainContentGroup},m&&t.createElement(a,{icon:m,iconType:c.iconType,className:r.leadingIcon}),t.createElement(o,{type:"text2",element:"string"==typeof u?"p":void 0,ellipsis:!0},u)),(A||!!l)&&t.createElement(e,{className:r.actionsGroup},f&&t.createElement(i,Object.assign({},f,{inlineText:!1})),B&&t.createElement(n,Object.assign({},B)),!!l&&t.createElement(s,{onClose:l,closeButtonAriaLabel:x})))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=AttentionBoxCompact.js.map
|
package/dist/src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttentionBoxCompact.js","sources":["../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.tsx"],"sourcesContent":["import React from \"react\";\nimport Flex from \"../../../../Flex/Flex\";\nimport Text from \"../../../../Text/Text\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxCompact.module.scss\";\nimport type { AttentionBoxLayoutSharedProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxCompactProps = AttentionBoxLayoutSharedProps;\n\nconst AttentionBoxCompact = ({\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxCompactProps) => {\n const hasActions = !!(action || link);\n\n return (\n <Flex align=\"center\" className={styles.container}>\n <Flex gap=\"xs\" flex=\"1\" className={styles.mainContentGroup}>\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.leadingIcon} />}\n <Text type=\"text2\" element
|
|
1
|
+
{"version":3,"file":"AttentionBoxCompact.js","sources":["../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxCompact/AttentionBoxCompact.tsx"],"sourcesContent":["import React from \"react\";\nimport Flex from \"../../../../Flex/Flex\";\nimport Text from \"../../../../Text/Text\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxCompact.module.scss\";\nimport type { AttentionBoxLayoutSharedProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxCompactProps = AttentionBoxLayoutSharedProps;\n\nconst AttentionBoxCompact = ({\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxCompactProps) => {\n const hasActions = !!(action || link);\n\n return (\n <Flex align=\"center\" className={styles.container}>\n <Flex gap=\"xs\" flex=\"1\" className={styles.mainContentGroup}>\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.leadingIcon} />}\n <Text type=\"text2\" element={typeof content === \"string\" ? \"p\" : undefined} ellipsis>\n {content}\n </Text>\n </Flex>\n {(hasActions || !!onClose) && (\n <Flex className={styles.actionsGroup}>\n {link && <AttentionBoxLink {...link} inlineText={false} />}\n {action && <AttentionBoxButton {...action} />}\n {!!onClose && <AttentionBoxCloseButton onClose={onClose} closeButtonAriaLabel={closeButtonAriaLabel} />}\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default AttentionBoxCompact;\n"],"names":["AttentionBoxCompact","_ref","icon","onClose","_ref$closeButtonAriaL","closeButtonAriaLabel","action","link","content","hasActions","React","createElement","Flex","align","className","styles","container","gap","flex","mainContentGroup","AttentionBoxLeadingIcon","iconType","leadingIcon","Text","type","element","undefined","ellipsis","actionsGroup","AttentionBoxLink","Object","assign","inlineText","AttentionBoxButton","AttentionBoxCloseButton"],"mappings":"6cAYA,IAAMA,EAAsB,SAAHC,GAQM,IAP7BC,EAAID,EAAJC,KAEAC,EAAOF,EAAPE,QAAOC,EAAAH,EACPI,qBAAAA,OAAuB,IAAHD,EAAG,QAAOA,EAC9BE,EAAML,EAANK,OACAC,EAAIN,EAAJM,KACAC,EAAOP,EAAPO,QAEMC,KAAgBH,IAAUC,GAEhC,OACEG,EAAAC,cAACC,EAAI,CAACC,MAAM,SAASC,UAAWC,EAAOC,WACrCN,EAAAC,cAACC,EAAI,CAACK,IAAI,KAAKC,KAAK,IAAIJ,UAAWC,EAAOI,kBACvCjB,GAAQQ,EAACC,cAAAS,EAAwB,CAAAlB,KAAMA,EAAMmB,SAZ5CpB,EAARoB,SAYwEP,UAAWC,EAAOO,cACpFZ,EAACC,cAAAY,EAAK,CAAAC,KAAK,QAAQC,QAA4B,iBAAZjB,EAAuB,SAAMkB,EAAWC,UAAQ,GAChFnB,KAGHC,KAAgBN,IAChBO,EAAAC,cAACC,EAAK,CAAAE,UAAWC,EAAOa,cACrBrB,GAAQG,gBAACmB,EAAgBC,OAAAC,OAAA,CAAA,EAAKxB,EAAM,CAAAyB,YAAY,KAChD1B,GAAUI,EAAAC,cAACsB,EAAkBH,OAAAC,OAAA,CAAA,EAAKzB,MAChCH,GAAWO,gBAACwB,EAAuB,CAAC/B,QAASA,EAASE,qBAAsBA,KAKzF"}
|
package/dist/src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineProperty as t}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import e from"react";import o from"classnames";import n from"../../../../Text/Text.js";import
|
|
1
|
+
import{defineProperty as t}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import e from"react";import o from"classnames";import n from"../../../../Text/Text.js";import i from"../../../../Flex/Flex.js";import s from"../../components/AttentionBoxButton/AttentionBoxButton.js";import a from"../../components/AttentionBoxLink/AttentionBoxLink.js";import l from"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton.js";import m from"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js";import r from"./AttentionBoxDefault.module.scss.js";var c=function(c){var p=c.title,u=c.icon,x=c.iconType,B=c.onClose,f=c.closeButtonAriaLabel,A=void 0===f?"Close":f,d=c.action,j=c.link,g=c.content,E=d||j;return e.createElement("div",{className:o(r.container,t(t(t(t({},r.hasIcon,!!u),r.hasTitle,!!p),r.hasActions,E),r.hasCloseButton,!!B))},u&&e.createElement(m,{icon:u,iconType:x,className:r.icon}),p&&e.createElement(n,{type:"text1",weight:"medium",className:r.title},p),!!B&&e.createElement(l,{onClose:B,closeButtonAriaLabel:A,className:r.closeButton}),e.createElement(n,{type:"text2",className:r.text,ellipsis:!1,element:"string"==typeof g?"p":void 0},g),E&&e.createElement(i,{gap:"medium",className:r.actions},j&&e.createElement(a,Object.assign({},j,{inlineText:!1})),d&&e.createElement(s,Object.assign({},d))))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=AttentionBoxDefault.js.map
|
package/dist/src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttentionBoxDefault.js","sources":["../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { Text } from \"../../../../Text\";\nimport { Flex } from \"../../../../Flex\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxDefault.module.scss\";\nimport type { AttentionBoxLayoutSharedProps, AttentionBoxProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxDefaultProps = AttentionBoxLayoutSharedProps & Pick<AttentionBoxProps, \"title\">;\n\nconst AttentionBoxDefault = ({\n title,\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxDefaultProps) => {\n const hasActions = action || link;\n\n return (\n <div\n className={cx(styles.container, {\n [styles.hasIcon]: !!icon,\n [styles.hasTitle]: !!title,\n [styles.hasActions]: hasActions,\n [styles.hasCloseButton]: !!onClose\n })}\n >\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.icon} />}\n\n {title && (\n <Text type=\"text1\" weight=\"medium\" className={styles.title}>\n {title}\n </Text>\n )}\n\n {!!onClose && (\n <AttentionBoxCloseButton\n onClose={onClose}\n closeButtonAriaLabel={closeButtonAriaLabel}\n className={styles.closeButton}\n />\n )}\n\n <Text
|
|
1
|
+
{"version":3,"file":"AttentionBoxDefault.js","sources":["../../../../../../../src/components/next/AttentionBox/layouts/AttentionBoxDefault/AttentionBoxDefault.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { Text } from \"../../../../Text\";\nimport { Flex } from \"../../../../Flex\";\nimport AttentionBoxButton from \"../../components/AttentionBoxButton/AttentionBoxButton\";\nimport AttentionBoxLink from \"../../components/AttentionBoxLink/AttentionBoxLink\";\nimport AttentionBoxCloseButton from \"../../components/AttentionBoxCloseButton/AttentionBoxCloseButton\";\nimport AttentionBoxLeadingIcon from \"../../components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon\";\nimport styles from \"./AttentionBoxDefault.module.scss\";\nimport type { AttentionBoxLayoutSharedProps, AttentionBoxProps } from \"../../AttentionBox.types\";\n\nexport type AttentionBoxDefaultProps = AttentionBoxLayoutSharedProps & Pick<AttentionBoxProps, \"title\">;\n\nconst AttentionBoxDefault = ({\n title,\n icon,\n iconType,\n onClose,\n closeButtonAriaLabel = \"Close\",\n action,\n link,\n content\n}: AttentionBoxDefaultProps) => {\n const hasActions = action || link;\n\n return (\n <div\n className={cx(styles.container, {\n [styles.hasIcon]: !!icon,\n [styles.hasTitle]: !!title,\n [styles.hasActions]: hasActions,\n [styles.hasCloseButton]: !!onClose\n })}\n >\n {icon && <AttentionBoxLeadingIcon icon={icon} iconType={iconType} className={styles.icon} />}\n\n {title && (\n <Text type=\"text1\" weight=\"medium\" className={styles.title}>\n {title}\n </Text>\n )}\n\n {!!onClose && (\n <AttentionBoxCloseButton\n onClose={onClose}\n closeButtonAriaLabel={closeButtonAriaLabel}\n className={styles.closeButton}\n />\n )}\n\n <Text\n type=\"text2\"\n className={styles.text}\n ellipsis={false}\n element={typeof content === \"string\" ? \"p\" : undefined}\n >\n {content}\n </Text>\n\n {hasActions && (\n <Flex gap=\"medium\" className={styles.actions}>\n {link && <AttentionBoxLink {...link} inlineText={false} />}\n {action && <AttentionBoxButton {...action} />}\n </Flex>\n )}\n </div>\n );\n};\n\nexport default AttentionBoxDefault;\n"],"names":["AttentionBoxDefault","_ref","title","icon","iconType","onClose","_ref$closeButtonAriaL","closeButtonAriaLabel","action","link","content","hasActions","React","className","cx","styles","container","_defineProperty","hasIcon","hasTitle","hasCloseButton","createElement","AttentionBoxLeadingIcon","Text","type","weight","AttentionBoxCloseButton","closeButton","text","ellipsis","element","undefined","Flex","gap","actions","AttentionBoxLink","Object","assign","inlineText","AttentionBoxButton"],"mappings":"gkBAaA,IAAMA,EAAsB,SAAHC,GASM,IAR7BC,EAAKD,EAALC,MACAC,EAAIF,EAAJE,KACAC,EAAQH,EAARG,SACAC,EAAOJ,EAAPI,QAAOC,EAAAL,EACPM,qBAAAA,OAAuB,IAAHD,EAAG,QAAOA,EAC9BE,EAAMP,EAANO,OACAC,EAAIR,EAAJQ,KACAC,EAAOT,EAAPS,QAEMC,EAAaH,GAAUC,EAE7B,OACEG,uBACEC,UAAWC,EAAGC,EAAOC,UAASC,EAAAA,EAAAA,EAAAA,EAC3BF,CAAAA,EAAAA,EAAOG,UAAYf,GACnBY,EAAOI,WAAajB,GACpBa,EAAOJ,WAAaA,GACpBI,EAAOK,iBAAmBf,KAG5BF,GAAQS,EAACS,cAAAC,EAAwB,CAAAnB,KAAMA,EAAMC,SAAUA,EAAUS,UAAWE,EAAOZ,OAEnFD,GACCU,EAACS,cAAAE,GAAKC,KAAK,QAAQC,OAAO,SAASZ,UAAWE,EAAOb,OAClDA,KAIFG,GACDO,gBAACc,EAAuB,CACtBrB,QAASA,EACTE,qBAAsBA,EACtBM,UAAWE,EAAOY,cAItBf,EAAAS,cAACE,EAAI,CACHC,KAAK,QACLX,UAAWE,EAAOa,KAClBC,UAAU,EACVC,QAA4B,iBAAZpB,EAAuB,SAAMqB,GAE5CrB,GAGFC,GACCC,EAACS,cAAAW,EAAK,CAAAC,IAAI,SAASpB,UAAWE,EAAOmB,SAClCzB,GAAQG,gBAACuB,EAAgBC,OAAAC,OAAA,CAAA,EAAK5B,EAAM,CAAA6B,YAAY,KAChD9B,GAAUI,EAACS,cAAAkB,EAAuBH,OAAAC,OAAA,CAAA,EAAA7B,KAK7C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe/core",
|
|
3
|
-
"version": "3.76.1
|
|
3
|
+
"version": "3.76.1",
|
|
4
4
|
"description": "Official monday.com UI resources for application development in React.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@popperjs/core": "2.11.6",
|
|
93
|
-
"@vibe/base": "3.0.1
|
|
94
|
-
"@vibe/button": "3.0.6
|
|
95
|
-
"@vibe/icon": "3.0.6
|
|
93
|
+
"@vibe/base": "3.0.1",
|
|
94
|
+
"@vibe/button": "3.0.6",
|
|
95
|
+
"@vibe/icon": "3.0.6",
|
|
96
96
|
"@vibe/icons": "1.11.1",
|
|
97
|
-
"@vibe/loader": "3.0.6
|
|
97
|
+
"@vibe/loader": "3.0.6",
|
|
98
98
|
"a11y-dialog": "^7.5.2",
|
|
99
99
|
"body-scroll-lock": "^4.0.0-beta.0",
|
|
100
100
|
"browserslist-config-monday": "1.0.6",
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
"@uiw/codemirror-extensions-langs": "^4.21.25",
|
|
183
183
|
"@uiw/codemirror-theme-github": "^4.21.25",
|
|
184
184
|
"@uiw/react-codemirror": "^4.21.25",
|
|
185
|
-
"@vibe/config": "3.0.5
|
|
185
|
+
"@vibe/config": "3.0.5",
|
|
186
186
|
"@vitejs/plugin-react": "^4.3.1",
|
|
187
187
|
"@vitest/coverage-v8": "^1.6.0",
|
|
188
188
|
"@vitest/ui": "^1.6.0",
|
|
@@ -273,5 +273,5 @@
|
|
|
273
273
|
"browserslist": [
|
|
274
274
|
"extends browserslist-config-monday"
|
|
275
275
|
],
|
|
276
|
-
"gitHead": "
|
|
276
|
+
"gitHead": "2a879ae16bd3c15b5b027597f0e020d97a45a43b"
|
|
277
277
|
}
|