@twreporter/react-components 8.25.0-rc.0 → 8.25.0-rc.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/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [8.25.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.25.0-rc.0...@twreporter/react-components@8.25.0-rc.1) (2024-02-07)
7
+
8
+
9
+ ### Features
10
+
11
+ * add more PillButton theme color ([6e28d07](https://github.com/twreporter/twreporter-npm-packages/commit/6e28d079c9c54cd60d75c8fac453ff5d378aece9))
12
+ * add more TextButton theme color & loading ([d72c845](https://github.com/twreporter/twreporter-npm-packages/commit/d72c845e4f73857ff10d6a0293d37402c0d29775))
13
+ * iconWithTextButton P3 => P4 ([27caf83](https://github.com/twreporter/twreporter-npm-packages/commit/27caf832bf455be2d139aa55adfecc9996700596))
14
+
15
+
16
+
17
+
18
+
6
19
  # [8.25.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.24.1-rc.1...@twreporter/react-components@8.25.0-rc.0) (2024-02-07)
7
20
 
8
21
 
@@ -40,8 +40,8 @@ var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
40
40
  return props.hoverColor;
41
41
  }));
42
42
 
43
- var StyledP3 = /*#__PURE__*/(0, _styledComponents["default"])(_paragraph.P3).withConfig({
44
- displayName: "iconWithTextButton__StyledP3",
43
+ var StyledP4 = /*#__PURE__*/(0, _styledComponents["default"])(_paragraph.P4).withConfig({
44
+ displayName: "iconWithTextButton__StyledP4",
45
45
  componentId: "sc-1f9d1q4-1"
46
46
  })(["margin-top:2px;max-height:", ";opacity:", ";transition:opacity 100ms;"], function (props) {
47
47
  return props.hideText ? '0px' : 'none';
@@ -70,9 +70,9 @@ var IconWithTextButton = function IconWithTextButton(_ref) {
70
70
  color: color,
71
71
  hoverColor: hoverColor,
72
72
  disabled: disabled
73
- }, iconComponent, /*#__PURE__*/_react["default"].createElement(StyledP3, {
73
+ }, iconComponent, /*#__PURE__*/_react["default"].createElement(StyledP4, {
74
74
  text: text,
75
- weight: _paragraph.P3.Weight.NORMAL,
75
+ weight: _paragraph.P4.Weight.NORMAL,
76
76
  hideText: hideText
77
77
  }));
78
78
  };
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -9,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
9
11
 
10
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
 
12
- var _styledComponents = _interopRequireDefault(require("styled-components"));
14
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
13
15
 
14
16
  var _theme = require("../utils/theme");
15
17
 
@@ -25,10 +27,16 @@ var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/med
25
27
 
26
28
  var _theme2 = require("@twreporter/core/lib/constants/theme");
27
29
 
28
- var _excluded = ["text", "leftIconComponent", "rightIconComponent", "size", "theme", "type", "style", "active", "disabled"];
30
+ var _color = require("@twreporter/core/lib/constants/color");
31
+
32
+ var _excluded = ["text", "leftIconComponent", "rightIconComponent", "size", "theme", "style", "active", "disabled", "loading"];
29
33
 
30
34
  var _templateObject;
31
35
 
36
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
+
38
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
+
32
40
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
41
 
34
42
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -65,6 +73,31 @@ var IconContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
65
73
  return props.isLeft ? '0 4px 0 0' : '0 0 0 4px';
66
74
  });
67
75
 
76
+ var HideOnLoading = /*#__PURE__*/_styledComponents["default"].div.withConfig({
77
+ displayName: "textButton__HideOnLoading",
78
+ componentId: "sc-1lwyrq5-2"
79
+ })(["opacity:", ";display:flex;align-items:center;justify-content:center;"], function (props) {
80
+ return props.show ? 1 : 0;
81
+ });
82
+
83
+ var RelativeParent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
84
+ displayName: "textButton__RelativeParent",
85
+ componentId: "sc-1lwyrq5-3"
86
+ })(["position:relative;display:flex;align-items:center;justify-content:center;"]);
87
+
88
+ var spin = /*#__PURE__*/(0, _styledComponents.keyframes)(["0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}"]);
89
+
90
+ var Loader = /*#__PURE__*/_styledComponents["default"].span.withConfig({
91
+ displayName: "textButton__Loader",
92
+ componentId: "sc-1lwyrq5-4"
93
+ })(["position:absolute;opacity:", ";width:", "px;height:", "px;border:2px solid ", ";border-top-color:", ";border-radius:50%;display:inline-block;box-sizing:border-box;animation:", " 1s linear infinite;"], function (props) {
94
+ return props.show ? 1 : 0;
95
+ }, function (props) {
96
+ return props.size;
97
+ }, function (props) {
98
+ return props.size;
99
+ }, _color.colorGrayscale.gray400, _color.colorGrayscale.gray600, spin);
100
+
68
101
  var TextButton = function TextButton(_ref) {
69
102
  var _ref$text = _ref.text,
70
103
  text = _ref$text === void 0 ? '' : _ref$text,
@@ -76,14 +109,14 @@ var TextButton = function TextButton(_ref) {
76
109
  size = _ref$size === void 0 ? _sharedEnum.Size.S : _ref$size,
77
110
  _ref$theme = _ref.theme,
78
111
  theme = _ref$theme === void 0 ? _theme2.THEME.normal : _ref$theme,
79
- _ref$type = _ref.type,
80
- type = _ref$type === void 0 ? _enums.Type.PRIMARY : _ref$type,
81
112
  _ref$style = _ref.style,
82
113
  style = _ref$style === void 0 ? _enums.Style.DARK : _ref$style,
83
114
  _ref$active = _ref.active,
84
115
  active = _ref$active === void 0 ? false : _ref$active,
85
116
  _ref$disabled = _ref.disabled,
86
117
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
118
+ _ref$loading = _ref.loading,
119
+ loading = _ref$loading === void 0 ? false : _ref$loading,
87
120
  props = _objectWithoutProperties(_ref, _excluded);
88
121
 
89
122
  var themeFunc;
@@ -93,7 +126,7 @@ var TextButton = function TextButton(_ref) {
93
126
  } else if (active) {
94
127
  themeFunc = _theme.getActiveTextButtonTheme;
95
128
  } else {
96
- themeFunc = type === _enums.Type.PRIMARY ? _theme.getPrimaryTextButtonTheme : _theme.getSecondaryTextButtonTheme;
129
+ themeFunc = _theme.getTextButtonTheme;
97
130
  }
98
131
 
99
132
  var _themeFunc = themeFunc(theme, style),
@@ -115,9 +148,14 @@ var TextButton = function TextButton(_ref) {
115
148
  hoverColor: hoverColor,
116
149
  iconSize: iconSize,
117
150
  disabled: disabled
118
- }, props), /*#__PURE__*/_react["default"].createElement(IconContainer, {
151
+ }, props), /*#__PURE__*/_react["default"].createElement(RelativeParent, null, /*#__PURE__*/_react["default"].createElement(HideOnLoading, {
152
+ show: !loading
153
+ }, /*#__PURE__*/_react["default"].createElement(IconContainer, {
119
154
  isLeft: true
120
- }, leftIconComponent), textJSX, /*#__PURE__*/_react["default"].createElement(IconContainer, null, rightIconComponent));
155
+ }, leftIconComponent), textJSX, /*#__PURE__*/_react["default"].createElement(IconContainer, null, rightIconComponent)), /*#__PURE__*/_react["default"].createElement(Loader, {
156
+ show: loading,
157
+ size: size === _sharedEnum.Size.S ? 18 : 24
158
+ })));
121
159
  };
122
160
 
123
161
  TextButton.propTypes = {
@@ -126,14 +164,13 @@ TextButton.propTypes = {
126
164
  text: _propTypes["default"].string,
127
165
  size: _propTypes["default"].oneOf(Object.values(_sharedEnum.Size)),
128
166
  theme: _propTypes["default"].oneOf(Object.values(_theme2.THEME)),
129
- type: _propTypes["default"].oneOf(Object.values(_enums.Type)),
130
167
  style: _propTypes["default"].oneOf(Object.values(_enums.Style)),
131
168
  active: _propTypes["default"].bool,
132
- disabled: _propTypes["default"].bool
169
+ disabled: _propTypes["default"].bool,
170
+ loading: _propTypes["default"].bool
133
171
  };
134
172
  TextButton.THEME = _theme2.THEME;
135
173
  TextButton.Size = _sharedEnum.Size;
136
- TextButton.Type = _enums.Type;
137
174
  TextButton.Style = _enums.Style;
138
175
  var _default = TextButton;
139
176
  exports["default"] = _default;
@@ -25,7 +25,6 @@ var _default = {
25
25
  component: _textButton["default"],
26
26
  argTypes: {
27
27
  theme: _constants.THEME_STORYBOOK_ARG_TYPE,
28
- type: (0, _getEnumArg.getRadioArg)(_enums.Type, _enums.Type.PRIMARY),
29
28
  style: (0, _getEnumArg.getRadioArg)(_enums.Style, _enums.Style.DARK),
30
29
  size: _constants.SIZE_STORYBOOK_ARG_TYPE,
31
30
  // showLeft & showRight args are only for storybook check
@@ -49,10 +48,10 @@ var textButton = {
49
48
  text: '文字',
50
49
  size: _textButton["default"].Size.S,
51
50
  theme: _textButton["default"].THEME.normal,
52
- type: _textButton["default"].Type.PRIMARY,
53
51
  style: _textButton["default"].Style.DARK,
54
52
  active: false,
55
53
  disabled: false,
54
+ loading: false,
56
55
  leftIconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
57
56
  direction: "left"
58
57
  }),
@@ -83,10 +82,10 @@ var toggleIconDisplay = {
83
82
  text: '文字',
84
83
  size: _textButton["default"].Size.S,
85
84
  theme: _textButton["default"].THEME.normal,
86
- type: _textButton["default"].Type.PRIMARY,
87
85
  style: _textButton["default"].Style.DARK,
88
86
  active: false,
89
- disabled: false
87
+ disabled: false,
88
+ loading: false
90
89
  },
91
90
  parameters: {
92
91
  controls: {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSecondaryTextButtonTheme = exports.getSecondaryIconButtonTheme = exports.getPrimaryTextButtonTheme = exports.getPrimaryIconButtonTheme = exports.getOutlinePillButtonTheme = exports.getIconWithTextButtonTheme = exports.getFilledPillButtonTheme = exports.getDisabledTextButtonTheme = exports.getActiveTextButtonTheme = exports["default"] = void 0;
6
+ exports.getTextButtonTheme = exports.getSecondaryIconButtonTheme = exports.getPrimaryIconButtonTheme = exports.getOutlinePillButtonTheme = exports.getIconWithTextButtonTheme = exports.getFilledPillButtonTheme = exports.getDisabledTextButtonTheme = exports.getActiveTextButtonTheme = exports["default"] = void 0;
7
7
 
8
8
  var _color = require("@twreporter/core/lib/constants/color");
9
9
 
@@ -16,11 +16,30 @@ var getFilledPillButtonTheme = function getFilledPillButtonTheme(theme, disabled
16
16
  if (disabled) {
17
17
  switch (theme) {
18
18
  case _theme.THEME.transparent:
19
+ switch (style) {
20
+ case _enums.Style.LIGHT:
21
+ return {
22
+ color: _color.colorGrayscale.white,
23
+ bgColor: _color.colorGrayscale.gray400,
24
+ hoverColor: _color.colorGrayscale.white,
25
+ hoverBgColor: _color.colorGrayscale.gray400
26
+ };
27
+
28
+ default:
29
+ return {
30
+ color: _color.colorGrayscale.gray700,
31
+ bgColor: _color.colorGrayscale.gray500,
32
+ hoverColor: _color.colorGrayscale.gray700,
33
+ hoverBgColor: _color.colorGrayscale.gray500
34
+ };
35
+ }
36
+
37
+ case _theme.THEME.photography:
19
38
  return {
20
- color: _color.colorGrayscale.white,
21
- bgColor: _color.colorGrayscale.gray200,
22
- hoverColor: _color.colorGrayscale.white,
23
- hoverBgColor: _color.colorGrayscale.gray200
39
+ color: _color.colorGrayscale.gray700,
40
+ bgColor: _color.colorGrayscale.gray500,
41
+ hoverColor: _color.colorGrayscale.gray700,
42
+ hoverBgColor: _color.colorGrayscale.gray500
24
43
  };
25
44
 
26
45
  default:
@@ -35,20 +54,60 @@ var getFilledPillButtonTheme = function getFilledPillButtonTheme(theme, disabled
35
54
 
36
55
  switch (theme) {
37
56
  case _theme.THEME.photography:
38
- return {
39
- color: _color.colorPhoto.dark,
40
- bgColor: _color.colorSupportive.pastel,
41
- hoverColor: _color.colorGrayscale.white,
42
- hoverBgColor: _color.colorSupportive.heavy
43
- };
57
+ switch (style) {
58
+ case _enums.Style.DARK:
59
+ return {
60
+ color: _color.colorPhoto.dark,
61
+ bgColor: _color.colorGrayscale.white,
62
+ hoverColor: _color.colorPhoto.dark,
63
+ hoverBgColor: _color.colorGrayscale.gray200
64
+ };
65
+
66
+ case _enums.Style.LIGHT:
67
+ return {
68
+ color: _color.colorPhoto.dark,
69
+ bgColor: _color.colorGrayscale.gray300,
70
+ hoverColor: _color.colorPhoto.dark,
71
+ hoverBgColor: _color.colorGrayscale.gray400
72
+ };
73
+
74
+ case _enums.Style.BRAND:
75
+ default:
76
+ return {
77
+ color: _color.colorPhoto.dark,
78
+ bgColor: _color.colorSupportive.faded,
79
+ hoverColor: _color.colorPhoto.dark,
80
+ hoverBgColor: _color.colorSupportive.pastel
81
+ };
82
+ }
44
83
 
45
84
  case _theme.THEME.transparent:
46
- return {
47
- color: _color.colorGrayscale.gray600,
48
- bgColor: _color.colorGrayscale.white,
49
- hoverColor: _color.colorGrayscale.white,
50
- hoverBgColor: _color.colorGrayscale.gray400
51
- };
85
+ switch (style) {
86
+ case _enums.Style.DARK:
87
+ return {
88
+ color: _color.colorGrayscale.gray800,
89
+ bgColor: _color.colorGrayscale.gray300,
90
+ hoverColor: _color.colorGrayscale.gray800,
91
+ hoverBgColor: _color.colorGrayscale.gray400
92
+ };
93
+
94
+ case _enums.Style.LIGHT:
95
+ return {
96
+ color: _color.colorGrayscale.white,
97
+ bgColor: _color.colorGrayscale.gray800,
98
+ hoverColor: _color.colorGrayscale.white,
99
+ hoverBgColor: _color.colorGrayscale.black
100
+ };
101
+
102
+ case _enums.Style.BRAND:
103
+ default:
104
+ return {
105
+ color: _color.colorGrayscale.gray800,
106
+ bgColor: _color.colorGrayscale.white,
107
+ hoverColor: _color.colorGrayscale.gray800,
108
+ hoverBgColor: _color.colorGrayscale.gray200
109
+ };
110
+ }
52
111
 
53
112
  case _theme.THEME.normal:
54
113
  case _theme.THEME.index:
@@ -89,19 +148,30 @@ var getOutlinePillButtonTheme = function getOutlinePillButtonTheme(theme, disabl
89
148
  if (disabled) {
90
149
  switch (theme) {
91
150
  case _theme.THEME.transparent:
92
- return {
93
- color: _color.colorGrayscale.gray200,
94
- bgColor: _color.colorGrayscale.gray200,
95
- hoverColor: _color.colorGrayscale.gray200,
96
- hoverBgColor: _color.colorGrayscale.gray200
97
- };
151
+ switch (style) {
152
+ case _enums.Style.LIGHT:
153
+ return {
154
+ color: _color.colorGrayscale.gray400,
155
+ bgColor: _color.colorGrayscale.gray400,
156
+ hoverColor: _color.colorGrayscale.gray400,
157
+ hoverBgColor: _color.colorGrayscale.gray400
158
+ };
159
+
160
+ default:
161
+ return {
162
+ color: _color.colorGrayscale.gray500,
163
+ bgColor: _color.colorGrayscale.gray500,
164
+ hoverColor: _color.colorGrayscale.gray500,
165
+ hoverBgColor: _color.colorGrayscale.gray500
166
+ };
167
+ }
98
168
 
99
169
  case _theme.THEME.photography:
100
170
  return {
101
- color: _color.colorGrayscale.gray600,
102
- bgColor: _color.colorGrayscale.gray200,
103
- hoverColor: _color.colorGrayscale.gray600,
104
- hoverBgColor: _color.colorGrayscale.gray200
171
+ color: _color.colorGrayscale.gray500,
172
+ bgColor: _color.colorGrayscale.gray500,
173
+ hoverColor: _color.colorGrayscale.gray500,
174
+ hoverBgColor: _color.colorGrayscale.gray500
105
175
  };
106
176
 
107
177
  default:
@@ -116,20 +186,60 @@ var getOutlinePillButtonTheme = function getOutlinePillButtonTheme(theme, disabl
116
186
 
117
187
  switch (theme) {
118
188
  case _theme.THEME.photography:
119
- return {
120
- color: _color.colorSupportive.pastel,
121
- bgColor: _color.colorSupportive.pastel,
122
- hoverColor: _color.colorSupportive.heavy,
123
- hoverBgColor: _color.colorSupportive.heavy
124
- };
189
+ switch (style) {
190
+ case _enums.Style.DARK:
191
+ return {
192
+ color: _color.colorGrayscale.white,
193
+ bgColor: _color.colorGrayscale.white,
194
+ hoverColor: _color.colorGrayscale.gray200,
195
+ hoverBgColor: _color.colorGrayscale.gray200
196
+ };
197
+
198
+ case _enums.Style.LIGHT:
199
+ return {
200
+ color: _color.colorGrayscale.gray300,
201
+ bgColor: _color.colorGrayscale.gray300,
202
+ hoverColor: _color.colorGrayscale.gray400,
203
+ hoverBgColor: _color.colorGrayscale.gray400
204
+ };
205
+
206
+ case _enums.Style.BRAND:
207
+ default:
208
+ return {
209
+ color: _color.colorSupportive.faded,
210
+ bgColor: _color.colorSupportive.faded,
211
+ hoverColor: _color.colorSupportive.pastel,
212
+ hoverBgColor: _color.colorSupportive.pastel
213
+ };
214
+ }
125
215
 
126
216
  case _theme.THEME.transparent:
127
- return {
128
- color: _color.colorGrayscale.white,
129
- bgColor: _color.colorGrayscale.white,
130
- hoverColor: _color.colorGrayscale.gray600,
131
- hoverBgColor: _color.colorGrayscale.gray600
132
- };
217
+ switch (style) {
218
+ case _enums.Style.DARK:
219
+ return {
220
+ color: _color.colorGrayscale.gray300,
221
+ bgColor: _color.colorGrayscale.gray300,
222
+ hoverColor: _color.colorGrayscale.gray400,
223
+ hoverBgColor: _color.colorGrayscale.gray400
224
+ };
225
+
226
+ case _enums.Style.LIGHT:
227
+ return {
228
+ color: _color.colorGrayscale.gray800,
229
+ bgColor: _color.colorGrayscale.gray800,
230
+ hoverColor: _color.colorGrayscale.black,
231
+ hoverBgColor: _color.colorGrayscale.black
232
+ };
233
+
234
+ case _enums.Style.BRAND:
235
+ default:
236
+ return {
237
+ color: _color.colorGrayscale.white,
238
+ bgColor: _color.colorGrayscale.white,
239
+ hoverColor: _color.colorGrayscale.gray200,
240
+ hoverBgColor: _color.colorGrayscale.gray200
241
+ };
242
+ }
133
243
 
134
244
  case _theme.THEME.normal:
135
245
  case _theme.THEME.index:
@@ -322,61 +432,44 @@ var getIconWithTextButtonTheme = function getIconWithTextButtonTheme(theme, isAc
322
432
 
323
433
  exports.getIconWithTextButtonTheme = getIconWithTextButtonTheme;
324
434
 
325
- var getPrimaryTextButtonTheme = function getPrimaryTextButtonTheme(theme, style) {
435
+ var getTextButtonTheme = function getTextButtonTheme(theme, style) {
326
436
  switch (theme) {
327
437
  case _theme.THEME.photography:
328
- return {
329
- color: _color.colorGrayscale.white,
330
- hoverColor: _color.colorSupportive.pastel
331
- };
332
-
333
- case _theme.THEME.transparent:
334
- return {
335
- color: _color.colorGrayscale.white,
336
- hoverColor: _color.colorGrayscale.gray800
337
- };
338
-
339
- case _theme.THEME.normal:
340
- default:
341
438
  switch (style) {
342
439
  case _enums.Style.DARK:
343
440
  return {
344
- color: _color.colorGrayscale.gray800,
345
- hoverColor: _color.colorBrand.heavy
441
+ color: _color.colorGrayscale.white,
442
+ hoverColor: _color.colorSupportive.pastel
346
443
  };
347
444
 
348
445
  case _enums.Style.LIGHT:
349
446
  return {
350
- color: _color.colorGrayscale.gray600,
351
- hoverColor: _color.colorGrayscale.gray800
447
+ color: _color.colorGrayscale.gray300,
448
+ hoverColor: _color.colorGrayscale.gray400
352
449
  };
353
450
 
354
- case _enums.Style.BRAND:
355
451
  default:
452
+ case _enums.Style.BRAND:
356
453
  return {
357
- color: _color.colorBrand.heavy,
358
- hoverColor: _color.colorBrand.dark
454
+ color: _color.colorSupportive.faded,
455
+ hoverColor: _color.colorSupportive.pastel
359
456
  };
360
457
  }
361
458
 
362
- }
363
- };
364
-
365
- exports.getPrimaryTextButtonTheme = getPrimaryTextButtonTheme;
366
-
367
- var getSecondaryTextButtonTheme = function getSecondaryTextButtonTheme(theme, style) {
368
- switch (theme) {
369
- case _theme.THEME.photography:
370
- return {
371
- color: _color.colorGrayscale.gray400,
372
- hoverColor: _color.colorSupportive.pastel
373
- };
374
-
375
459
  case _theme.THEME.transparent:
376
- return {
377
- color: _color.colorGrayscale.gray600,
378
- hoverColor: _color.colorGrayscale.gray800
379
- };
460
+ switch (style) {
461
+ case _enums.Style.LIGHT:
462
+ return {
463
+ color: _color.colorGrayscale.gray800,
464
+ hoverColor: _color.colorGrayscale.black
465
+ };
466
+
467
+ default:
468
+ return {
469
+ color: _color.colorGrayscale.white,
470
+ hoverColor: _color.colorGrayscale.gray200
471
+ };
472
+ }
380
473
 
381
474
  case _theme.THEME.normal:
382
475
  default:
@@ -404,20 +497,20 @@ var getSecondaryTextButtonTheme = function getSecondaryTextButtonTheme(theme, st
404
497
  }
405
498
  };
406
499
 
407
- exports.getSecondaryTextButtonTheme = getSecondaryTextButtonTheme;
500
+ exports.getTextButtonTheme = getTextButtonTheme;
408
501
 
409
502
  var getDisabledTextButtonTheme = function getDisabledTextButtonTheme(theme) {
410
503
  switch (theme) {
411
504
  case _theme.THEME.photography:
412
505
  return {
413
- color: _color.colorGrayscale.gray600,
414
- hoverColor: _color.colorGrayscale.gray600
506
+ color: _color.colorGrayscale.gray500,
507
+ hoverColor: _color.colorGrayscale.gray500
415
508
  };
416
509
 
417
510
  case _theme.THEME.transparent:
418
511
  return {
419
- color: _color.colorGrayscale.gray200,
420
- hoverColor: _color.colorGrayscale.gray200
512
+ color: _color.colorGrayscale.gray500,
513
+ hoverColor: _color.colorGrayscale.gray500
421
514
  };
422
515
 
423
516
  case _theme.THEME.normal:
@@ -434,16 +527,34 @@ exports.getDisabledTextButtonTheme = getDisabledTextButtonTheme;
434
527
  var getActiveTextButtonTheme = function getActiveTextButtonTheme(theme, style) {
435
528
  switch (theme) {
436
529
  case _theme.THEME.photography:
437
- return {
438
- color: _color.colorSupportive.pastel,
439
- hoverColor: _color.colorSupportive.pastel
440
- };
530
+ switch (style) {
531
+ case _enums.Style.LIGHT:
532
+ return {
533
+ color: _color.colorGrayscale.gray400,
534
+ hoverColor: _color.colorGrayscale.gray400
535
+ };
536
+
537
+ default:
538
+ return {
539
+ color: _color.colorSupportive.pastel,
540
+ hoverColor: _color.colorSupportive.pastel
541
+ };
542
+ }
441
543
 
442
544
  case _theme.THEME.transparent:
443
- return {
444
- color: _color.colorGrayscale.white,
445
- hoverColor: _color.colorGrayscale.white
446
- };
545
+ switch (style) {
546
+ case _enums.Style.LIGHT:
547
+ return {
548
+ color: _color.colorGrayscale.black,
549
+ hoverColor: _color.colorGrayscale.black
550
+ };
551
+
552
+ default:
553
+ return {
554
+ color: _color.colorGrayscale.gray200,
555
+ hoverColor: _color.colorGrayscale.gray200
556
+ };
557
+ }
447
558
 
448
559
  case _theme.THEME.normal:
449
560
  default:
@@ -478,8 +589,7 @@ var _default = {
478
589
  getPrimaryIconButtonTheme: getPrimaryIconButtonTheme,
479
590
  getSecondaryIconButtonTheme: getSecondaryIconButtonTheme,
480
591
  getIconWithTextButtonTheme: getIconWithTextButtonTheme,
481
- getPrimaryTextButtonTheme: getPrimaryTextButtonTheme,
482
- getSecondaryTextButtonTheme: getSecondaryTextButtonTheme,
592
+ getTextButtonTheme: getTextButtonTheme,
483
593
  getDisabledTextButtonTheme: getDisabledTextButtonTheme,
484
594
  getActiveTextButtonTheme: getActiveTextButtonTheme
485
595
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twreporter/react-components",
3
- "version": "8.25.0-rc.0",
3
+ "version": "8.25.0-rc.1",
4
4
  "main": "lib/index.js",
5
5
  "repository": "https://github.com/twreporter/twreporter-npm-packages.git",
6
6
  "author": "twreporter <developer@twreporter.org>",
@@ -51,5 +51,5 @@
51
51
  "react-dom": "^16.0.0",
52
52
  "storybook": "^7.5.2"
53
53
  },
54
- "gitHead": "42b025c9e74ea6697305ccabfa5dada913efc099"
54
+ "gitHead": "05f6618e9155fe4a2918fc0363d43172b9c7857c"
55
55
  }