@openremote/or-gauge 1.3.0-snapshot.20250117092414 → 1.3.0-snapshot.20250117163435

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,63 @@
1
+ import { getWcStorybookHelpers } from "wc-storybook-helpers";
2
+ import "@openremote/or-gauge";
3
+
4
+ const { events, args, argTypes, template } = getWcStorybookHelpers("or-gauge");
5
+
6
+ /** @type { import('@storybook/web-components').Meta } */
7
+ const meta = {
8
+ title: 'Playground/or-gauge',
9
+ component: 'or-gauge',
10
+ args,
11
+ argTypes,
12
+ parameters: {
13
+ actions: {
14
+ handles: events,
15
+ },
16
+ }
17
+ };
18
+
19
+ /** @type { import('@storybook/web-components').StoryObj } */
20
+ export const Primary = {
21
+ args: {
22
+ min: 0,
23
+ max: 10,
24
+ value: 6,
25
+ thresholds: JSON.stringify([
26
+ [0, "#4caf50"],
27
+ [5, "#ff9800"],
28
+ [8, "#ef5350"],
29
+ ])
30
+ },
31
+ parameters: {
32
+ docs: {
33
+ source: {
34
+ code: getExampleCode()
35
+ },
36
+ story: {
37
+ height: '200px'
38
+ }
39
+ }
40
+ },
41
+ render: (args) => template(args),
42
+ };
43
+
44
+ /* ------------------------------------------------------- */
45
+ /* UTILITY FUNCTIONS */
46
+ /* ------------------------------------------------------- */
47
+
48
+ function getExampleCode() {
49
+
50
+ //language=javascript
51
+ return `
52
+ import "@openremote/or-gauge";
53
+
54
+ // (OPTIONAL) set the thresholds;
55
+ const thresholds = [[0, "#4caf50"], [5, "#ff9800"], [8, "#ef5350"]];
56
+ // const thresholdsStr = JSON.stringify(thresholds);
57
+
58
+ // in your HTML code use this, and inject them;
59
+ <or-gauge min="0" value="6" max="10" thresholds="thresholdsStr"></or-gauge>
60
+ `
61
+ }
62
+
63
+ export default meta;