@twreporter/react-components 8.27.1-rc.0 → 8.27.1-rc.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.
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
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.27.1-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.27.0...@twreporter/react-components@8.27.1-rc.0) (2024-04-17)
6
+ ## [8.27.1-rc.2](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.27.1-rc.1...@twreporter/react-components@8.27.1-rc.2) (2024-04-17)
7
7
 
8
8
  **Note:** Version bump only for package @twreporter/react-components
9
9
 
@@ -11,75 +11,54 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [8.27.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.27.0-rc.1...@twreporter/react-components@8.27.0) (2024-04-08)
14
+ ## [8.27.1-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.27.1-rc.0...@twreporter/react-components@8.27.1-rc.1) (2024-04-17)
15
15
 
16
- **Note:** Version bump only for package @twreporter/react-components
16
+ ### Bug Fixes
17
+
18
+ - add background color control ([dd103fc](https://github.com/twreporter/twreporter-npm-packages/commit/dd103fc332a5c877e0b078cb98682aefd68ad900))
19
+ - update color in colorGrayscale & add color story ([f27d752](https://github.com/twreporter/twreporter-npm-packages/commit/f27d752ae97e15d64e59126dfed07f09471cff4a))
17
20
 
21
+ ## [8.27.1-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.27.0...@twreporter/react-components@8.27.1-rc.0) (2024-04-17)
18
22
 
23
+ **Note:** Version bump only for package @twreporter/react-components
19
24
 
25
+ # [8.27.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.27.0-rc.1...@twreporter/react-components@8.27.0) (2024-04-08)
20
26
 
27
+ **Note:** Version bump only for package @twreporter/react-components
21
28
 
22
29
  # [8.27.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.27.0-rc.0...@twreporter/react-components@8.27.0-rc.1) (2024-03-27)
23
30
 
24
-
25
31
  ### Bug Fixes
26
32
 
27
- * pagination number position center ([6d933f1](https://github.com/twreporter/twreporter-npm-packages/commit/6d933f11695b3aa5ad02190be943dfd51e2a11af))
28
-
29
-
30
-
31
-
33
+ - pagination number position center ([6d933f1](https://github.com/twreporter/twreporter-npm-packages/commit/6d933f11695b3aa5ad02190be943dfd51e2a11af))
32
34
 
33
35
  # [8.27.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.26.0...@twreporter/react-components@8.27.0-rc.0) (2024-03-25)
34
36
 
35
-
36
37
  ### Features
37
38
 
38
- * add className prop ([f2d85fa](https://github.com/twreporter/twreporter-npm-packages/commit/f2d85fa1fcfc4afa4feddb6a001946580fe0d6cb))
39
- * add mobile pagination ([d128cba](https://github.com/twreporter/twreporter-npm-packages/commit/d128cbafea8459eb03cdac22614e8ec067a89bad))
40
- * adjust mobile pagination logic ([708f41b](https://github.com/twreporter/twreporter-npm-packages/commit/708f41bb9df638f1b41a15528c73aec7b24639f3))
41
-
42
-
43
-
44
-
39
+ - add className prop ([f2d85fa](https://github.com/twreporter/twreporter-npm-packages/commit/f2d85fa1fcfc4afa4feddb6a001946580fe0d6cb))
40
+ - add mobile pagination ([d128cba](https://github.com/twreporter/twreporter-npm-packages/commit/d128cbafea8459eb03cdac22614e8ec067a89bad))
41
+ - adjust mobile pagination logic ([708f41b](https://github.com/twreporter/twreporter-npm-packages/commit/708f41bb9df638f1b41a15528c73aec7b24639f3))
45
42
 
46
43
  # [8.26.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.26.0-rc.4...@twreporter/react-components@8.26.0) (2024-03-13)
47
44
 
48
45
  **Note:** Version bump only for package @twreporter/react-components
49
46
 
50
-
51
-
52
-
53
-
54
47
  # [8.26.0-rc.4](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.26.0-rc.3...@twreporter/react-components@8.26.0-rc.4) (2024-03-12)
55
48
 
56
-
57
49
  ### Bug Fixes
58
50
 
59
- * spacing and new link ([1da8f3c](https://github.com/twreporter/twreporter-npm-packages/commit/1da8f3cca6b8a79ff9f120cce16d29749cef7333))
60
-
61
-
62
-
63
-
51
+ - spacing and new link ([1da8f3c](https://github.com/twreporter/twreporter-npm-packages/commit/1da8f3cca6b8a79ff9f120cce16d29749cef7333))
64
52
 
65
53
  # [8.26.0-rc.3](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.26.0-rc.2...@twreporter/react-components@8.26.0-rc.3) (2024-03-11)
66
54
 
67
55
  **Note:** Version bump only for package @twreporter/react-components
68
56
 
69
-
70
-
71
-
72
-
73
57
  # [8.26.0-rc.2](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.26.0-rc.1...@twreporter/react-components@8.26.0-rc.2) (2024-03-11)
74
58
 
75
-
76
59
  ### Features
77
60
 
78
- * add element id for gtm ([7725be4](https://github.com/twreporter/twreporter-npm-packages/commit/7725be4d5033567797cce595c8ad9f61b33d5ef7))
79
-
80
-
81
-
82
-
61
+ - add element id for gtm ([7725be4](https://github.com/twreporter/twreporter-npm-packages/commit/7725be4d5033567797cce595c8ad9f61b33d5ef7))
83
62
 
84
63
  # [8.26.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.26.0-rc.0...@twreporter/react-components@8.26.0-rc.1) (2024-03-07)
85
64
 
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.colorSet = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
+
14
+ var _color = require("@twreporter/core/lib/constants/color");
15
+
16
+ var _getEnumArg = require("./storybook/utils/get-enum-arg");
17
+
18
+ var _paragraph = require("./text/paragraph");
19
+
20
+ var _map = _interopRequireDefault(require("lodash/map"));
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
24
+ /* eslint react/display-name:0 */
25
+ // lodash
26
+ var _ = {
27
+ map: _map["default"]
28
+ };
29
+
30
+ var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
31
+ displayName: "colorstories__Container",
32
+ componentId: "sc-1icwolq-0"
33
+ })(["display:flex;width:100vw;height:100vh;background-color:", ";"], function (props) {
34
+ return props.background;
35
+ });
36
+
37
+ var Box = /*#__PURE__*/_styledComponents["default"].div.withConfig({
38
+ displayName: "colorstories__Box",
39
+ componentId: "sc-1icwolq-1"
40
+ })(["display:flex;align-items:center;justify-content:center;flex-direction:column;"]);
41
+
42
+ var Color = /*#__PURE__*/_styledComponents["default"].div.withConfig({
43
+ displayName: "colorstories__Color",
44
+ componentId: "sc-1icwolq-2"
45
+ })(["height:", ";width:", ";background-color:", ";"], function (props) {
46
+ return props.height;
47
+ }, function (props) {
48
+ return props.width;
49
+ }, function (props) {
50
+ return props.color;
51
+ });
52
+
53
+ var P2Gray600 = /*#__PURE__*/(0, _styledComponents["default"])(_paragraph.P2).withConfig({
54
+ displayName: "colorstories__P2Gray600",
55
+ componentId: "sc-1icwolq-3"
56
+ })(["color:", ";"], _color.colorGrayscale.gray600);
57
+ var ColorText = /*#__PURE__*/(0, _styledComponents["default"])(_paragraph.P2).withConfig({
58
+ displayName: "colorstories__ColorText",
59
+ componentId: "sc-1icwolq-4"
60
+ })(["", " color:", ";"], function (props) {
61
+ return props.show ? '' : 'display: none;';
62
+ }, _color.colorGrayscale.gray500);
63
+ var ColorSetEnum = {
64
+ BRAND: 'brand',
65
+ GRAYSCALE: 'grayscale',
66
+ OPACITY: 'opacity',
67
+ PHOTO: 'photography',
68
+ PODCAST: 'podcast',
69
+ SUPPORTIVE: 'supportive',
70
+ SEMANTIC: 'semantic',
71
+ PINK_ARTICLE: 'pink_article'
72
+ };
73
+
74
+ var getColorSet = function getColorSet(type) {
75
+ switch (type) {
76
+ case ColorSetEnum.BRAND:
77
+ return _color.colorBrand;
78
+
79
+ case ColorSetEnum.GRAYSCALE:
80
+ return _color.colorGrayscale;
81
+
82
+ case ColorSetEnum.OPACITY:
83
+ return _color.colorOpacity;
84
+
85
+ case ColorSetEnum.PHOTO:
86
+ return _color.colorPhoto;
87
+
88
+ case ColorSetEnum.PODCAST:
89
+ return _color.colorPodcast;
90
+
91
+ case ColorSetEnum.SUPPORTIVE:
92
+ return _color.colorSupportive;
93
+
94
+ case ColorSetEnum.SEMANTIC:
95
+ return _color.COLOR_SEMANTIC;
96
+
97
+ case ColorSetEnum['PINK_ARTICLE']:
98
+ return _color.COLOR_PINK_ARTICLE;
99
+ }
100
+ };
101
+
102
+ var ColorSet = function ColorSet(_ref) {
103
+ var height = _ref.height,
104
+ width = _ref.width,
105
+ type = _ref.type,
106
+ showColorText = _ref.showColorText,
107
+ background = _ref.background;
108
+ var colorSet = getColorSet(type);
109
+
110
+ var colorBoxes = _.map(colorSet, function (color, key) {
111
+ return /*#__PURE__*/_react["default"].createElement(Box, {
112
+ key: "".concat(type, "-").concat(key)
113
+ }, /*#__PURE__*/_react["default"].createElement(P2Gray600, {
114
+ text: key
115
+ }), /*#__PURE__*/_react["default"].createElement(Color, {
116
+ height: height,
117
+ width: width,
118
+ color: color
119
+ }), /*#__PURE__*/_react["default"].createElement(ColorText, {
120
+ text: color,
121
+ show: showColorText
122
+ }));
123
+ });
124
+
125
+ return /*#__PURE__*/_react["default"].createElement(Container, {
126
+ background: background
127
+ }, colorBoxes);
128
+ };
129
+
130
+ ColorSet.propTypes = {
131
+ background: _propTypes["default"].string,
132
+ height: _propTypes["default"].string,
133
+ width: _propTypes["default"].string,
134
+ type: _propTypes["default"].oneOf(Object.values(ColorSetEnum)),
135
+ showColorText: _propTypes["default"].bool
136
+ };
137
+ var _default = {
138
+ title: 'Color',
139
+ component: ColorSet,
140
+ argTypes: {
141
+ type: (0, _getEnumArg.getRadioArg)(ColorSetEnum, ColorSetEnum.GRAYSCALE),
142
+ background: {
143
+ control: {
144
+ type: 'color',
145
+ presetColors: [_color.colorGrayscale.gray100, _color.colorPhoto.dark, _color.colorGrayscale.gray600]
146
+ }
147
+ }
148
+ }
149
+ };
150
+ exports["default"] = _default;
151
+ var colorSet = {
152
+ args: {
153
+ height: '100px',
154
+ width: '100px',
155
+ type: ColorSetEnum.GRAYSCALE,
156
+ showColorText: false,
157
+ background: _color.colorGrayscale.gray100
158
+ }
159
+ };
160
+ exports.colorSet = colorSet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twreporter/react-components",
3
- "version": "8.27.1-rc.0",
3
+ "version": "8.27.1-rc.2",
4
4
  "main": "lib/index.js",
5
5
  "repository": "https://github.com/twreporter/twreporter-npm-packages.git",
6
6
  "author": "twreporter <developer@twreporter.org>",
@@ -15,8 +15,8 @@
15
15
  "chromatic": "npx chromatic --exit-zero-on-changes"
16
16
  },
17
17
  "dependencies": {
18
- "@twreporter/core": "^1.19.1-rc.0",
19
- "@twreporter/redux": "^7.11.3-rc.0",
18
+ "@twreporter/core": "^1.20.0-rc.0",
19
+ "@twreporter/redux": "^7.11.3-rc.2",
20
20
  "fontfaceobserver-es": "^3.3.3",
21
21
  "hoist-non-react-statics": "^2.3.1",
22
22
  "lodash": "^4.0.0",
@@ -51,5 +51,5 @@
51
51
  "react-dom": "^16.0.0",
52
52
  "storybook": "^7.5.2"
53
53
  },
54
- "gitHead": "2ccfeb87fefdcc4fc6c267c01987f41da353b65a"
54
+ "gitHead": "96b2be81fb228ea415e1aaf895b1acbd2893a605"
55
55
  }