td-stylekit 26.6.0 → 26.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [26.7.0](https://github.com/treasure-data/td-stylekit/compare/v26.6.0...v26.7.0) (2022-05-10)
2
+
3
+
4
+ ### Features
5
+
6
+ * **CON-9936:** Add Sign-in with Google component ([#1271](https://github.com/treasure-data/td-stylekit/issues/1271)) ([84af1f3](https://github.com/treasure-data/td-stylekit/commit/84af1f3))
7
+
1
8
  # [26.6.0](https://github.com/treasure-data/td-stylekit/compare/v26.5.0...v26.6.0) (2022-04-29)
2
9
 
3
10
 
package/README.md CHANGED
@@ -36,6 +36,24 @@ return () => (
36
36
  | `download:snapshots` | copy changed snapshots from CircleCI |
37
37
  | `publish:yalc` | publishes stylekit to yalc |
38
38
 
39
+ ## Etiquette
40
+
41
+ ### Writing stories
42
+
43
+ As of May 2022, stories must be specified in the following format:
44
+
45
+ ```
46
+ import type { Meta, Story } from '@storybook/react'
47
+
48
+ export default {
49
+ title: 'v5/Control', // <-- Change as necessary
50
+ .... // and other properties
51
+ } as Meta
52
+
53
+ ```
54
+
55
+ This ensures that all `*.stories.tsx` are parsed correctly and available for visual regression tests.
56
+
39
57
  ## Testing td-stylekit locally in other projects
40
58
 
41
59
  To test td-stylekit locally in other projects perform the following steps:
@@ -0,0 +1,17 @@
1
+ import type { ReactElement } from 'react';
2
+ declare type GoogleProps = {
3
+ dark?: boolean;
4
+ text?: string;
5
+ };
6
+ /**
7
+ * Google Sign-in button component
8
+ *
9
+ * Note: When using this component, make sure that Roboto font is available
10
+ *
11
+ * ```
12
+ * <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet" />
13
+ * ```
14
+ */
15
+ declare const Google: ({ dark, text }: GoogleProps) => ReactElement;
16
+ export default Google;
17
+ //# sourceMappingURL=Google.d.ts.map
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _Text = _interopRequireDefault(require("../Text"));
9
+
10
+ var _Button = _interopRequireDefault(require("../Button"));
11
+
12
+ var _googleLogo = _interopRequireDefault(require("./logos/googleLogo"));
13
+
14
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
18
+ if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
19
+ if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
20
+
21
+ /**
22
+ * Google Sign-in button component
23
+ *
24
+ * Note: When using this component, make sure that Roboto font is available
25
+ *
26
+ * ```
27
+ * <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet" />
28
+ * ```
29
+ */
30
+ var Google = function Google(_ref) {
31
+ var _ref$dark = _ref.dark,
32
+ dark = _ref$dark === void 0 ? false : _ref$dark,
33
+ _ref$text = _ref.text,
34
+ text = _ref$text === void 0 ? 'Sign-in with Google' : _ref$text;
35
+ return (0, _jsxRuntime.jsxs)(_Button["default"], {
36
+ "data-gs": gs("src", "google", "google.tsx", "button"),
37
+ css: function css(_theme) {
38
+ return {
39
+ height: '50px',
40
+ width: '240px',
41
+ marginLeft: 0,
42
+ justifyContent: 'left',
43
+ borderRadius: 1,
44
+ borderWidth: 1,
45
+ paddingLeft: 0,
46
+ paddingRight: '8px',
47
+ backgroundColor: dark ? '#4285F4' : '#ffffff',
48
+ '&:active': {
49
+ backgroundColor: dark ? '#4285F4' : '#ffffff',
50
+ boxShadow: 'none'
51
+ },
52
+ '&:focus': {
53
+ outlineOffset: 0
54
+ }
55
+ };
56
+ },
57
+ children: [(0, _jsxRuntime.jsx)("div", {
58
+ "data-gs": gs("src", "google", "google.tsx", "button", "div"),
59
+ css: function css() {
60
+ return {
61
+ padding: '15px',
62
+ background: '#ffffff',
63
+ height: '48px',
64
+ width: '48px'
65
+ };
66
+ },
67
+ children: (0, _jsxRuntime.jsx)(_googleLogo["default"], {
68
+ "data-gs": gs("src", "google", "google.tsx", "button", "div", "google-logo")
69
+ })
70
+ }), (0, _jsxRuntime.jsx)(_Text["default"], {
71
+ "data-gs-c": gsC(text),
72
+ "data-gs": gs("src", "google", "google.tsx", "button", "text"),
73
+ css: function css() {
74
+ return {
75
+ color: dark ? 'rgba(255,255,255,100%)' : 'rgba(0,0,0,54%)',
76
+ marginLeft: '6px',
77
+ fontSize: '14px',
78
+ fontFamily: 'Roboto, sans-serif',
79
+ textTransform: 'none',
80
+ fontWeight: 500
81
+ };
82
+ },
83
+ children: text
84
+ })]
85
+ });
86
+ };
87
+
88
+ var _default = Google;
89
+ exports["default"] = _default;
@@ -0,0 +1,2 @@
1
+ export { default } from './Google';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Google["default"];
10
+ }
11
+ });
12
+
13
+ var _Google = _interopRequireDefault(require("./Google"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
+
17
+ if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
18
+ if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
@@ -0,0 +1,3 @@
1
+ declare const GoogleLogo: () => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export default GoogleLogo;
3
+ //# sourceMappingURL=googleLogo.d.ts.map
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
9
+
10
+ if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
11
+ if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
12
+
13
+ var GoogleLogo = function GoogleLogo() {
14
+ return (0, _jsxRuntime.jsx)("svg", {
15
+ "data-gs": gs("src", "google", "logos", "svg"),
16
+ width: "18px",
17
+ height: "18px",
18
+ viewBox: "0 0 18 18",
19
+ version: "1.1",
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ children: (0, _jsxRuntime.jsxs)("g", {
22
+ "data-gs": gs("src", "google", "logos", "svg", "g"),
23
+ id: "Google-Button",
24
+ stroke: "none",
25
+ strokeWidth: "1",
26
+ fill: "none",
27
+ fillRule: "evenodd",
28
+ children: [(0, _jsxRuntime.jsx)("path", {
29
+ "data-gs": gs("src", "google", "logos", "svg", "g", "path"),
30
+ d: "M17.64,9.20454545 C17.64,8.56636364 17.5827273,7.95272727 17.4763636,7.36363636 L9,7.36363636 L9,10.845 L13.8436364,10.845 C13.635,11.97 13.0009091,12.9231818 12.0477273,13.5613636 L12.0477273,15.8195455 L14.9563636,15.8195455 C16.6581818,14.2527273 17.64,11.9454545 17.64,9.20454545 L17.64,9.20454545 Z",
31
+ fill: "#4285F4"
32
+ }), (0, _jsxRuntime.jsx)("path", {
33
+ "data-gs": gs("src", "google", "logos", "svg", "g", "path"),
34
+ d: "M9,18 C11.43,18 13.4672727,17.1940909 14.9563636,15.8195455 L12.0477273,13.5613636 C11.2418182,14.1013636 10.2109091,14.4204545 9,14.4204545 C6.65590909,14.4204545 4.67181818,12.8372727 3.96409091,10.71 L0.957272727,10.71 L0.957272727,13.0418182 C2.43818182,15.9831818 5.48181818,18 9,18 L9,18 Z",
35
+ fill: "#34A853"
36
+ }), (0, _jsxRuntime.jsx)("path", {
37
+ "data-gs": gs("src", "google", "logos", "svg", "g", "path"),
38
+ d: "M3.96409091,10.71 C3.78409091,10.17 3.68181818,9.59318182 3.68181818,9 C3.68181818,8.40681818 3.78409091,7.83 3.96409091,7.29 L3.96409091,4.95818182 L0.957272727,4.95818182 C0.347727273,6.17318182 0,7.54772727 0,9 C0,10.4522727 0.347727273,11.8268182 0.957272727,13.0418182 L3.96409091,10.71 L3.96409091,10.71 Z",
39
+ fill: "#FBBC05"
40
+ }), (0, _jsxRuntime.jsx)("path", {
41
+ "data-gs": gs("src", "google", "logos", "svg", "g", "path"),
42
+ d: "M9,3.57954545 C10.3213636,3.57954545 11.5077273,4.03363636 12.4404545,4.92545455 L15.0218182,2.34409091 C13.4631818,0.891818182 11.4259091,0 9,0 C5.48181818,0 2.43818182,2.01681818 0.957272727,4.95818182 L3.96409091,7.29 C4.67181818,5.16272727 6.65590909,3.57954545 9,3.57954545 L9,3.57954545 Z",
43
+ fill: "#EA4335"
44
+ })]
45
+ })
46
+ });
47
+ };
48
+
49
+ var _default = GoogleLogo;
50
+ exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "td-stylekit",
3
- "version": "26.6.0",
3
+ "version": "26.7.0",
4
4
  "main": "dist/es/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",