pds-dev-kit-web 0.6.1 → 0.6.2

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.
@@ -97,5 +97,5 @@ exports.spacing = {
97
97
  spacingM: '288px',
98
98
  spacingN: '320px'
99
99
  };
100
- var theme = __assign({ fontWeight: exports.fontWeight, desktopFontSize: exports.desktopFontSize, desktopLineHeight: exports.desktopLineHeight, mobileFontSize: exports.mobileFontSize, mobileLineHeight: exports.mobileLineHeight, boxShadow: exports.boxShadow, spacing: exports.spacing }, ui_colors_1.uiColors);
100
+ var theme = __assign({ fontWeight: exports.fontWeight, desktopFontSize: exports.desktopFontSize, desktopLineHeight: exports.desktopLineHeight, mobileFontSize: exports.mobileFontSize, mobileLineHeight: exports.mobileLineHeight, boxShadow: exports.boxShadow, spacing: exports.spacing }, (0, ui_colors_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK'));
101
101
  exports.default = theme;
@@ -1,3 +1,8 @@
1
1
  import { UITheme } from './colorSet/ui-type';
2
2
  export declare const uiColors: UITheme;
3
+ declare global {
4
+ interface Window {
5
+ PdsUtils: any;
6
+ }
7
+ }
3
8
  export declare const customTheme: (tone: string) => any;
@@ -36,7 +36,11 @@ var phaseTwoJSON = colorSetting.tone === 'LIGHT' ? colorSet_1.default.PaletteCol
36
36
  // ui-color-build-phase
37
37
  var paletteColors = buildCascadedColors(colorSet_1.default.SemanticColor, phaseTwoJSON, colorSetting.customPalette);
38
38
  exports.uiColors = buildCascadedColors(paletteColors, colorSet_1.default.UIColor);
39
+ window.PdsUtils = {
40
+ tone: 'DARK'
41
+ };
39
42
  var customTheme = function (tone) {
43
+ window.PdsUtils.tone = tone;
40
44
  var buildedColors = buildCascadedColors(buildCascadedColors(colorSet_1.default.SemanticColor, tone === 'LIGHT' ? colorSet_1.default.PaletteColor_light : colorSet_1.default.PaletteColor_Dark, colorSetting.customPalette), colorSet_1.default.UIColor);
41
45
  return buildedColors;
42
46
  };
@@ -73,7 +73,9 @@ var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObj
73
73
  });
74
74
  var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n\n &:hover:enabled {\n ", "\n }\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"], ["\n background-color: ", ";\n\n &:hover:enabled {\n ", "\n }\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"])), function (_a) {
75
75
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
76
- return baseColorKey ? common_1.uiColors[baseColorKey] : theme.ui_cpnt_button_fill_base_primary;
76
+ return baseColorKey
77
+ ? (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[baseColorKey]
78
+ : theme.ui_cpnt_button_fill_base_primary;
77
79
  }, function (_a) {
78
80
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
79
81
  return baseColorKey === 'ui_cpnt_button_fill_base_transparent'
@@ -100,7 +102,9 @@ var line = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 =
100
102
  return theme.ui_cpnt_button_line_base_default;
101
103
  }, function (_a) {
102
104
  var theme = _a.theme, borderColorKey = _a.borderColorKey;
103
- return borderColorKey ? common_1.uiColors[borderColorKey] : theme.ui_cpnt_button_line_border_enabled;
105
+ return borderColorKey
106
+ ? (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[borderColorKey]
107
+ : theme.ui_cpnt_button_line_border_enabled;
104
108
  }, function (_a) {
105
109
  var colorTheme = _a.colorTheme;
106
110
  switch (colorTheme) {
@@ -245,7 +245,7 @@ var usrTextBrandOnPrimary = (0, styled_components_1.css)(templateObject_27 || (t
245
245
  });
246
246
  var colorOverrideStyle = (0, styled_components_1.css)(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
247
247
  var colorOverride = _a.colorOverride;
248
- return colorOverride && common_1.uiColors[colorOverride];
248
+ return colorOverride && (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[colorOverride];
249
249
  });
250
250
  var ellipsisStyle = (0, styled_components_1.css)(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n -webkit-box-orient: vertical;\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n -webkit-box-orient: vertical;\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (_a) {
251
251
  var lineLimit = _a.lineLimit;
@@ -62,7 +62,9 @@ var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObj
62
62
  });
63
63
  var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n\n &:hover:not([disabled]) {\n ", "\n }\n\n &:active:not([disabled]) {\n background-image: ", ";\n }\n\n ", ";\n"], ["\n background-color: ", ";\n\n &:hover:not([disabled]) {\n ", "\n }\n\n &:active:not([disabled]) {\n background-image: ", ";\n }\n\n ", ";\n"])), function (_a) {
64
64
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
65
- return baseColorKey ? common_1.uiColors[baseColorKey] : theme.ui_cpnt_button_fill_base_primary;
65
+ return baseColorKey
66
+ ? (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[baseColorKey]
67
+ : theme.ui_cpnt_button_fill_base_primary;
66
68
  }, function (_a) {
67
69
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
68
70
  return baseColorKey === 'ui_cpnt_button_fill_base_transparent'
@@ -97,7 +99,9 @@ var line = (0, styled_components_1.css)(templateObject_6 || (templateObject_6 =
97
99
  return theme.ui_cpnt_button_line_base_default;
98
100
  }, function (_a) {
99
101
  var theme = _a.theme, borderColorKey = _a.borderColorKey;
100
- return borderColorKey ? common_1.uiColors[borderColorKey] : theme.ui_cpnt_button_line_border_enabled;
102
+ return borderColorKey
103
+ ? (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[borderColorKey]
104
+ : theme.ui_cpnt_button_line_border_enabled;
101
105
  }, function (_a) {
102
106
  var colorTheme = _a.colorTheme;
103
107
  switch (colorTheme) {
@@ -1,10 +1,5 @@
1
1
  /// <reference types="react" />
2
- import fillIcons from '../../../common/assets/icons/fill';
3
- import lineIcons from '../../../common/assets/icons/line';
4
- import { uiColors } from '../../../common/styles/ui-colors';
5
- export declare type FillIconNameKeys = keyof typeof fillIcons;
6
- export declare type LineIconNameKeys = keyof typeof lineIcons;
7
- export declare type UiColors = keyof typeof uiColors;
2
+ import { FillIconNameKeys, LineIconNameKeys, UiColors } from '../../../common';
8
3
  export declare type IconProps = {
9
4
  iconName?: FillIconNameKeys | LineIconNameKeys;
10
5
  size?: 12 | 16 | 20 | 24 | 32 | 48 | 56 | 64 | 72;
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
+ var common_1 = require("../../../common");
7
8
  var fill_1 = __importDefault(require("../../../common/assets/icons/fill"));
8
9
  var line_1 = __importDefault(require("../../../common/assets/icons/line"));
9
- var ui_colors_1 = require("../../../common/styles/ui-colors");
10
10
  var Icon = function (_a) {
11
11
  var _b = _a.iconName, iconName = _b === void 0 ? 'ic_unavailable' : _b, _c = _a.size, size = _c === void 0 ? 24 : _c, _d = _a.colorKey, colorKey = _d === void 0 ? 'ui_cpnt_icon_sys_grey_01' : _d, _e = _a.fillType, fillType = _e === void 0 ? 'line' : _e;
12
12
  var SelectedIcon = fillType === 'line'
13
13
  ? line_1.default[iconName] || fill_1.default[iconName]
14
14
  : fill_1.default[iconName] || line_1.default[iconName];
15
- return react_1.default.createElement(SelectedIcon, { color: ui_colors_1.uiColors[colorKey], size: size });
15
+ return (react_1.default.createElement(SelectedIcon, { color: (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[colorKey], size: size }));
16
16
  };
17
17
  exports.default = Icon;
@@ -73,7 +73,9 @@ var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObj
73
73
  });
74
74
  var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"], ["\n background-color: ", ";\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"])), function (_a) {
75
75
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
76
- return baseColorKey ? ui_colors_1.uiColors[baseColorKey] : theme.ui_cpnt_button_fill_base_primary;
76
+ return baseColorKey
77
+ ? (0, ui_colors_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[baseColorKey]
78
+ : theme.ui_cpnt_button_fill_base_primary;
77
79
  }, function (_a) {
78
80
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
79
81
  return baseColorKey === 'ui_cpnt_button_fill_base_transparent'
@@ -95,7 +97,9 @@ var line = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 =
95
97
  return theme.ui_cpnt_button_line_base_default;
96
98
  }, function (_a) {
97
99
  var theme = _a.theme, borderColorKey = _a.borderColorKey;
98
- return borderColorKey ? ui_colors_1.uiColors[borderColorKey] : theme.ui_cpnt_button_line_border_enabled;
100
+ return borderColorKey
101
+ ? (0, ui_colors_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[borderColorKey]
102
+ : theme.ui_cpnt_button_line_border_enabled;
99
103
  }, function (_a) {
100
104
  var colorTheme = _a.colorTheme;
101
105
  switch (colorTheme) {
@@ -47,7 +47,7 @@ function MobileHeaderBar(_a) {
47
47
  return react_1.default.createElement("div", null);
48
48
  }
49
49
  return (react_1.default.createElement(S_LeftButtonBox, null,
50
- react_1.default.createElement(IconButton_1.IconButton, { iconName: iconName, fillType: "fill", iconFillType: "line", baseSize: "large", iconSize: 24, shapeType: "rectangle", onClick: handleClickLeftBtn, baseColorKey: "ui_cpnt_button_fill_base_transparent" })));
50
+ react_1.default.createElement(IconButton_1.IconButton, { iconName: iconName, fillType: "fill", iconFillType: "line", baseSize: "large", iconSize: 24, shapeType: "rectangle", onClick: handleClickLeftBtn, iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_transparent" })));
51
51
  };
52
52
  var title = function () {
53
53
  switch (titleType) {
@@ -245,7 +245,7 @@ var usrTextBrandOnPrimary = (0, styled_components_1.css)(templateObject_27 || (t
245
245
  });
246
246
  var colorOverrideStyle = (0, styled_components_1.css)(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
247
247
  var colorOverride = _a.colorOverride;
248
- return colorOverride && common_1.uiColors[colorOverride];
248
+ return colorOverride && (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[colorOverride];
249
249
  });
250
250
  var ellipsisStyle = (0, styled_components_1.css)(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n -webkit-box-orient: vertical;\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n -webkit-box-orient: vertical;\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (_a) {
251
251
  var lineLimit = _a.lineLimit;
@@ -62,7 +62,9 @@ var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObj
62
62
  });
63
63
  var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n\n &:active:not([disabled]) {\n background-image: ", ";\n }\n\n ", ";\n"], ["\n background-color: ", ";\n\n &:active:not([disabled]) {\n background-image: ", ";\n }\n\n ", ";\n"])), function (_a) {
64
64
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
65
- return baseColorKey ? common_1.uiColors[baseColorKey] : theme.ui_cpnt_button_fill_base_primary;
65
+ return baseColorKey
66
+ ? (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[baseColorKey]
67
+ : theme.ui_cpnt_button_fill_base_primary;
66
68
  }, function (_a) {
67
69
  var theme = _a.theme, baseColorKey = _a.baseColorKey;
68
70
  return baseColorKey === 'ui_cpnt_button_fill_base_transparent'
@@ -92,7 +94,9 @@ var line = (0, styled_components_1.css)(templateObject_6 || (templateObject_6 =
92
94
  return theme.ui_cpnt_button_line_base_default;
93
95
  }, function (_a) {
94
96
  var theme = _a.theme, borderColorKey = _a.borderColorKey;
95
- return borderColorKey ? common_1.uiColors[borderColorKey] : theme.ui_cpnt_button_line_border_enabled;
97
+ return borderColorKey
98
+ ? (0, common_1.customTheme)(window.PdsUtils ? window.PdsUtils.tone : 'DARK')[borderColorKey]
99
+ : theme.ui_cpnt_button_line_border_enabled;
96
100
  }, function (_a) {
97
101
  var colorTheme = _a.colorTheme;
98
102
  switch (colorTheme) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",