kiban-design-system 1.0.270-alpha.0 → 1.0.272-alpha.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/dist/components/AlphaSideMenu/components/Item/Item.d.ts +1 -1
- package/dist/components/AlphaSideMenu/components/Item/Item.props.d.ts +2 -0
- package/dist/components/Header/Header.props.d.ts +2 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +18 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9995,7 +9995,7 @@ const AlphaInputText = ({ isDisabled, label }) => {
|
|
|
9995
9995
|
const SideMenuContext = createContext({});
|
|
9996
9996
|
|
|
9997
9997
|
const COMPONENT_NAME$p = 'AlphaSideMenu__Item';
|
|
9998
|
-
const Item$3 = ({ label, isDisabled, icon, onClick, isActive: isActiveProp, subNavigationItems, truncateText, anchorProps, isCollapsed: isCollapsedProp, isSubNavigation, isExternal, isExact, url, }) => {
|
|
9998
|
+
const Item$3 = ({ label, isDisabled, icon, onClick, isActive: isActiveProp, subNavigationItems, truncateText, anchorProps, isCollapsed: isCollapsedProp, isSubNavigation, isExternal, isExact, url, isVisible, }) => {
|
|
9999
9999
|
const { anchorComponent, collapsed, setCurrentTierItems, location } = useContext(SideMenuContext);
|
|
10000
10000
|
const isCollapsed = isCollapsedProp !== undefined ? isCollapsedProp : collapsed;
|
|
10001
10001
|
const AnchorComponent = !isExternal ? anchorComponent || 'a' : 'a';
|
|
@@ -10012,20 +10012,9 @@ const Item$3 = ({ label, isDisabled, icon, onClick, isActive: isActiveProp, subN
|
|
|
10012
10012
|
setCurrentTierItems === null || setCurrentTierItems === void 0 ? void 0 : setCurrentTierItems(subNavigationItems || [], label);
|
|
10013
10013
|
}
|
|
10014
10014
|
}, [isActive]);
|
|
10015
|
-
const labelMarkup = label ? (jsx("span", Object.assign({
|
|
10016
|
-
// layout
|
|
10017
|
-
// animate={{
|
|
10018
|
-
// opacity: isCollapsed ? 0 : 1,
|
|
10019
|
-
// }}
|
|
10020
|
-
// transition={{
|
|
10021
|
-
// duration: 0.3,
|
|
10022
|
-
// ease: [0.4, 0, 0.2, 1],
|
|
10023
|
-
// }}
|
|
10024
|
-
className: `${COMPONENT_NAME$p}__Label` }, { children: label }), void 0)) : null;
|
|
10015
|
+
const labelMarkup = label ? (jsx("span", Object.assign({ className: `${COMPONENT_NAME$p}__Label` }, { children: label }), void 0)) : null;
|
|
10025
10016
|
const iconSource = icon && isValidIcon(icon === null || icon === void 0 ? void 0 : icon.icon) ? (jsx(AlphaIcon, { source: icon === null || icon === void 0 ? void 0 : icon.icon, outlined: icon === null || icon === void 0 ? void 0 : icon.outlined }, void 0)) : (jsx(Fragment, { children: icon }, void 0));
|
|
10026
|
-
const iconMarkup = icon ? (jsx("div", Object.assign({
|
|
10027
|
-
// layout
|
|
10028
|
-
className: `${COMPONENT_NAME$p}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
10017
|
+
const iconMarkup = icon ? (jsx("div", Object.assign({ className: `${COMPONENT_NAME$p}__IconWrapper` }, { children: iconSource }), void 0)) : null;
|
|
10029
10018
|
const handleClick = () => {
|
|
10030
10019
|
if (!isDisabled) {
|
|
10031
10020
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
@@ -10037,9 +10026,19 @@ const Item$3 = ({ label, isDisabled, icon, onClick, isActive: isActiveProp, subN
|
|
|
10037
10026
|
const anchorMarkup = (jsxs(AnchorComponent, Object.assign({}, anchorProps, { target: isExternal ? '_blank' : undefined, onClick: handleClick }, { children: [iconMarkup, labelMarkup] }), void 0));
|
|
10038
10027
|
const tooltipAnchorMarkup = isCollapsed ? (jsx(AlphaTooltip, Object.assign({ content: label, position: 'right' }, { children: anchorMarkup }), void 0)) : null;
|
|
10039
10028
|
const classNames = cssClassName(COMPONENT_NAME$p, isDisabled && 'isDisabled', isActive && 'isActive', truncateText && 'isTruncated', (isCollapsed !== undefined ? isCollapsed : collapsed) && 'isCollapsed');
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10029
|
+
if (isVisible &&
|
|
10030
|
+
!isVisible(location, {
|
|
10031
|
+
label,
|
|
10032
|
+
url,
|
|
10033
|
+
isDisabled,
|
|
10034
|
+
isActive: isActiveProp,
|
|
10035
|
+
subNavigationItems: subNavigationItems || [],
|
|
10036
|
+
truncateText,
|
|
10037
|
+
anchorProps,
|
|
10038
|
+
})) {
|
|
10039
|
+
return null;
|
|
10040
|
+
}
|
|
10041
|
+
return jsx("li", Object.assign({ className: classNames }, { children: tooltipAnchorMarkup || anchorMarkup }), void 0);
|
|
10043
10042
|
};
|
|
10044
10043
|
|
|
10045
10044
|
const COMPONENT_NAME$o = 'AlphaSideMenu__Section';
|
|
@@ -28413,8 +28412,8 @@ const Header$1 = ({ leftContent, rightContent, actions, userMenu, logo, extraAct
|
|
|
28413
28412
|
const { theme } = useTheme();
|
|
28414
28413
|
const renderAction = (item, index) => (jsx("div", Object.assign({ className: 'User-menu__secondary-action', onClick: item.onClick }, { children: jsx(Icon, { name: item.icon }, void 0) }), index || ''));
|
|
28415
28414
|
const renderActionWithTooltip = (item, index) => {
|
|
28416
|
-
var _a
|
|
28417
|
-
return (jsx(
|
|
28415
|
+
var _a;
|
|
28416
|
+
return (jsx(AlphaTooltip, Object.assign({ position: (_a = item.tooltip) === null || _a === void 0 ? void 0 : _a.position, content: (item.tooltip && item.tooltip.text) || '', appearance: 'default', theme: 'cloud' }, { children: renderAction(item) }), index));
|
|
28418
28417
|
};
|
|
28419
28418
|
return (jsxs(Fragment, { children: [jsxs("div", Object.assign({ className: `Header__${theme} Header__container` }, { children: [jsxs("div", Object.assign({ className: 'Header__container-logo' }, { children: [extraAction && (extraAction === null || extraAction === void 0 ? void 0 : extraAction.icon) && (jsx("div", Object.assign({ className: 'Header__container-logo__extra-action' }, { children: jsx(IconButton, { onClick: extraAction === null || extraAction === void 0 ? void 0 : extraAction.onClick, icon: extraAction.icon, isRound: true, size: 'small', appearance: 'tertiary' }, void 0) }), void 0)), logo && jsx(Logo, { name: logo, size: 'small' }, void 0), leftContent && (jsx("div", Object.assign({ className: 'Header__container-content-left' }, { children: leftContent }), void 0))] }), void 0), jsxs("div", Object.assign({ className: 'Header__right-container' }, { children: [rightContent && (jsx("div", Object.assign({ className: 'Header__right-content' }, { children: rightContent }), void 0)), jsxs("div", Object.assign({ className: 'Header__menus-container' }, { children: [jsx("hr", { className: 'User-menu__divider-left' }, void 0), actions === null || actions === void 0 ? void 0 : actions.map((item, i) => item.tooltip
|
|
28420
28419
|
? renderActionWithTooltip(item, i)
|