@grafana/plugin-ui 0.1.15 → 0.1.16

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.
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataSourceDescription = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const css_1 = require("@emotion/css");
7
+ const ui_1 = require("@grafana/ui");
8
+ const DataSourceDescription = ({ dataSourceName, docsLink, hasRequiredFields = true, }) => {
9
+ const theme = (0, ui_1.useTheme2)();
10
+ const styles = {
11
+ text: (0, css_1.css) `
12
+ font-size: 14px;
13
+ a {
14
+ color: ${theme.colors.primary.text};
15
+ text-decoration: underline;
16
+ :hover {
17
+ text-decoration: none;
18
+ }
19
+ }
20
+ `,
21
+ asterisk: (0, css_1.css) `
22
+ color: ${theme.colors.error.main};
23
+ `,
24
+ };
25
+ return (react_1.default.createElement(react_1.default.Fragment, null,
26
+ react_1.default.createElement("p", { className: styles.text },
27
+ "Before you can use the ",
28
+ dataSourceName,
29
+ " data source, you must configure it below or in the config file.",
30
+ react_1.default.createElement("br", null),
31
+ "For detailed instructions,",
32
+ " ",
33
+ react_1.default.createElement("a", { href: docsLink, target: "_blank", rel: "noreferrer" }, "view the documentation"),
34
+ "."),
35
+ hasRequiredFields && (react_1.default.createElement("p", { className: styles.text },
36
+ react_1.default.createElement("em", null,
37
+ "Fields marked in ",
38
+ react_1.default.createElement("span", { className: styles.asterisk }, "*"),
39
+ " are required")))));
40
+ };
41
+ exports.DataSourceDescription = DataSourceDescription;
42
+ //# sourceMappingURL=DataSourceDescription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataSourceDescription.js","sourceRoot":"","sources":["../../../src/components/ConfigEditor/DataSourceDescription.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,sCAAmC;AACnC,oCAAwC;AAQjC,MAAM,qBAAqB,GAAoB,CAAC,EACrD,cAAc,EACd,QAAQ,EACR,iBAAiB,GAAG,IAAI,GACzB,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,IAAA,cAAS,GAAE,CAAC;IAC1B,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,IAAA,SAAG,EAAA;;;iBAGI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI;;;;;;KAMrC;QACD,QAAQ,EAAE,IAAA,SAAG,EAAA;eACF,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI;KACjC;KACF,CAAC;IAEF,OAAO,CACL;QACE,qCAAG,SAAS,EAAE,MAAM,CAAC,IAAI;;YACC,cAAc;;YAEtC,yCAAM;;YACqB,GAAG;YAC9B,qCAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,6BAE/C;gBAEF;QACH,iBAAiB,IAAI,CACpB,qCAAG,SAAS,EAAE,MAAM,CAAC,IAAI;YACvB;;gBACmB,wCAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,QAAU;gCAExD,CACH,CACL,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,qBAAqB,yBA4ChC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InlineLabel = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const css_1 = require("@emotion/css");
7
+ const ui_1 = require("@grafana/ui");
8
+ const InlineLabel = (_a) => {
9
+ var { children, required = false } = _a, props = tslib_1.__rest(_a, ["children", "required"]);
10
+ const theme = (0, ui_1.useTheme2)();
11
+ const styles = {
12
+ asterisk: (0, css_1.css) `
13
+ color: ${theme.colors.error.main};
14
+ `,
15
+ };
16
+ return (react_1.default.createElement(ui_1.InlineLabel, Object.assign({}, props),
17
+ react_1.default.createElement("span", null,
18
+ children,
19
+ required && (react_1.default.createElement(react_1.default.Fragment, null,
20
+ "\u00A0",
21
+ react_1.default.createElement("span", { className: styles.asterisk }, "*"))))));
22
+ };
23
+ exports.InlineLabel = InlineLabel;
24
+ //# sourceMappingURL=InlineLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineLabel.js","sourceRoot":"","sources":["../../../src/components/ConfigEditor/InlineLabel.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,sCAAmC;AACnC,oCAA4E;AAMrE,MAAM,WAAW,GAAoB,CAAC,EAI5C,EAAE,EAAE;QAJwC,EAC3C,QAAQ,EACR,QAAQ,GAAG,KAAK,OAEjB,EADI,KAAK,sBAHmC,wBAI5C,CADS;IAER,MAAM,KAAK,GAAG,IAAA,cAAS,GAAE,CAAC;IAE1B,MAAM,MAAM,GAAG;QACb,QAAQ,EAAE,IAAA,SAAG,EAAA;eACF,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI;KACjC;KACF,CAAC;IAEF,OAAO,CACL,8BAAC,gBAAmB,oBAAK,KAAK;QAC5B;YACG,QAAQ;YACR,QAAQ,IAAI,CACX;;gBACQ,wCAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,QAAU,CAC/C,CACJ,CACI,CACa,CACvB,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,WAAW,eAyBtB"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataSourceDescription = exports.InlineLabel = void 0;
4
+ var InlineLabel_1 = require("./InlineLabel");
5
+ Object.defineProperty(exports, "InlineLabel", { enumerable: true, get: function () { return InlineLabel_1.InlineLabel; } });
6
+ var DataSourceDescription_1 = require("./DataSourceDescription");
7
+ Object.defineProperty(exports, "DataSourceDescription", { enumerable: true, get: function () { return DataSourceDescription_1.DataSourceDescription; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ConfigEditor/index.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA"}
@@ -22,6 +22,7 @@ var ui_1 = require("@grafana/ui");
22
22
  Object.defineProperty(exports, "InlineSwitch", { enumerable: true, get: function () { return ui_1.InlineSwitch; } });
23
23
  Object.defineProperty(exports, "CertificationKey", { enumerable: true, get: function () { return ui_1.CertificationKey; } });
24
24
  tslib_1.__exportStar(require("./QueryEditor"), exports);
25
+ tslib_1.__exportStar(require("./ConfigEditor"), exports);
25
26
  var CustomHeadersSettings_1 = require("./CustomHeadersSettings/CustomHeadersSettings");
26
27
  Object.defineProperty(exports, "CustomHeadersSettings", { enumerable: true, get: function () { return CustomHeadersSettings_1.CustomHeadersSettings; } });
27
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;AAAA,iFAAgF;AAAvE,0HAAA,mBAAmB,OAAA;AAC5B,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AACvB,+DAGuC;AAFrC,8GAAA,aAAa,OAAA;AAGf,6CAG2B;AAFzB,kGAAA,OAAO,OAAA;AAGT,sDAAsE;AAA7D,wGAAA,UAAU,OAAA;AACnB,iFAImD;AAHjD,0HAAA,mBAAmB,OAAA;AAEnB,iHAAA,UAAU,OAAA;AAEZ,8EAAoD;AACpD,sDAA4B;AAC5B,8DAAoC;AACpC,kCAA6D;AAApD,kGAAA,YAAY,OAAA;AAAE,sGAAA,gBAAgB,OAAA;AACvC,wDAA8B;AAC9B,uFAAsF;AAA7E,8HAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;AAAA,iFAAgF;AAAvE,0HAAA,mBAAmB,OAAA;AAC5B,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AACvB,+DAGuC;AAFrC,8GAAA,aAAa,OAAA;AAGf,6CAG2B;AAFzB,kGAAA,OAAO,OAAA;AAGT,sDAAsE;AAA7D,wGAAA,UAAU,OAAA;AACnB,iFAImD;AAHjD,0HAAA,mBAAmB,OAAA;AAEnB,iHAAA,UAAU,OAAA;AAEZ,8EAAoD;AACpD,sDAA4B;AAC5B,8DAAoC;AACpC,kCAA6D;AAApD,kGAAA,YAAY,OAAA;AAAE,sGAAA,gBAAgB,OAAA;AACvC,wDAA8B;AAC9B,yDAA+B;AAC/B,uFAAsF;AAA7E,8HAAA,qBAAqB,OAAA"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ declare type Props = {
3
+ dataSourceName: string;
4
+ docsLink: string;
5
+ hasRequiredFields?: boolean;
6
+ };
7
+ export declare const DataSourceDescription: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { InlineLabel as OriginalInlineLabel } from "@grafana/ui";
3
+ declare type Props = React.ComponentProps<typeof OriginalInlineLabel> & {
4
+ required?: boolean;
5
+ };
6
+ export declare const InlineLabel: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ export { InlineLabel } from "./InlineLabel";
2
+ export { DataSourceDescription } from "./DataSourceDescription";
@@ -9,4 +9,5 @@ export * from './DataLinks';
9
9
  export * from './Cascader/Cascader';
10
10
  export { InlineSwitch, CertificationKey } from '@grafana/ui';
11
11
  export * from './QueryEditor';
12
+ export * from './ConfigEditor';
12
13
  export { CustomHeadersSettings } from './CustomHeadersSettings/CustomHeadersSettings';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/plugin-ui",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "repository": "git@github.com:grafana/plugin-ui.git",
5
5
  "author": "Grafana Labs",
6
6
  "main": "dist/index.js",