pds-dev-kit-web 2.2.33 → 2.2.35

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.
@@ -1,7 +1,10 @@
1
1
  /// <reference types="react" />
2
- import type { PDSTabItemOption, PDSTextType } from '../../../common/types';
2
+ import type { FillIconNameKeys, LineIconNameKeys, PDSTabItemOption, PDSTextType } from '../../../common/types';
3
3
  type ItemArray = PDSTabItemOption & {
4
4
  subArray?: PDSTabItemOption[];
5
+ iconMode?: 'none' | 'use';
6
+ iconName?: FillIconNameKeys | LineIconNameKeys;
7
+ iconFillType?: 'line' | 'fill';
5
8
  };
6
9
  type TextObj = {
7
10
  title: PDSTextType;
@@ -37,9 +37,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
37
37
  __setModuleDefault(result, mod);
38
38
  return result;
39
39
  };
40
+ var __importDefault = (this && this.__importDefault) || function (mod) {
41
+ return (mod && mod.__esModule) ? mod : { "default": mod };
42
+ };
40
43
  Object.defineProperty(exports, "__esModule", { value: true });
41
44
  var jsx_runtime_1 = require("react/jsx-runtime");
42
45
  var react_router_dom_1 = require("react-router-dom");
46
+ var Icon_1 = __importDefault(require("../../../hybrid/components/Icon/Icon"));
47
+ var Spacing_1 = __importDefault(require("../../../hybrid/components/Spacing/Spacing"));
43
48
  var styled_components_1 = __importStar(require("styled-components"));
44
49
  var TextLabel_1 = require("../TextLabel");
45
50
  function DesktopTabBar(_a) {
@@ -67,7 +72,11 @@ function DesktopTabBar(_a) {
67
72
  return ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: item.title, textAlign: "center", styleTheme: "leadParaBold", colorTheme: item.isActive ? 'sysTextPrimary' : 'sysTextTertiary', singleLineMode: "use", letterSpacing: "-0.04em" }));
68
73
  }
69
74
  };
70
- return ((0, jsx_runtime_1.jsxs)(S_TabBarBox, __assign({ "x-pds-name": "DesktopTabBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop" }, { children: [(0, jsx_runtime_1.jsx)(S_MainTabBarSpace, __assign({ styleTheme: styleTheme, isSubTabBarActivated: isSubTabBarActivated }, { children: itemArray.map(function (item) { return ((0, jsx_runtime_1.jsxs)(S_MainTabItemBox, __assign({ styleTheme: styleTheme }, { children: [(0, jsx_runtime_1.jsx)(S_MainTabItemWrapper, __assign({ text: item.title, styleTheme: styleTheme, isActive: item.isActive, onClick: function (e) { return handelClickTabItem_1(item, e); } }, { children: textLabel_1(item, false) })), item.isActive && item.subArray && ((0, jsx_runtime_1.jsx)(S_SubTabBarWrapper, { children: item.subArray.map(function (subItem) { return ((0, jsx_runtime_1.jsx)(S_SubTabItemWrapper, __assign({ text: subItem.title, styleTheme: styleTheme, onClick: function (e) { return handelClickTabItem_1(subItem, e); } }, { children: textLabel_1(subItem, true) }), subItem.title)); }) }))] }), item.title)); }) })), isSubTabBarActivated && (0, jsx_runtime_1.jsx)(S_SubTabBarSpace, { styleTheme: styleTheme })] })));
75
+ return ((0, jsx_runtime_1.jsxs)(S_TabBarBox, __assign({ "x-pds-name": "DesktopTabBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop" }, { children: [(0, jsx_runtime_1.jsx)(S_MainTabBarSpace, __assign({ styleTheme: styleTheme, isSubTabBarActivated: isSubTabBarActivated }, { children: itemArray.map(function (item) { return ((0, jsx_runtime_1.jsxs)(S_MainTabItemBox, __assign({ styleTheme: styleTheme }, { children: [(0, jsx_runtime_1.jsxs)(S_MainTabItemWrapper, __assign({ text: item.title, styleTheme: styleTheme, isActive: item.isActive, onClick: function (e) { return handelClickTabItem_1(item, e); } }, { children: [textLabel_1(item, false), item.iconMode === 'use' && item.iconName && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Spacing_1.default, { size: "spacing_a", spacingType: "width" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { size: styleTheme === 'main' ? 20 : 16, iconName: item.iconName || 'ic_unavailable', fillType: item.iconFillType || 'line', colorKey: item.isActive
76
+ ? styleTheme === 'content'
77
+ ? 'ui_cpnt_textlabel_usr_brandprimary'
78
+ : 'ui_cpnt_textlabel_sys_primary'
79
+ : 'ui_cpnt_textlabel_sys_tertiary' })] }))] })), item.isActive && item.subArray && ((0, jsx_runtime_1.jsx)(S_SubTabBarWrapper, { children: item.subArray.map(function (subItem) { return ((0, jsx_runtime_1.jsx)(S_SubTabItemWrapper, __assign({ text: subItem.title, styleTheme: styleTheme, onClick: function (e) { return handelClickTabItem_1(subItem, e); } }, { children: textLabel_1(subItem, true) }), subItem.title)); }) }))] }), item.title)); }) })), isSubTabBarActivated && (0, jsx_runtime_1.jsx)(S_SubTabBarSpace, { styleTheme: styleTheme })] })));
71
80
  }
72
81
  if (textArray) {
73
82
  var isSubTabBarActivated = textArray.some(function (item) { return pathname.includes(item.path) && item.subArray; });
@@ -149,13 +158,16 @@ var S_MainTabItemBox = styled_components_1.default.div(templateObject_5 || (temp
149
158
  var theme = _a.theme, styleTheme = _a.styleTheme;
150
159
  return styleTheme === 'main' ? '20px' : theme.spacing.spacingD;
151
160
  });
152
- var S_MainTabItemWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: flex-end;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n height: 100%;\n padding: 0 ", ";\n padding-bottom: ", ";\n ", "\n ", "\n"], ["\n align-items: flex-end;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n height: 100%;\n padding: 0 ", ";\n padding-bottom: ", ";\n ", "\n ", "\n"])), function (_a) {
161
+ var S_MainTabItemWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: flex-end;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n height: 100%;\n padding: 0 ", ";\n ", "\n ", "\n & > [x-pds-name=\"TextLabel\"] {\n padding-bottom: ", ";\n }\n & > svg {\n padding-bottom: ", ";\n }\n"], ["\n align-items: flex-end;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n height: 100%;\n padding: 0 ", ";\n ", "\n ", "\n & > [x-pds-name=\"TextLabel\"] {\n padding-bottom: ", ";\n }\n & > svg {\n padding-bottom: ", ";\n }\n"])), function (_a) {
153
162
  var theme = _a.theme, styleTheme = _a.styleTheme;
154
163
  return (styleTheme === 'main' ? 0 : theme.spacing.spacingA);
155
- }, function (_a) {
164
+ }, tabIndicator, textOffset, function (_a) {
156
165
  var theme = _a.theme, styleTheme = _a.styleTheme;
157
166
  return styleTheme === 'main' ? theme.spacing.spacingA : theme.spacing.spacingB;
158
- }, tabIndicator, textOffset);
167
+ }, function (_a) {
168
+ var theme = _a.theme, styleTheme = _a.styleTheme;
169
+ return styleTheme === 'main' ? theme.spacing.spacingA : '7px';
170
+ });
159
171
  var S_SubTabBarWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n bottom: -33px;\n display: flex;\n height: 32px;\n left: 0px;\n position: absolute;\n width: max-content;\n"], ["\n bottom: -33px;\n display: flex;\n height: 32px;\n left: 0px;\n position: absolute;\n width: max-content;\n"])));
160
172
  var S_SubTabBarSpace = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n ", ";\n height: ", ";\n"], ["\n background-color: ", ";\n ", ";\n height: ", ";\n"])), function (_a) {
161
173
  var theme = _a.theme, styleTheme = _a.styleTheme;
@@ -75,8 +75,8 @@ function DynamicDesktopNavBar(_a) {
75
75
  template === 'W1_0007' ||
76
76
  template === 'W1_0008' ||
77
77
  template === 'W1_0009' ||
78
- template === 'W1_0010' ||
79
- template === 'W1_0011';
78
+ template === 'W1_0010';
79
+ var isCenteredLogo = template === 'W1_0011';
80
80
  var navBarHeight = '63px';
81
81
  (0, react_1.useEffect)(function () {
82
82
  var currentSearch = (0, utils_1.getSearchExceptGivenName)(location.search, 'from');
@@ -93,7 +93,7 @@ function DynamicDesktopNavBar(_a) {
93
93
  function handleClickInternalMenuItemNav(url) {
94
94
  dispatch({ type: 'INTERNAL_CLICKED', payload: { clickedURL: url } });
95
95
  }
96
- return ((0, jsx_runtime_1.jsx)(exports.BasePathContext.Provider, __assign({ value: { basePath: basePath, activeMode: state.mode, handleClickInternalMenuItemNav: handleClickInternalMenuItemNav } }, { children: colorTheme === 'transparent' ? ((0, jsx_runtime_1.jsx)(styled_components_1.ThemeProvider, __assign({ theme: __assign(__assign(__assign({}, theme), (0, theme_1.themeByGivenTone)('DARK')), { ui_menu_background: theme.ui_menu_background_transparent, ui_menu_button_base: theme.ui_menu_button_base_transparent }) }, { children: (0, jsx_runtime_1.jsx)(S_DynamicDesktopNavBar, __assign({ "x-pds-name": "DynamicDesktopNavBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isFixedWidth: isFixedWidth, isPreview: isPreview, navBarHeight: navBarHeight }, { children: (0, jsx_runtime_1.jsxs)(S_Grid, __assign({ className: "DynamicDesktopNavBarGrid", gridTemplate: gridTemplate, style: style }, { children: [(0, jsx_runtime_1.jsx)(blocks_1.BrandLogo, { to: brandLogo.href, logoSrc: brandLogo.src, fallbackText: brandLogo.text }), (0, jsx_runtime_1.jsx)(blocks_1.PrimaryMenu, { menus: slicedPrimaryMenus, showMenuAsIcon: primaryMenuOptions.showMenuAsIcon, style: primaryMenuOptions.style }), showSecondaryMenu && ((0, jsx_runtime_1.jsx)(blocks_1.SecondaryMenu, { menus: slicedSecondaryMenus, showMenuAsIcon: secondaryMenuOptions.showMenuAsIcon, style: secondaryMenuOptions.style })), (0, jsx_runtime_1.jsx)(blocks_1.UserProfile, { ref: profileArea, src: userProfile.src, to: userProfile.href, leftIconButton: userProfile.leftIconButton, overrideUserProfile: userProfile.overrideUserProfile, style: userProfileOptions.style })] })) })) }))) : ((0, jsx_runtime_1.jsx)(S_DynamicDesktopNavBar, __assign({ "x-pds-name": "DynamicDesktopNavBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isPreview: isPreview, isFixedWidth: isFixedWidth, navBarHeight: navBarHeight }, { children: (0, jsx_runtime_1.jsxs)(S_Grid, __assign({ className: "DynamicDesktopNavBarGrid", gridTemplate: gridTemplate, style: style }, { children: [(0, jsx_runtime_1.jsx)(blocks_1.BrandLogo, { to: brandLogo.href, logoSrc: brandLogo.src, fallbackText: brandLogo.text }), (0, jsx_runtime_1.jsx)(blocks_1.PrimaryMenu, { menus: slicedPrimaryMenus, showMenuAsIcon: primaryMenuOptions.showMenuAsIcon, style: primaryMenuOptions.style }), showSecondaryMenu && ((0, jsx_runtime_1.jsx)(blocks_1.SecondaryMenu, { menus: slicedSecondaryMenus, showMenuAsIcon: secondaryMenuOptions.showMenuAsIcon, style: secondaryMenuOptions.style })), (0, jsx_runtime_1.jsx)(blocks_1.UserProfile, { ref: profileArea, src: userProfile.src, to: userProfile.href, leftIconButton: userProfile.leftIconButton, overrideUserProfile: userProfile.overrideUserProfile, style: userProfileOptions.style })] })) }))) })));
96
+ return ((0, jsx_runtime_1.jsx)(exports.BasePathContext.Provider, __assign({ value: { basePath: basePath, activeMode: state.mode, handleClickInternalMenuItemNav: handleClickInternalMenuItemNav } }, { children: colorTheme === 'transparent' ? ((0, jsx_runtime_1.jsx)(styled_components_1.ThemeProvider, __assign({ theme: __assign(__assign(__assign({}, theme), (0, theme_1.themeByGivenTone)('DARK')), { ui_menu_background: theme.ui_menu_background_transparent, ui_menu_button_base: theme.ui_menu_button_base_transparent }) }, { children: (0, jsx_runtime_1.jsx)(S_DynamicDesktopNavBar, __assign({ "x-pds-name": "DynamicDesktopNavBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isFixedWidth: isFixedWidth, isPreview: isPreview, navBarHeight: navBarHeight }, { children: (0, jsx_runtime_1.jsxs)(S_Grid, __assign({ className: "DynamicDesktopNavBarGrid", gridTemplate: gridTemplate, style: style }, { children: [(0, jsx_runtime_1.jsx)(blocks_1.BrandLogo, { to: brandLogo.href, logoSrc: brandLogo.src, fallbackText: brandLogo.text, isCenteredLogo: isCenteredLogo }), (0, jsx_runtime_1.jsx)(blocks_1.PrimaryMenu, { menus: slicedPrimaryMenus, showMenuAsIcon: primaryMenuOptions.showMenuAsIcon, style: primaryMenuOptions.style }), showSecondaryMenu && ((0, jsx_runtime_1.jsx)(blocks_1.SecondaryMenu, { menus: slicedSecondaryMenus, showMenuAsIcon: secondaryMenuOptions.showMenuAsIcon, style: secondaryMenuOptions.style })), (0, jsx_runtime_1.jsx)(blocks_1.UserProfile, { ref: profileArea, src: userProfile.src, to: userProfile.href, leftIconButton: userProfile.leftIconButton, overrideUserProfile: userProfile.overrideUserProfile, style: userProfileOptions.style })] })) })) }))) : ((0, jsx_runtime_1.jsx)(S_DynamicDesktopNavBar, __assign({ "x-pds-name": "DynamicDesktopNavBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isPreview: isPreview, isFixedWidth: isFixedWidth, navBarHeight: navBarHeight }, { children: (0, jsx_runtime_1.jsxs)(S_Grid, __assign({ className: "DynamicDesktopNavBarGrid", gridTemplate: gridTemplate, style: style }, { children: [(0, jsx_runtime_1.jsx)(blocks_1.BrandLogo, { to: brandLogo.href, logoSrc: brandLogo.src, fallbackText: brandLogo.text, isCenteredLogo: isCenteredLogo }), (0, jsx_runtime_1.jsx)(blocks_1.PrimaryMenu, { menus: slicedPrimaryMenus, showMenuAsIcon: primaryMenuOptions.showMenuAsIcon, style: primaryMenuOptions.style }), showSecondaryMenu && ((0, jsx_runtime_1.jsx)(blocks_1.SecondaryMenu, { menus: slicedSecondaryMenus, showMenuAsIcon: secondaryMenuOptions.showMenuAsIcon, style: secondaryMenuOptions.style })), (0, jsx_runtime_1.jsx)(blocks_1.UserProfile, { ref: profileArea, src: userProfile.src, to: userProfile.href, leftIconButton: userProfile.leftIconButton, overrideUserProfile: userProfile.overrideUserProfile, style: userProfileOptions.style })] })) }))) })));
97
97
  }
98
98
  var S_Grid = (0, styled_components_1.default)(BoxLayout_1.Grid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n grid-column-gap: 24px;\n justify-items: center;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n align-items: center;\n grid-column-gap: 24px;\n justify-items: center;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
99
99
  var theme = _a.theme;
@@ -4,7 +4,8 @@ type Props = {
4
4
  to: string;
5
5
  logoSrc: string;
6
6
  fallbackText: string;
7
+ isCenteredLogo: boolean;
7
8
  style?: CSSProperties;
8
9
  };
9
- declare function BrandLogo({ to, logoSrc, fallbackText, style }: Props): JSX.Element;
10
+ declare function BrandLogo({ to, logoSrc, fallbackText, isCenteredLogo, style }: Props): JSX.Element;
10
11
  export default BrandLogo;
@@ -22,8 +22,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
22
22
  var styled_components_1 = __importDefault(require("styled-components"));
23
23
  var LogoNav_1 = __importDefault(require("../components/LogoNav"));
24
24
  function BrandLogo(_a) {
25
- var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText, style = _a.style;
26
- return ((0, jsx_runtime_1.jsx)(S_BrandLogo, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(LogoNav_1.default, { to: to, logoSrc: logoSrc, fallbackText: fallbackText }) })));
25
+ var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText, isCenteredLogo = _a.isCenteredLogo, style = _a.style;
26
+ return ((0, jsx_runtime_1.jsx)(S_BrandLogo, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(LogoNav_1.default, { to: to, logoSrc: logoSrc, fallbackText: fallbackText, isCenteredLogo: isCenteredLogo }) })));
27
27
  }
28
28
  var S_BrandLogo = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n grid-area: BRAND_LOGO;\n"], ["\n display: flex;\n grid-area: BRAND_LOGO;\n"])));
29
29
  exports.default = BrandLogo;
@@ -3,6 +3,7 @@ type Props = {
3
3
  to: string;
4
4
  logoSrc: string;
5
5
  fallbackText: string;
6
+ isCenteredLogo: boolean;
6
7
  };
7
- declare function LogoNav({ to, logoSrc, fallbackText }: Props): JSX.Element;
8
+ declare function LogoNav({ to, logoSrc, fallbackText, isCenteredLogo }: Props): JSX.Element;
8
9
  export default LogoNav;
@@ -23,10 +23,19 @@ var styled_components_1 = __importDefault(require("styled-components"));
23
23
  var __1 = require("../../..");
24
24
  var NavLink_1 = __importDefault(require("../../../../common/components/Navigations/NavLink"));
25
25
  function LogoNav(_a) {
26
- var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText;
27
- return ((0, jsx_runtime_1.jsx)(NavLink_1.default, __assign({ to: to }, { children: (0, jsx_runtime_1.jsx)(S_Box, { children: logoSrc ? ((0, jsx_runtime_1.jsx)(S_Logo, { src: logoSrc })) : ((0, jsx_runtime_1.jsx)(__1.D_TextLabel, { text: fallbackText, styleTheme: "headingBold", ellipsisMode: "use", lineLimit: 1 })) }) })));
26
+ var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText, isCenteredLogo = _a.isCenteredLogo;
27
+ return ((0, jsx_runtime_1.jsx)(NavLink_1.default, __assign({ to: to }, { children: (0, jsx_runtime_1.jsx)(S_Box, __assign({ isCenteredLogo: isCenteredLogo }, { children: logoSrc ? ((0, jsx_runtime_1.jsx)(S_Logo, { src: logoSrc })) : ((0, jsx_runtime_1.jsx)(__1.D_TextLabel, { text: fallbackText, styleTheme: "headingBold", ellipsisMode: "use", lineLimit: 1 })) })) })));
28
28
  }
29
- var S_Box = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 48px;\n width: 180px;\n"], ["\n align-items: center;\n display: flex;\n height: 48px;\n width: 180px;\n"])));
29
+ var S_Box = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 48px;\n justify-content: ", ";\n max-width: ", ";\n width: ", ";\n"], ["\n align-items: center;\n display: flex;\n height: 48px;\n justify-content: ", ";\n max-width: ", ";\n width: ", ";\n"])), function (_a) {
30
+ var isCenteredLogo = _a.isCenteredLogo;
31
+ return isCenteredLogo && 'center';
32
+ }, function (_a) {
33
+ var isCenteredLogo = _a.isCenteredLogo;
34
+ return isCenteredLogo && '180px';
35
+ }, function (_a) {
36
+ var isCenteredLogo = _a.isCenteredLogo;
37
+ return (isCenteredLogo ? 'max-content' : '180px');
38
+ });
30
39
  var S_Logo = styled_components_1.default.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n object-position: left;\n"], ["\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n object-position: left;\n"])));
31
40
  exports.default = LogoNav;
32
41
  var templateObject_1, templateObject_2;
@@ -230,7 +230,7 @@ exports.TEMPLATES_DATA = {
230
230
  W1_0011: {
231
231
  gridTemplate: 'PRIMARY_MENU BRAND_LOGO SECONDARY_MENU USER_PROFILE',
232
232
  gridStyle: {
233
- gridTemplateColumns: '1fr 180px 1fr min-content'
233
+ gridTemplateColumns: '1fr min-content 1fr min-content'
234
234
  },
235
235
  showSecondaryMenu: true,
236
236
  primaryMenuOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "2.2.33",
3
+ "version": "2.2.35",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.33]
2
+ ## [v2.2.35]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
5
  ### Component
6
- * DynamicDesktopNavBar
7
- * 1단 템플릿 중앙 고정형 추가
6
+ * DesktopTabBar
7
+ * itemArray 내부에 icon관련 prop 추가
8
+ * iconMode
9
+ * iconName
10
+ * iconFillType